Another case where we'll run into this is if/when we add support for vpath
builds in read-only tree (#2985).
The default `%clean` is a macro now, making this kind of thing easy.
--
Reply to this email directly or view it on GitHub:
FTR, CMake does something similar on `make clean` as I discovered the other
day. As for the test-suite artifacts, we already do exactly
[that](https://github.com/rpm-software-management/rpm/blob/ea19571b86ff1f828efc264744715b69e30d6832/tests/mktree.fedora#L82).
It just seems natural to have
Yeah, rpm itself suffers from this too. Both from the POV that rpmbuild may
leave cruft behind (which does look like a bug when you look at it that way),
but also when building rpm itself the test-suite can be non-removable
afterwards.
--
Reply to this email directly or view it on GitHub:
Could the default %clean script automatically change the mode of directories
before doing `rm -rf`? To avoid build failures caused by unsuccessful `rm`
calls:
```
$ mkdir nonremovable
$ touch nonremovable/protect-parent
$ chmod a-r nonremovable
$ rm -rf nonremovable/
rm: cannot remove