diff options
-rwxr-xr-x | bin/addln | 21 | ||||
-rwxr-xr-x | bin/pbj | 62 | ||||
-rwxr-xr-x | bin/pbjexpand | 19 | ||||
-rwxr-xr-x | bin/tweakmeta | 3 |
4 files changed, 2 insertions, 103 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 -' diff --git a/bin/pbj b/bin/pbj deleted file mode 100755 index a8e41df..0000000 --- a/bin/pbj +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -VERSION=0.01 - -die() { - echo "error: $*" - exit 1 -} - -pbjtopkg() -{ - pkg=$1 - rm -rf "$pkgroot/$pkg" - mkdir "$pkgroot/$pkg" - cd "$pkgroot/$pkg" - - jamfile="$jamdir/$1.pbj" - if [ ! -f "$jamfile" ] - then - die "$jamfile is missing" - fi - - # Match the pkgname to the .pbj filename. - # Provide values for other things macros won't be able to. - printf "+ pkgname $pkg\n+ pkgrel ${PKGREL:-1}\n+ pbjver $VERSION\n" \ - | cat - "$jamfile" \ - | pbjexpand \ - | awk -f "$bindir/pbjparse.awk" \ - > PKGMETA - - if [ $? -ne 0 ] - then - die "Failed to write $pkgroot/$pkg/PKGMETA" - fi - - # pbjparse.awk also creates a makepb script in our cwd. - if ! ./makepb >PKGBUILD - then - die "makepb failed, error code $?" - fi - - echo "$pkgroot/$pkg/PKGBUILD" -} - -if [ -z "$1" ]; then die "Usage: $0 [package name]"; fi -if [ "$PBJROOT" ]; then cd "$PBJROOT"; fi - -bindir="$(pwd)/bin" -if [ ! -d "$bindir" ]; then die "$bindir does not exist"; fi -PATH="$PATH:$bindir" - -if [ -n "$PKGROOT" ]; then pkgroot="$PKGROOT" -else pkgroot="$(pwd)/pkg" -fi - -if [ ! -d "$pkgroot" ]; then die "$pkgroot does not exist"; fi - -jamdir="$(pwd)/pbj" -if [ ! -d "$jamdir" ]; then die "$jamdir does not exist"; fi - -export PATH="$PATH:$bindir/macros:$bindir/templ" -for pbj; do pbjtopkg "$pbj"; done diff --git a/bin/pbjexpand b/bin/pbjexpand deleted file mode 100755 index ed86301..0000000 --- a/bin/pbjexpand +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -cat $1 | while read op arg -do - case "$op" in - '!') - expdepth=$((expdepth + 1)) - if [ "$expdepth" -gt 10 ] - then - echo 'pbjexpand: depth of 10 recursive macros, aborting.' 1>&2 - exit 1 - fi - - export expdepth - $arg | $0 ;; - *) - echo $op $arg - esac -done diff --git a/bin/tweakmeta b/bin/tweakmeta index 2900a94..32fda08 100755 --- a/bin/tweakmeta +++ b/bin/tweakmeta @@ -118,7 +118,8 @@ function findval (field, prefix, i, len) len = pbcount[field] if (len == 0) die(field " is empty!") - for (i=1; i<=len; i++) if (index(pbvars[field, i], prefix) == 0) break + for (i = 1; i <= len; i++) + if (index(pbvars[field,i], prefix) == 1) break if (i > len) die("could not find " prefix " in " field "'s values") return i } |