makepkg: allow pkgname usage in split package functions

Currently, using $pkgname in a split package package_*() function
always returns the first value in the pkgname array rather than the
name of tha package being packaged.  Fix this so $pkgname gives the
expected value.

Fixes FS#22174

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2010-12-25 13:14:55 +10:00 committed by Dan McGee
parent a7972625e3
commit eb93955477

View file

@ -1406,17 +1406,19 @@ restore_package_variables() {
} }
run_split_packaging() { run_split_packaging() {
for pkg in ${pkgname[@]}; do local pkgname_backup=${pkgname[@]}
pkgdir="$pkgdir/$pkg" for pkgname in ${pkgname_backup[@]}; do
pkgdir="$pkgdir/$pkgname"
mkdir -p "$pkgdir" mkdir -p "$pkgdir"
chmod a-s "$pkgdir" chmod a-s "$pkgdir"
backup_package_variables backup_package_variables
run_package $pkg run_package $pkgname
tidy_install tidy_install
create_package $pkg create_package $pkgname
restore_package_variables restore_package_variables
pkgdir="${pkgdir%/*}" pkgdir="${pkgdir%/*}"
done done
pkgname=${pkgname_backup[@]}
} }
# Canonicalize a directory path if it exists # Canonicalize a directory path if it exists