Re: %clean in rpm-4.4.7+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In regard to: Re: %clean in rpm-4.4.7+, Tim Mooney said (at 5:53pm on May...:

In regard to: Re: %clean in rpm-4.4.7+, Jeff Johnson said (at 6:14pm on May...:

%__spec_clean_body test -d '%{buildsubdir}' && %{__rm} -rf '%{buildsubdir}'\
%{nil}

accomplish all of what I'm after?  Is it "safe" to use %{buildsubdir}
in %__spec_clean_body -- will it be filled in?  Also, are these macros
only executed on a successful rpmbuild?


Should, but untested.

Note that %buildsubdir is not known until %setup executes (not parsed)
that's the flaw in buildsubdir, undefined for most of a spec file parse.

AFAIK, %buildsubdir is well defined, but possibly
with odd default value if no, or multiple, %setup was present.

Good point, didn't think of that.

I could just try it, but the possibility for havok after an errant rm -rf
has me hesitating.


So add an echo and look a bit.

:-)  I was looking for an ironclad guarantee!

I'll do some minimal testing and report back if I encounter any gotchas.

I just discovered that %__spec_clean_body doesn't do what I want.  It's
only rpmExpand'ed when

	parsePart == PART_INSTALL

Not when

	(parsePart == PART_CLEAN)

That code always expands this:

	%{?buildroot:rm -rf '%{buildroot}'\n}

This is in build/parseBuildInstallClean.c

Tim
--
Tim Mooney                              mooney@xxxxxxxxxxxxxxxxxxxxxxxxx
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux