diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-27 21:15:00 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-27 21:15:00 -0600 |
commit | b369d323c9859290e2f29c6d07e7f0394ed88cd9 (patch) | |
tree | b0454d30775d3ab662b9c4c9e4bd24094c98ce19 /src/toru/toru-info | |
parent | 81c44824f174eda5f57c396cc7d91e2c97490d93 (diff) |
add {load,unset}_PKGBUILD to conf.sh, use it.
There are a bunch of caveats to loading a PKGBUILD file. This way it is
all done correctly in one place.
unset_PKGBUILD unsets any functions and variables that are normally set in
a PKGBUILD. The list is far more complete than any existing
implementation.
load_PKGBUILD loads the file given, or "./PKGBUILD" if none is given. But
first it calls unset_PKGBUILD and then sets CARCH.
Diffstat (limited to 'src/toru/toru-info')
-rwxr-xr-x | src/toru/toru-info | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/toru/toru-info b/src/toru/toru-info index 5b6fd01..6418de4 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -1,12 +1,13 @@ #!/bin/bash # Prints info about a given pkgname . libremessages +. $(librelib conf) for _pkg in $@; do _pkgbuild="$(toru-where $_pkg)" if [ -f "$_pkgbuild/PKGBUILD" ]; then - source "$_pkgbuild/PKGBUILD" 2>/dev/null || { + load_PKGBUILD "$_pkgbuild/PKGBUILD" 2>/dev/null || { warning "Errors on %s" $_pkg continue } @@ -14,8 +15,6 @@ for _pkg in $@; do deps="${depends[@]} ${makedepends[@]} ${checkdepends[@]}" repo="$(basename $(dirname "$_pkgbuild"))" - unset build package depends makedepends checkdepends optdepends source md5sums - msg "%s/%s %s-%s" $repo $_pkg $pkgver $pkgrel msg2 "$pkgdesc" msg2 "$url" @@ -23,6 +22,4 @@ for _pkg in $@; do else warning "%s doesn't exist" $_pkg fi - - unset pkgname pkgver pkgrel pkgdesc url done |