summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-25 21:45:07 +0200
committerErich Eckner <git@eckner.net>2017-06-25 21:45:07 +0200
commit2bde02269f5c157c90da2e8412885de7ea497af2 (patch)
tree0db2f020bf9177ce5280819fe04b88f05187fc01 /bin
parent906bc372e5f389e6bfb690fdab6bc076d66a3c2c (diff)
downloadbuilder-2bde02269f5c157c90da2e8412885de7ea497af2.tar.xz
bin/mksrcinfo: source PKGBUILD and printf variables
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mksrcinfo22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/mksrcinfo b/bin/mksrcinfo
index 7dc62e1..e412178 100755
--- a/bin/mksrcinfo
+++ b/bin/mksrcinfo
@@ -3,12 +3,18 @@
# generate .SRCINFO from PKGBUILD
# bleh - this should really be handled by makepkg!
-# TODO:
+(
+ . ./PKGBUILD
-# maybe source PKGBUILD instead of 'makepkg --printsrcinfo' and
-# 'mksrcinfo'?
-
-grep -q '\$CARCH' 'PKGBUILD' && \
- CARCH=i686 makepkg --printsrcinfo > \
- '.SRCINFO' || \
- mksrcinfo -o .SRCINFO
+ if [ -z "${pkgbase}" ]; then
+ printf 'pkgbase = %s\n' "${pkgname}"
+ else
+ printf 'pkgbase = %s\n' "${pkgbase}"
+ fi
+ printf '\tarch = %s\n' "${arch[@]}"
+ printf '\tmakedepends = %s\n' "${makedepends[@]}"
+ printf '\tcheckdepends = %s\n' "${checkdepends[@]}"
+ printf '\tdepends = %s\n' "${depends[@]}"
+ printf '\tprovides = %s\n' "${provides[@]}"
+ printf 'pkgname = %s\n' "${pkgname[@]}"
+) > .SRCINFO