aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 18:17:05 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 18:17:05 +0200
commit512584f8b2cdedb5076e3981cd4cbd7248594beb (patch)
tree2ad5badcf9ab168a18a8f6e86b808aa1f1aad809
parent681e44a9c70a3fe704d81bc33c563243c9c8ad63 (diff)
downloadmgarepo-512584f8b2cdedb5076e3981cd4cbd7248594beb.tar
mgarepo-512584f8b2cdedb5076e3981cd4cbd7248594beb.tar.gz
mgarepo-512584f8b2cdedb5076e3981cd4cbd7248594beb.tar.bz2
mgarepo-512584f8b2cdedb5076e3981cd4cbd7248594beb.tar.xz
mgarepo-512584f8b2cdedb5076e3981cd4cbd7248594beb.zip
add --short-circuit support with buildrpm -s
-rw-r--r--MgaRepo/commands/buildrpm.py6
-rw-r--r--MgaRepo/rpmutil.py3
2 files changed, 7 insertions, 2 deletions
diff --git a/MgaRepo/commands/buildrpm.py b/MgaRepo/commands/buildrpm.py
index fe4adc9..76fa41e 100644
--- a/MgaRepo/commands/buildrpm.py
+++ b/MgaRepo/commands/buildrpm.py
@@ -13,16 +13,18 @@ Options:
-bX Build stage option, where X is stage, default is -bb
-l Disable rpmlint check of packages built
-P USER Define the RPM packager information to USER
- -q Silent build output
+ -q Quiet build output
+ -s Jump to specific build stage (--short-circuit)
"""
def parse_options():
parser = OptionParser(HELP)
parser.add_option("-b", dest="build_cmd", default="a")
+ parser.add_option("-l", dest="rpmlint", action="store_false", default=True)
parser.add_option("-P", dest="packager", default="")
parser.add_option("-q", "--quiet", dest="verbose", action="store_false", default=True)
- parser.add_option("-l", dest="rpmlint", action="store_false", default=True)
+ parser.add_option("-s", "--short-circuit", dest="short_circuit", action="store_true", default=False)
opts, args = parser.parse_args()
return opts
diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py
index 550e2aa..3220cf0 100644
--- a/MgaRepo/rpmutil.py
+++ b/MgaRepo/rpmutil.py
@@ -377,6 +377,7 @@ def put_srpm(srpmfile, markrelease=False, striplog=True, branch=None,
def build_rpm(build_cmd="b",
verbose=False,
rpmlint=True,
+ short_circuit=False,
packager = "",
macros = []):
top = os.getcwd()
@@ -408,6 +409,8 @@ def build_rpm(build_cmd="b",
rpmbuild = config.get("helper", "rpmbuild", "rpmbuild")
args = [rpmbuild, "-b"+build_cmd, spec]
+ if short_circuit:
+ args.append("--short-circuit")
for pair in rpmdefs:
args.extend(pair)
for pair in macros: