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-nonfree | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/pkgbuild-check-nonfree') diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index 0f1f6ff..6f2ae2f 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -24,19 +24,13 @@ . libremessages . libreblacklist -# 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_deps() ( # 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 exit 1 # not a PKGBUILD fi -- cgit v1.2.3-2-g168b