summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2011-09-13 02:37:40 +0200
committerJustin Davis <jrcd83@gmail.com>2011-09-13 02:37:40 +0200
commit00bc1b4d6e10932608e971047effa208e330e325 (patch)
treec13a034a79f6dcbe6e4a3082d30c20af9065f294
parent4f94b12490329c9cb1fe9a824989ef566b8df712 (diff)
downloadgenpkg-00bc1b4d6e10932608e971047effa208e330e325.tar.gz
genpkg-00bc1b4d6e10932608e971047effa208e330e325.tar.xz
New addln script adds lines to PKGBUILD funcs. Fix perlbrew's license.
The LICENSE file had to be copied to the standard location. This required the new addln script to be created.
-rwxr-xr-xbin/addln21
-rw-r--r--pbj/perlbrew.pbj5
2 files changed, 25 insertions, 1 deletions
diff --git a/bin/addln b/bin/addln
new file mode 100755
index 0000000..6a39dbd
--- /dev/null
+++ b/bin/addln
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [ $# -lt 1 ] ; then
+ cat 1>&2 <<EOF
+Usage: addln [PKGBUILD function] [line of bash]
+
+Reads the PKGBUILD from standard input, adding a line at the end of the
+specified bash function. The line can be empty to just add a newline.
+EOF
+ exit 1
+fi
+
+fname=$1
+shift
+
+awk -v fname="$fname" -v line="$*" '
+match($0, "^[ \\t]*" fname "\\(\\)") { active = 1 }
+active && match($0, /^[ ]+/) { indent = substr($0, 1, RLENGTH) }
+active && /^}/ { active = 0; print indent "" line }
+1
+'
diff --git a/pbj/perlbrew.pbj b/pbj/perlbrew.pbj
index 6a61bdc..78e7482 100644
--- a/pbj/perlbrew.pbj
+++ b/pbj/perlbrew.pbj
@@ -4,4 +4,7 @@
> checkdepends
< makedepends perl-path-class
> checkdepends
-= license MIT
+= license custom:MIT
+| addln package
+| addln package 'mkdir -p "$pkgdir/usr/share/licenses/perlbrew"'
+| addln package 'cp LICENSE "$pkgdir/usr/share/licenses/perlbrew/LICENSE"'