From c1509ee9b406223f3fd0353867e24e4b5860d0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Sun, 24 Mar 2024 12:27:41 +0200 Subject: Pass --noclean by default to rpmbuild Replace --noclean cmd line option with --clean for changing the new default --- BuildManager/build.py | 7 +++++-- bash-completion/bm | 2 +- bm | 2 +- man/bm.8 | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/BuildManager/build.py b/BuildManager/build.py index 5b7e7a5..8bc5791 100644 --- a/BuildManager/build.py +++ b/BuildManager/build.py @@ -201,13 +201,16 @@ def buildpkg(pkg, stage, unpack_dir, passtrough="", show_log=0, dryrun=0): stagechar = ["p","r","c","i","s","b","a"][stage-1] tmppath = "" nodeps = "" + noclean = "--noclean" topdir = "--define '_topdir %s'" % pkg.builddir if not dryrun and os.path.isdir(pkg.builddir+"/BUILDROOT"): tmppath = "--define '_tmppath %s/BUILDROOT'" % pkg.builddir if stage == STAGE_PREP: nodeps = "--nodeps" - cmd = "rpmbuild -b%s %s %s %s %s %s 2>&1" % \ - (stagechar, nodeps, topdir, tmppath, passtrough, pkg.spec) + if '--clean' in passtrough.split(): + noclean = "" + cmd = "rpmbuild -b%s %s %s %s %s %s %s 2>&1" % \ + (stagechar, nodeps, noclean, topdir, tmppath, passtrough, pkg.spec) logger.debug("rpmbuild command: "+cmd) if not dryrun: log = codecs.open(pkg.log, "w", 'utf-8', errors = "replace") diff --git a/bash-completion/bm b/bash-completion/bm index 047a8fd..67df8ae 100644 --- a/bash-completion/bm +++ b/bash-completion/bm @@ -34,7 +34,7 @@ _bm() --copy-succeeded-srpm= --remove-succeeded-srpm \ --move-log= --move-failed-log= --filter-renew= \ --filter-refresh= --clean-topdir --clean-on-success --ignore= \ - --sign --nodeps --noclean --debug --short-circuit --with \ + --sign --nodeps --clean --debug --short-circuit --with \ --without --define --target --dryrun --log=' -- $cur ) ) else _filedir '@(spec|src.rpm)' diff --git a/bm b/bm index bf15eb9..e0c8d86 100644 --- a/bm +++ b/bm @@ -92,7 +92,7 @@ def parse_options(): help="pass this option to rpm") parser.add_option("--nodeps", action="callback", nargs=0, callback=passtrough, help="pass this option to rpm") - parser.add_option("--noclean", action="callback", nargs=0, callback=passtrough, + parser.add_option("--clean", action="callback", nargs=0, callback=passtrough, help="pass this option to rpm") parser.add_option("--debug", action="callback", nargs=0, callback=passtrough, help="pass this option to rpm") diff --git a/man/bm.8 b/man/bm.8 index ab17fc8..cd6895c 100644 --- a/man/bm.8 +++ b/man/bm.8 @@ -133,7 +133,7 @@ sign packages using GPG pass this option to rpm .TP .B -\fB--noclean\fP +\fB--clean\fP pass this option to rpm .TP .B -- cgit v1.2.1