summaryrefslogtreecommitdiffstats
path: root/bin/putpkgtree
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-03-05 22:49:56 +0100
committerJustin Davis <jrcd83@gmail.com>2012-03-05 22:49:56 +0100
commit75bddd0e24674d76a2518dcbdced5a015b550775 (patch)
treec6cc9e33ced7447a0ad0ef08f66eb660120d1b2e /bin/putpkgtree
parentbd9d357c9344f9c23919f5300ce780be2e2ddda0 (diff)
downloadgenpkg-75bddd0e24674d76a2518dcbdced5a015b550775.tar.gz
genpkg-75bddd0e24674d76a2518dcbdced5a015b550775.tar.xz
Replace old pkgtree scripts with new simpler ones.
Diffstat (limited to 'bin/putpkgtree')
-rwxr-xr-xbin/putpkgtree26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/putpkgtree b/bin/putpkgtree
new file mode 100755
index 0000000..f415108
--- /dev/null
+++ b/bin/putpkgtree
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+prog=putpkgtree
+
+err()
+{
+ code="$1"
+ shift
+ echo $@ 1>&2
+ exit "$code"
+}
+
+if [ "$#" -ne 3 ]
+then
+ echo "usage: $prog [file] [section] ['beg'/'body'/'end'] < [text to append]" 1>&2
+ exit 2
+fi
+
+[ -d "$1" ] || err 101 "$prog: package file does not exist: $1"
+cd "$1"
+
+[ -d "$2" ] || err 102 "$prog: section does not exist: $2" 1>&2
+cd "$2"
+
+[ -f "$3" ] || err 103 "$prog: subsection does not exist: $3"
+cat >> "$3"