makepkg: Create a single-package packaging function
Merge the similar code handling unsplit PKGBUILDs and individual packages in a split PKGBUILD and make it a new function. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
7c5958e0eb
commit
2f15921230
1 changed files with 15 additions and 16 deletions
|
@ -922,20 +922,25 @@ restore_package_variables() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_single_packaging() {
|
||||||
|
pkgdir="$pkgdirbase/$pkgname"
|
||||||
|
mkdir "$pkgdir"
|
||||||
|
if [[ -n $1 ]] || (( PKGFUNC )); then
|
||||||
|
run_package $1
|
||||||
|
fi
|
||||||
|
tidy_install
|
||||||
|
lint_package || exit $E_PACKAGE_FAILED
|
||||||
|
create_package
|
||||||
|
}
|
||||||
|
|
||||||
run_split_packaging() {
|
run_split_packaging() {
|
||||||
local pkgname_backup=("${pkgname[@]}")
|
local pkgname_backup=("${pkgname[@]}")
|
||||||
backup_package_variables
|
backup_package_variables
|
||||||
for pkgname in ${pkgname_backup[@]}; do
|
for pkgname in ${pkgname_backup[@]}; do
|
||||||
pkgdir="$pkgdirbase/$pkgname"
|
run_single_packaging $pkgname
|
||||||
mkdir "$pkgdir"
|
|
||||||
run_package $pkgname
|
|
||||||
tidy_install
|
|
||||||
lint_package || exit $E_PACKAGE_FAILED
|
|
||||||
create_package
|
|
||||||
restore_package_variables
|
restore_package_variables
|
||||||
done
|
done
|
||||||
pkgname=("${pkgname_backup[@]}")
|
pkgname=("${pkgname_backup[@]}")
|
||||||
create_debug_package
|
|
||||||
}
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
@ -1337,19 +1342,13 @@ if (( INFAKEROOT )); then
|
||||||
|
|
||||||
chmod 755 "$pkgdirbase"
|
chmod 755 "$pkgdirbase"
|
||||||
if (( ! SPLITPKG )); then
|
if (( ! SPLITPKG )); then
|
||||||
pkgdir="$pkgdirbase/$pkgname"
|
run_single_packaging
|
||||||
mkdir "$pkgdir"
|
|
||||||
if (( PKGFUNC )); then
|
|
||||||
run_package
|
|
||||||
fi
|
|
||||||
tidy_install
|
|
||||||
lint_package || exit $E_PACKAGE_FAILED
|
|
||||||
create_package
|
|
||||||
create_debug_package
|
|
||||||
else
|
else
|
||||||
run_split_packaging
|
run_split_packaging
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
create_debug_package
|
||||||
|
|
||||||
msg "$(gettext "Leaving %s environment.")" "fakeroot"
|
msg "$(gettext "Leaving %s environment.")" "fakeroot"
|
||||||
exit $E_OK
|
exit $E_OK
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue