[pacman-dev] [PATCH] Create split package dirs first

Emil Renner Berthing pacman at esmil.dk
Wed Jun 20 08:07:17 EDT 2012


Hi,

When creating split packages I always wished one could just do make
install in one of the package functions and then directly move the
files belonging to other packages off to their respective pkgdirs.
If you look at the PKGBUILD for systemd this is basically what it's
doing except for one thing: the pkgdirs aren't created before calling
the package functions. To work around this it creates it's own
temporary _$pkgdir directories, moves the files to there and then from
there to their proper destination in the later package functions.

The following small patch fixes this.

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 718b4e9..2a2901c 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1924,9 +1924,11 @@ restore_package_variables() {
 run_split_packaging() {
 	local pkgname_backup=${pkgname[@]}
 	for pkgname in ${pkgname_backup[@]}; do
+		mkdir -p "$pkgdir/$pkgname"
+		chmod a-s "$pkgdir/$pkgname"
+	done
+	for pkgname in ${pkgname_backup[@]}; do
 		pkgdir="$pkgdir/$pkgname"
-		mkdir -p "$pkgdir"
-		chmod a-s "$pkgdir"
 		backup_package_variables
 		run_package $pkgname
 		tidy_install


More information about the pacman-dev mailing list