[pacman-dev,04/10] makepkg: Pull out single-package packaging

Message ID 9de55f68c33fb16eca69053cb21fd640e0ac4a11.1527783895.git.jan.steffens@gmail.com
State Superseded, archived
Headers show
Series [pacman-dev,01/10] libmakepkg/util/option: Refactor checking to reduce code duplication | expand

Commit Message

Jan Alexander Steffens May 31, 2018, 4:24 p.m. UTC
Put this into a new function close to run_split_packaging so similar
code is nearby.
---
 scripts/makepkg.sh.in | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4684e444..f8f43540 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1121,6 +1121,18 @@  backup_package_variables() {
 	done
 }
 
+run_solo_packaging() {
+	pkgdir="$pkgdirbase/$pkgname"
+	mkdir "$pkgdir"
+	if (( PKGFUNC )); then
+		run_package
+	fi
+	tidy_install
+	lint_package || exit $E_PACKAGE_FAILED
+	create_package
+	create_debug_package
+}
+
 run_split_packaging() {
 	local pkgname_backup=("${pkgname[@]}")
 	local restore_package_variables
@@ -1537,15 +1549,7 @@  if (( INFAKEROOT )); then
 
 	chmod 755 "$pkgdirbase"
 	if (( ! SPLITPKG )); then
-		pkgdir="$pkgdirbase/$pkgname"
-		mkdir "$pkgdir"
-		if (( PKGFUNC )); then
-			run_package
-		fi
-		tidy_install
-		lint_package || exit $E_PACKAGE_FAILED
-		create_package
-		create_debug_package
+		run_solo_packaging
 	else
 		run_split_packaging
 	fi