Bug 755134 - mock's --no-cleanup-after doesn't stop BUILDROOT from being emptied
mock's --no-cleanup-after doesn't stop BUILDROOT from being emptied
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
16
All All
unspecified Severity low
: ---
: ---
Assigned To: Clark Williams
Fedora Extras Quality Assurance
: Improvement
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-18 19:17 EST by Philip Prindeville
Modified: 2012-08-01 22:10 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-01 22:10:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Philip Prindeville 2011-11-18 19:17:22 EST
Description of problem:

It's occasionally useful to run "mock --rebuild ..." to see what gets deposited into BUILDROOT... especially for large packages like openssl which change frequently and might modify permissions/ownerships of installed files.

In those cases, manually checking the contents of BUILDROOT with "ls" after a "mock --rebuild" would allow one to cross-check the permissions/ownership of $(INSTALL)'s in the makefiles versus the %attrib() values in the spec's %files sections.

Version-Release number of selected component (if applicable):

mock-1.1.17-1

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Clark Williams 2011-11-19 11:37:05 EST
Is this still failing?  I just tried a package build with --no-cleanup-after and the chroot buildroot still has all the contents of the package there. vb
Comment 2 Philip Prindeville 2011-11-19 16:42:09 EST
(In reply to comment #1)
> Is this still failing?  I just tried a package build with --no-cleanup-after
> and the chroot buildroot still has all the contents of the package there. vb

Which exact command did you use to build so I can reproduce it?
Comment 3 Philip Prindeville 2011-11-21 01:29:36 EST
Further clarifying, I noticed that if I ran:

% mock --update --no-cleanup-after --rebuild -r fedora-16-x86_64 clamav-0.97.3-1602.fc17.src.rpm


but I'd still need to comment out the %clean section in the RPM itself. So I guess I'm wondering how to stop rpmbuild from *both* doing the automatic clean and from running the %clean section of the .spec file.
Comment 4 Clark Williams 2011-11-21 13:20:56 EST
Ok, I did a small test rpm of hello world:

$ mock -r fedora-15-x86_64 --no-cleanup-after rpms/hello-2.6-1.el5.src.rpm 

Went over to /var/lib/mock/fedora-15-x86_64/root/builddir/build and everything seemed to be there.
Comment 5 Philip Prindeville 2011-11-21 15:22:04 EST
Ok, and I just did the same for fedora-16-x86_64:

...

Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh info
Requires(preun): /bin/sh info
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) rtld(GNU_HASH)
Processing files: hello-debuginfo-2.6-2.fc16.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/hello-2.6-2.fc16.x86_64
Wrote: /builddir/build/RPMS/hello-2.6-2.fc16.x86_64.rpm
Wrote: /builddir/build/RPMS/hello-debuginfo-2.6-2.fc16.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.sDaodk
+ umask 022
+ cd /builddir/build/BUILD
+ cd hello-2.6
+ rm -rf /builddir/build/BUILDROOT/hello-2.6-2.fc16.x86_64
+ exit 0
Child returncode was: 0
LEAVE do --> 


Is what I see in the result/build.log file, and indeed looking in BUILDROOT it's empty:

[philipp@builder hello]$ ls /var/lib/mock/fedora-16-x86_64/root/builddir/build/BUILDROOT/
[philipp@builder hello]$ 

so my suggestion is that the --no-cleanup-after should inhibit the %clean section from being run.
Comment 6 Clark Williams 2011-11-23 12:17:59 EST
(In reply to comment #5)
> 
> so my suggestion is that the --no-cleanup-after should inhibit the %clean
> section from being run.

I'm not sure of an easy way to do that using rpmbuild.
Comment 7 Philip Prindeville 2011-11-23 15:39:13 EST
Do I need to file a bug against rpmbuild and link it?
Comment 8 Clark Williams 2011-12-02 22:36:57 EST
It would be an RFE (request for enhancement). Not sure how much people want it but you can try.
Comment 9 Clark Williams 2012-08-01 22:10:49 EDT
Closing this as a mock bug.

Note You need to log in before you can comment on or make changes to this bug.