From b369d323c9859290e2f29c6d07e7f0394ed88cd9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 27 Jun 2013 21:15:00 -0600 Subject: 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. --- src/toru/toru-path | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/toru/toru-path') diff --git a/src/toru/toru-path b/src/toru/toru-path index 3f35dbe..ca87e48 100755 --- a/src/toru/toru-path +++ b/src/toru/toru-path @@ -32,7 +32,7 @@ msg "Updating path cache" msg2 "${#pkgbuilds[@]} PKGBUILDs to update" for _pkgbuild in ${pkgbuilds[@]}; do # plain "$_pkgbuild" - source ${_pkgbuild} >/dev/null 2>&1 || { + load_PKGBUILD "${_pkgbuild}" >/dev/null 2>&1 || { error "${_pkgbuild} contains errors, skipping" continue } @@ -43,8 +43,6 @@ for _pkgbuild in ${pkgbuilds[@]}; do $VERBOSE && msg2 "${_pkg} -> ${fullpath}" tcamgr put ${PATHFILE} ${_pkg/[<>=]*} ${fullpath} done - - unset pkgbase pkgname provides done lastsync ${LASTSYNCFILE} -- cgit v1.2.3-54-g00ecf