shutils/pkgtarget: speed up build dir cleanup.
We need `chmod -R` to be able to cleanup after Go packages, but it's unnecessary in most other cases. By only running it when the first `rm -rf` fails, we optimize for the most common case and get a tiny speedup for this build step.
This commit is contained in:
parent
bd4fb68ea5
commit
d7bf8e06a0
@ -79,7 +79,7 @@ remove_pkg_autodeps() {
|
|||||||
remove_pkg_wrksrc() {
|
remove_pkg_wrksrc() {
|
||||||
if [ -d "$wrksrc" ]; then
|
if [ -d "$wrksrc" ]; then
|
||||||
msg_normal "$pkgver: cleaning build directory...\n"
|
msg_normal "$pkgver: cleaning build directory...\n"
|
||||||
chmod -R +wX "$wrksrc" # Needed to delete Go Modules
|
rm -rf "$wrksrc" || chmod -R +wX "$wrksrc" # Needed to delete Go Modules
|
||||||
rm -rf "$wrksrc"
|
rm -rf "$wrksrc"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user