[Rpm-maint] [PATCH] If no BuildRoot, then set a sane default.

Tom 'spot' Callaway tcallawa at redhat.com
Mon Feb 12 21:57:30 UTC 2007


This relatively small patch accomplishes a few things:

- If there is no BuildRoot defined (either from a master macro, or
inside a spec file), then set a sane default, derived from _tmppath,
name, version, release, and a six random characters. 
- It uses mkdtemp to create the BuildRoot. Thus, I don't think one would
need to remove the BuildRoot as part of every install (unless it is
hardcoded).
- It sets the %{buildroot} macro in addition to $RPM_BUILD_ROOT.

Sum result: Hopefully, no more arguments about which buildroot value is
"more correct", "more useful", "more accurate", "serious", "stupid".
With this patch applied, we can drop mandatory BuildRoot definitions
from all specs, and shorten the spec by a line. :)

Feedback welcomed, as long as you don't plan on insulting me. Insulting
the patch is ok.

~spot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpm-4.4.2-smartbuildroot.patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
Url : http://lists.rpm.org/pipermail/rpm-maint/attachments/20070212/8682b826/attachment-0001.bin 


More information about the Rpm-maint mailing list