Le samedi 09 juin 2007, Michael Jennings a écrit :
> On Saturday, 09 June 2007, at 12:36:58 (+0200),
>
> Olivier Thauvin wrote:
> > According comment and code in build/parseBuildInstallClean.c the
> > %clean section is no longer use and replace by a direct "rm -fr
> > %buildroot".
>
> To be accurate, it's actually:
> %{?__spec_clean_body}%{!?__spec_clean_body:%{?buildroot:rm -rf
> '%{buildroot}'\n}}
hum, code has since rpm 4.4.8 so.
>
> > To avoid this issue, I'd rather suggest to perform "rm -fr %buildroot"
> > only if %clean section is missing, or adding the rm after %clean, in my
> > case %clean is:
> >
> > %clean
> > chmod u+rX -R $RPM_BUILD_ROOT
> > rm -rf $RPM_BUILD_ROOT
>
> My instinct is to say that if you don't have read and execute
> permissions to $RPM_BUILD_ROOT, you have other issues that need
> addressing. But maybe I'm missing something. :)
I know what is the problem, I added the chown myself.
But in the case this line is not run, the rm will miserably failed.
(yes install removing read perm for the user sucks, but that's the life).
>
> > Also, instead performing this rm during %install, why not simply run
> > %clean instead before when at %install step (aka %install call
> > %clean).
>
> No, definitely not the right thing to do. It is good and wise that
> pre-%install cleaning and post-%install cleaning are not hard-wired to
> be identical. (Re-)Define %__spec_install_pre and/or
> %__spec_clean_body to override either one individually or both
> simultaneously. You can even do this in your (vendor?) macros file
> for more universally-useful tweaks.
I'll check in cvs code, but it will failed in the case I am talking about w/o
proper chown.
This software is munin, and there are other application doing that.
Received on Sat Jun 9 20:58:56 2007