From 2bde02269f5c157c90da2e8412885de7ea497af2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 25 Jun 2017 21:45:07 +0200 Subject: bin/mksrcinfo: source PKGBUILD and printf variables --- bin/mksrcinfo | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3-70-g09d2