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/pkgbuild-check-licenses | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/pkgbuild-check-licenses') diff --git a/src/pkgbuild-check-licenses b/src/pkgbuild-check-licenses index 846a6e4..c6c8132 100755 --- a/src/pkgbuild-check-licenses +++ b/src/pkgbuild-check-licenses @@ -24,19 +24,13 @@ . libremessages -# Unset any PKGBUILD variables inherited from the environment -# I took these from makepkg 4.1.1-1 -unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides -unset md5sums replaces depends conflicts backup source install changelog build -unset makedepends optdepends options noextract - # Usage: check_deps $pkgbuild # Check whether a PKGBUILD package depends on non-free packages check_licenses() ( # Note that we use () instead of {} for this function; so that variables # from the PKBUILD don't bubble up local pkgbuild=$1 - . "$pkgbuild" + load_PKGBUILD "$pkgbuild" if [[ -z $pkgname ]]; then return $_E_ERROR # not a PKGBUILD fi -- cgit v1.2.3-54-g00ecf