1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

makepkg: merge in-line splitpkg handling logic

Ease maintainace; the two parts that have been combined into a function were
identical.

Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: rename function]
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andres P 2010-06-17 08:14:49 -04:30 committed by Allan McRae
parent c7a37d039b
commit 70418e48f6

View File

@ -1376,6 +1376,20 @@ restore_package_variables() {
done done
} }
run_split_packaging() {
for pkg in ${pkgname[@]}; do
pkgdir="$pkgdir/$pkg"
mkdir -p "$pkgdir"
chmod a-s "$pkgdir"
backup_package_variables
run_package $pkg
tidy_install
create_package $pkg
restore_package_variables
pkgdir="${pkgdir%/*}"
done
}
# getopt like parser # getopt like parser
parse_options() { parse_options() {
local short_options=$1; shift; local short_options=$1; shift;
@ -1842,17 +1856,7 @@ if (( INFAKEROOT )); then
fi fi
create_package create_package
else else
for pkg in ${pkgname[@]}; do run_split_packaging
pkgdir="$pkgdir/$pkg"
mkdir -p "$pkgdir"
chmod a-s "$pkgdir"
backup_package_variables
run_package $pkg
tidy_install
create_package $pkg
restore_package_variables
pkgdir="${pkgdir%/*}"
done
fi fi
msg "$(gettext "Leaving fakeroot environment.")" msg "$(gettext "Leaving fakeroot environment.")"
@ -1970,17 +1974,7 @@ else
fi fi
create_package create_package
else else
for pkg in ${pkgname[@]}; do run_split_packaging
pkgdir="$pkgdir/$pkg"
mkdir -p "$pkgdir"
chmod a-s "$pkgdir"
backup_package_variables
run_package $pkg
tidy_install
create_package $pkg
restore_package_variables
pkgdir="${pkgdir%/*}"
done
fi fi
else else
if (( ! REPKG && ( PKGFUNC || SPLITPKG ) )); then if (( ! REPKG && ( PKGFUNC || SPLITPKG ) )); then