From 70418e48f6c0033a1bf942fec0bbc001d3d0d8f5 Mon Sep 17 00:00:00 2001 From: Andres P Date: Thu, 17 Jun 2010 08:14:49 -0430 Subject: 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 [Allan: rename function] Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'scripts/makepkg.sh.in') 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 -- cgit v1.2.3-70-g09d2