Make --cleanbuild remove all "work" files

Review Request #127192 - Created Feb. 26, 2016 and updated

Information
Thomas Friedrichsmeier
craft
Reviewers
kdewin

Not sure, whether this is actually intended (strictly speaking, it does match the terminology used in emerge), but it did come as a (negative) surprise to me:
emerge --cleanbuild XY
does not clean everything in build\category\XY\work, but only the "real" build directory (with the compiler / release type specification) in there. This is ok for most (not all) source packages, but for other packages it means leaving a lot of cruft.

If this is actually the intended behavior, I'd want a --cleanwork action, in addition to this. Assuming the intended behavior is to clean everything in build\category\XY\work, this patch will do that.

Patch also makes failed removals non-fatal, in case there are write-protected files, or some-such.

Tested locally, and cleans the "work" directories for packages such as mysql-pkg, aspell, 7zip, etc., that were not cleaned, before.

Loading...