From 12aba89ed2100552ddfe7d69bbd9e35a2019d098 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Tue, 15 Sep 2009 09:19:02 +0200 Subject: parse_pkgbuilds.sh : fix pkgbase handling add the default value for pkgbase also rework slightly how variables are handled (better distinction between splitpkg variables and the rest) Signed-off-by: Xavier Chantry Signed-off-by: Aaron Griffin --- cron-jobs/check_archlinux/parse_pkgbuilds.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cron-jobs') diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh index c2df7d1..5cd17e4 100755 --- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh +++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh @@ -5,18 +5,19 @@ exit() { return; } -variables=('pkgname' 'pkgver' 'pkgrel' 'depends' 'makedepends' 'provides' 'conflicts' ) -readonly -a variables +splitpkg_overrides=('depends' 'optdepends' 'provides' 'conflicts') +variables=('pkgname' 'pkgbase' 'pkgver' 'pkgrel' 'makedepends' 'arch' ${splitpkg_overrides[@]}) +readonly -a variables splitpkg_overrides backup_package_variables() { - for var in ${variables[@]}; do + for var in ${splitpkg_overrides[@]}; do indirect="${var}_backup" eval "${indirect}=(\${$var[@]})" done } restore_package_variables() { - for var in ${variables[@]}; do + for var in ${splitpkg_overrides[@]}; do indirect="${var}_backup" if [ -n "${!indirect}" ]; then eval "${var}=(\${$indirect[@]})" @@ -82,6 +83,7 @@ source_pkgbuild() { fi if [ "${#pkgname[@]}" -gt "1" ]; then + pkgbase=${pkgbase:-${pkgname[0]}} for pkg in ${pkgname[@]}; do if [ "$(type -t package_${pkg})" != "function" ]; then echo -e "%INVALID%\n$pkgbuild\n" -- cgit v1.2.3-54-g00ecf