On 20/03/15 07:18, David Macek wrote:
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.
If packaging files, you could end up with two $pkgdir from the new package (one broken) and one from the old package - I do not like that inconsistency. Why would you want to keep the old package $pkgdir if you are intending to replace it? Allan