diff options
Diffstat (limited to 'bin/addln')
-rwxr-xr-x | bin/addln | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/bin/addln b/bin/addln deleted file mode 100755 index 6a39dbd..0000000 --- a/bin/addln +++ /dev/null @@ -1,21 +0,0 @@ -#!/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 -' |