diff options
author | Andres P <aepd87@gmail.com> | 2010-06-17 14:44:49 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2010-06-20 17:04:57 +0200 |
commit | 70418e48f6c0033a1bf942fec0bbc001d3d0d8f5 (patch) | |
tree | 88ff165309d8151589d22234bd378a8fc2bc0944 | |
parent | c7a37d039bc4361077fdf77180b35b81bd8b12a7 (diff) | |
download | pacman-70418e48f6c0033a1bf942fec0bbc001d3d0d8f5.tar.gz pacman-70418e48f6c0033a1bf942fec0bbc001d3d0d8f5.tar.xz |
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>
-rw-r--r-- | scripts/makepkg.sh.in | 38 |
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 |