[pacman-dev] [PATCH 3/3] makepkg: Empty/create only $pkgdir's relevant to current PKGBUILD (unless CLEANUP is set)

David Macek david.macek.0 at gmail.com
Tue Mar 17 17:19:30 UTC 2015


---
 scripts/makepkg.sh.in | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 6ca678e..af8a606 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2822,6 +2822,11 @@ run_split_packaging() {
 	local pkgname_backup=${pkgname[@]}
 	for pkgname in ${pkgname_backup[@]}; do
 		pkgdir="$pkgdirbase/$pkgname"
+		# clean existing pkg directory
+		if [[ -d $pkgdir ]]; then
+			msg "$(gettext "Removing existing %s directory...")" "\$pkgdir/"
+			rm -rf "$pkgdir"
+		fi
 		mkdir "$pkgdir"
 		backup_package_variables
 		run_package $pkgname
@@ -3276,6 +3281,11 @@ if (( INFAKEROOT )); then
 	chmod 755 "$pkgdirbase"
 	if (( ! SPLITPKG )); then
 		pkgdir="$pkgdirbase/$pkgname"
+		# clean existing pkg directory
+		if [[ -d $pkgdir ]]; then
+			msg "$(gettext "Removing existing %s directory...")" "\$pkgdir/"
+			rm -rf "$pkgdir"
+		fi
 		mkdir "$pkgdir"
 		if (( PKGFUNC )); then
 			run_package
@@ -3396,11 +3406,6 @@ else
 		cd_safe "$startdir"
 	fi
 
-	# clean existing pkg directory
-	if [[ -d $pkgdirbase ]]; then
-		msg "$(gettext "Removing existing %s directory...")" "\$pkgdir/"
-		rm -rf "$pkgdirbase"
-	fi
 	mkdir -p "$pkgdirbase"
 	chmod a-srwx "$pkgdirbase"
 
-- 
1.9.4.msysgit.2

-- 
David Macek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4234 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20150317/f857bf3b/attachment-0001.p7s>


More information about the pacman-dev mailing list