On Wednesday 14 February 2007, Rex Dieter wrote:
Ville Skyttä wrote:
> Using mktemp -d in specfiles' BuildRoot means that quite a few stray temp
> dirs will start to appear in %{_tmppath}. For example "rpm -q --specfile
> foo.spec" and "rpmbuild -bs foo.spec" create them, and nothing
cleans
> them up (no, tmpwatch doesn't count) - we probably don't want that.
Isn't that what %clean is for?
%clean is not run with eg. "rpm -q --specfile" nor "rpm -bs". And
it's not
even possible to pass --clean to the former, and passing it to the latter
does not clean up the created temp dir either - it doesn't run the
actual %clean scriptlet from the specfile.
> One way to avoid it is mktemp -ud, but it's more racy than
plain -d.
I doubt this would work.
Why not? Seems to work fine here in the few tests I've done.