Add option to save all artefacts to rpmbuild command

This commit is contained in:
Denis Silakov 2016-12-16 01:02:51 +03:00
parent c0bd31231f
commit 84aef65ffd

4
abf.py
View file

@ -306,6 +306,7 @@ def parse_command_line():
subparser = subparsers.add_parser('rpmbuild', help=_('Build a project locally using rpmbuild.'), epilog=_('No checkouts will be made,'
'the current git repository state will be used'))
subparser.add_argument('-b', '--build', action='store', choices=['b', 's', 'a'], default='a', help=_('Build src.rpm (s), rpm (b) or both (a)'))
subparser.add_argument('-s', '--save-rpmbuild-folder', action='store_true', help=_('Copy the whole rpmbuild folder into the current folder after the build'))
subparser.set_defaults(func=localbuild_rpmbuild)
# publish
@ -634,6 +635,9 @@ def localbuild_rpmbuild():
log.error(_("Can not execute rpmbuild (%s). Maybe it is not installed?") % str(ex))
exit(1)
log.info(_('Moving files to current directory...'))
if command_line.save_rpmbuild_folder:
shutil.copytree(src_dir, src + "/rpmbuild", symlinks=True)
else:
items = [x for x in os.walk(src_dir+'/SRPMS')] + [x for x in os.walk(src_dir+'/RPMS')]
for item in items:
path, dirs, files = item