| Summary: | RFE: mock should backup result directory when clean | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Sergio Basto <sergio> | ||||||||
| Component: | mock | Assignee: | Clark Williams <williams> | ||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
| Severity: | unspecified | Docs Contact: | |||||||||
| Priority: | unspecified | ||||||||||
| Version: | rawhide | CC: | devurandom, mebrown, msuchy, sergio, williams | ||||||||
| Target Milestone: | --- | Keywords: | Reopened | ||||||||
| Target Release: | --- | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2015-07-02 21:01:03 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Attachments: |
|
||||||||||
|
Description
Sergio Basto
2012-03-03 18:29:23 UTC
I mean not clean /var/lib/mock/fedora-rawhide-x86_64/result/*rpm , but truncate logs if it possible . hi, and when we use mock --no-clean , *log should be clean before starting building ... please . a better idea , was backup result dir with logs and rpm before clean it. I have the same issue on SL 6.2 using mock-1.1.21-1.el6. the default action of mock is to clean both the chroot and the result directory so that you will have just the results of the last build in the results directory. If you add the --no-clean option it will not clean out the results directory. If you don't want to use the --no-clean directory then you need to copy out the rpms from the results directory before invoking mock again. (In reply to comment #5) > the default action of mock is to clean both the chroot and the result directory OK , I changed to an RFE (request for enhancements), I think the better solution is backup results when is perform an clean. BTW, please tell me where is the code of clean root , in mock code, to patch my mock builder. Thanks, You probably want to look at either clean() or _unlock_and_rm_chroot(), which are both methods of the Root object in the file py/mockbuild/backend.py. The clean() method is the entry point to the clean logic and _unlock_and_rm_chroot() where the actual chroot dir (both result and root) get removed. another way to fix this , is inspired on fedpkg mockbuild mock -r fedora-17-x86_64 --resultdir /home/sergio/fedora-scm/libkdcraw/results_libkdcraw/4.9.50/2.fc17 --rebuild /home/sergio/fedora-scm/libkdcraw/libkdcraw-4.9.50-2.fc17.src.rpm Which is write mock results in other directory not under /var/lib/mock/fedora-17-x86_64 ... for example : /home/sergio/mock_results/$pkg$datime . Any way to do this in mock.cfg ? Thanks, hmmm, that might work. We'll need to add something in the .cfg file to indicate where results should be written. Maybe even tar everything up, compress it and write it to the specified result dir. I'm on the road right now but will be back monday so if I can dig out from under the email, I'll try and get something going next week. ping Hi, the mock --clean shouldn't clean built packages, this is important , the exercise to build a 2nd package that depends on a build of first, is insane , because mock clean all or don't clean nothing . Ah sorry, got pulled off to work on other stuff. I'm back on this now. Hi , I need a way to backup results dir automatically with mock , I can do a cp /var/lib/mock/fedora-18-x86_64/result/*rpm ~/rpmbuild/results/ after every sucefully build, but sometimes I forgot .... also have logs of failure builds could help out sometimes . Thanks, Created attachment 710780 [details]
prototype for adding a backup mechanism
Try this and see if it does what you want. Turn it on in a config file with:
config_opts['backup_on_clean'] = True
The backup directory will be /var/lib/mock/backup/<config>
Created attachment 712138 [details]
Updated prototype for result backup code
Missed a commit when generating the previous patch
(In reply to comment #16) > Created attachment 712138 [details] > Updated prototype for result backup code > > Missed a commit when generating the previous patch Hi, looks good, simple and safe, many thanks to work on this . I build my self mock-1.1.29-2 with this patch , but haven't test it effectively Thanks, mock-1.1.41 (which should contain this fix) is in stable Created attachment 1038453 [details]
backup_dstdir_use_root_name_instead_config_name.patch
Hi,
It is just an minor improve .
I had always use:
config_opts['backup_on_clean'] = True
and i was very useful thanks,
I use mock -r fedora-21-x86_64 , mock -r fedora-21-x86_64-rpmfusion_free or even default (just mock), when mock make the cleanup, backup dir name use config name i.e. fedora-21-x86_64-rpmfusion_free or fedora-21-x86_64 when root is the same (fedora-21-x86_64). So I prefer the backup directory have root name instead config named.
It is a very simple patch .
One motivation was fedora-review which backup things on default and, for me, is more logic that backup things in fedora-rawhide-x86_64
see my backup dir, which is not the best optimization :
ls /var/lib/mock/backup/ -1
default
fedora-20-i386
fedora-20-x86_64
fedora-21-x86_64
fedora-21-x86_64-rpmfusion_free
fedora-21-x86_64-rpmfusion_nonfree
fedora-22-x86_64
fedora-22-x86_64-rpmfusion_free
fedora-rawhide-x86_64
Errata : and it was very useful thanks, |