summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndres P <aepd87@gmail.com>2010-06-17 08:14:49 -0430
committerAllan McRae <allan@archlinux.org>2010-06-21 01:04:57 +1000
commit70418e48f6c0033a1bf942fec0bbc001d3d0d8f5 (patch)
tree88ff165309d8151589d22234bd378a8fc2bc0944 /scripts
parentc7a37d039bc4361077fdf77180b35b81bd8b12a7 (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in38
1 files changed, 16 insertions, 22 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2c2d330b..8a3d00b3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1376,6 +1376,20 @@ restore_package_variables() {
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
parse_options() {
local short_options=$1; shift;
@@ -1842,17 +1856,7 @@ if (( INFAKEROOT )); then
fi
create_package
else
- 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
+ run_split_packaging
fi
msg "$(gettext "Leaving fakeroot environment.")"
@@ -1970,17 +1974,7 @@ else
fi
create_package
else
- 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
+ run_split_packaging
fi
else
if (( ! REPKG && ( PKGFUNC || SPLITPKG ) )); then