Description of problem: mock -r fedora-rawhide-x86_64 --rebuild SRPMS/package.src.rpm cleans all Version-Release number of selected component (if applicable): mock-1.1.21-1.fc16.noarch How reproducible: build package packageone mock -r fedora-rawhide-x84 --rebuild SRPMS/packageone.fc16.src.rpm finish ok with INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/results build package packagetwo mock -r fedora-rawhide-x84 --rebuild SRPMS/packagetwo.fc16.src.rpm results of packageone in /var/lib/mock/fedora-rawhide-x86_64/results has gone Actual results: results of packageone in /var/lib/mock/fedora-rawhide-x86_64/results has gone Expected results: keep results of previous good build. Additional info: Since results are indepent of root , I think just clean /var/lib/mock/fedora-rawhide-x86_64/root is much more productive. second, if you don't agree with it , just tell me how, I just clean root , in mock code, to apply and modify my mock builder. Thanks,
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,