On May 23, 2007, at 6:26 PM, Tim Mooney wrote:
In regard to: Re: %clean in rpm-4.4.7+, Jeff Johnson said (at 5:47pm on May...:On May 23, 2007, at 4:30 PM, Tim Mooney wrote:In regard to: Re: %clean in rpm-4.4.7+, Jeff Johnson said (at 12:56pm on...:On May 23, 2007, at 12:51 PM, Tomasz Koczko wrote:rpm-4.4.7 and later has refactored BuildRoot: and %clean out of spec files.On Mon, 21 May 2007, Tim Mooney wrote:All-With rpm 4.4.7 and later, rpm ignores the %clean in the spec file and instead uses a set of macros to handle post-build cleanup of the build system. This was discussed on the rpm devel list and is documented inthe CHANGES, and the new functionality has been working fine.What I'm after is configuring my personal/system build default so that- the BuildRoot is NOT removed after a successful rpmbuild- the Build subdirectory (%_topdir/BUILD/foo-1.0) IS removed aftera successful rpmbuild, but left on an unsuccessful build.In 4.4.2 this is performed by "rpmbuild --clean <spec>". If it still true in > 4.4.2 I dont see any reasons for changes.Unfortunately there's no fix for legacy spec files except to parse and ignore the contents. Yet.Understood. I was just under the mistaken impression that %__spec_clean_body is what replaced %clean, so I thought I could control the replacement for %clean via that macro. It's not, and I can't.It was *supposed* to be what replaced %clean, but you identified a bug. Not gotten to repairing yet.I think the change is as simple as this. It breaks compatibility with rpm 4.4.7 - 4.4.9, but I would vote that that's OK.
People are just starting to realize that BuildRoot: and %clean are being ignored. Compatibility be damned, I want simpler KISS. Looks exactly perfect. Thanks for the patch. 73 de Jeff
Index: parseBuildInstallClean.c =================================================================== RCS file: /cvs/devel/rpm/build/parseBuildInstallClean.c,v retrieving revision 2.18.6.4 diff -u -r2.18.6.4 parseBuildInstallClean.c --- parseBuildInstallClean.c 21 Mar 2007 13:10:15 -0000 2.18.6.4 +++ parseBuildInstallClean.c 23 May 2007 22:25:53 -0000 @@ -42,12 +42,12 @@ /* Make sure the buildroot is removed where needed. */ if (parsePart == PART_INSTALL) {- const char * s = rpmExpand("%{?__spec_clean_body}%{!? __spec_clean_body:%{?buildroot:rm -rf '%{buildroot}'\n}}\n", NULL); + const char * s = rpmExpand("%{?buildroot:rm -rf '% {buildroot}'\n}", NULL);if (s && *s) appendStringBuf(*sbp, s); s = _free(s); } else if (parsePart == PART_CLEAN) {- const char * s = rpmExpand("%{?buildroot:rm -rf '% {buildroot}'\n}", NULL); + const char * s = rpmExpand("%{?__spec_clean_body}%{!? __spec_clean_body:%{?buildroot:rm -rf '%{buildroot}'\n}}\n", NULL);if (s && *s) appendStringBuf(*sbp, s); s = _free(s); Tim --Tim Mooney mooney dogbert cc ndsu NoDak eduInformation 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 redhat com https://www.redhat.com/mailman/listinfo/rpm-list