[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
Thu Mar 19 21:18:01 UTC 2015


On 19. 3. 2015 3:08, Allan McRae wrote:
> Provide a commit message explaining why this change is being made.

Currently makepkg clears the whole $pkgbasedir which is needless. Moreover, in the obscure case of multiple makepkg runs (with different $pkgname) that share a $pkgdirbase, only $pkgdir's from the last run will remain. Since I consider the contents of $pkgdir an important artifact, this commit restricts the deletion to individual $pkgdir's and defers it until each $pkgdir is actually needed.

Discussed in https://lists.archlinux.org/pipermail/pacman-dev/2015-February/019939.html

> To avoid the duplication, why not loop over pkgname here? (note pkgname
> contains only the packages being built if --pkg is used).
> 
> msg "$(gettext "Cleaning existing %s directory...")" "\$pkgdir/"
> for pkg in $pkgname; do
> ...

I've thought about it, and I like more the version that defers deleting $pkgdir's until it is really needed. Clearing all $pkgdir's at once would produce different results in case a failure occurs before all packaging function are called.

-- 
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/20150319/80a97756/attachment.p7s>


More information about the pacman-dev mailing list