Red Hat Bugzilla – Bug 755134
mock's --no-cleanup-after doesn't stop BUILDROOT from being emptied
Last modified: 2012-08-01 22:10:49 EDT
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):
Steps to Reproduce:
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
(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?
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.
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.
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
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/
so my suggestion is that the --no-cleanup-after should inhibit the %clean section from being run.
(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.
Do I need to file a bug against rpmbuild and link it?
It would be an RFE (request for enhancement). Not sure how much people want it but you can try.
Closing this as a mock bug.