aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 17:50:42 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-30 17:50:42 +0200
commitdc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2 (patch)
treecc96b4873a5bcbd6c736ebc926809c89120f39c5
parent607d2b6f22951380f4c718de8cf4c3044fbc378f (diff)
downloadmgarepo-dc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2.tar
mgarepo-dc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2.tar.gz
mgarepo-dc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2.tar.bz2
mgarepo-dc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2.tar.xz
mgarepo-dc52b25eb7e98e61d2e7c202a431ec72dc7fa1d2.zip
add optional automatic use of rpmlint by default
-rw-r--r--MgaRepo/commands/buildrpm.py4
-rw-r--r--MgaRepo/rpmutil.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/MgaRepo/commands/buildrpm.py b/MgaRepo/commands/buildrpm.py
index 3f9c9bb..b58ac65 100644
--- a/MgaRepo/commands/buildrpm.py
+++ b/MgaRepo/commands/buildrpm.py
@@ -8,6 +8,9 @@ HELP = """\
Usage: mgarepo buildrpm [OPTIONS]
Builds the binary RPM(s) (.rpm) file(s) of a given package.
+
+Options:
+ -l Disable rpmlint check of packages built
"""
def parse_options():
@@ -15,6 +18,7 @@ def parse_options():
parser.add_option("-b", dest="build_cmd", default="a")
parser.add_option("-P", dest="packager", default="")
parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False)
+ parser.add_option("-l", dest="rpmlint", action="store_false", default=True)
opts, args = parser.parse_args()
return opts
diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py
index 201ba0b..a4f66f4 100644
--- a/MgaRepo/rpmutil.py
+++ b/MgaRepo/rpmutil.py
@@ -14,7 +14,6 @@ import string
import glob
import sys
import os
-from time import sleep
def detectVCS(url):
if ':' in url:
@@ -377,6 +376,7 @@ def put_srpm(srpmfile, markrelease=False, striplog=True, branch=None,
def build_rpm(build_cmd="a",
verbose=False,
+ rpmlint=True,
packager = "",
macros = []):
top = os.getcwd()
@@ -403,6 +403,9 @@ def build_rpm(build_cmd="a",
if packager:
rpmdefs.append(("--define", "packager %s" % packager))
+ if rpmlint:
+ rpmdefs.append(("--define", "_build_pkgcheck_set %{_bindir}/rpmlint"))
+
rpmbuild = config.get("helper", "rpmbuild", "rpmbuild")
args = [rpmbuild, "-bb", spec]
for pair in rpmdefs: