summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/conf.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/conf.sh b/src/lib/conf.sh
index f6ae91d..2dc5b70 100644
--- a/src/lib/conf.sh
+++ b/src/lib/conf.sh
@@ -150,3 +150,37 @@ set_conf_makepkg() {
done
return 1
}
+
+# PKGBUILD (not configuration, per se) #########################################
+
+unset_PKGBUILD() {
+ # This routine is based primarily off of the PKGBUILD(5) man-page,
+ # version 4.1.2, dated 2013-06-18.
+
+ # From the "OPTIONS AND DIRECTIVES" section (in order of mention)
+ unset -v pkgname pkgver
+ unset -f pkgver
+ unset -v pkgrel pkgdesc epoch url license install changelog source
+ unset -v noextract md5sums sha{1,256,384,512}sums groups arch backup
+ unset -v depends makedepends checkdepends optdepends conflicts provides
+ unset -v replaces options
+
+ # From the "PACKAGING FUNCTIONS" section (in order of mention)
+ unset -f package prepare build check
+
+ # From the "PACKAGE SPLITTING" section
+ unset -f $(declare -f|sed -n 's/^\(package_\S*\) ()\s*$/\1/p')
+ unset -v pkgbase
+
+ # These are used by the `librefetch` program
+ unset -v mksource mknoextract mkmd5sums mksha{1,256,384,512}sums
+ unset -v mkdepends
+ unset -f mksource
+}
+
+load_PKGBUILD() {
+ local file=${1:-./PKGBUILD}
+ unset_PKGBUILD
+ CARCH="$(get_conf_makepkg CARCH "`uname -m`")"
+ . "$file"
+}