summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-01-04 14:10:37 -0800
committerJesse Keating <jkeating@redhat.com>2010-01-04 14:10:37 -0800
commit14cc21fc32e8e44d4278aaeaa5136e2b1bb66b1c (patch)
treed25c9a20011b01c0fbc590742bbce5ee6b8991a6
parente74c9cf416b50d4a1c286af187a47e3296c91308 (diff)
downloadfedora-packager-14cc21fc32e8e44d4278aaeaa5136e2b1bb66b1c.tar.gz
fedora-packager-14cc21fc32e8e44d4278aaeaa5136e2b1bb66b1c.tar.xz
fedora-packager-14cc21fc32e8e44d4278aaeaa5136e2b1bb66b1c.zip
Add a lint function.
Needs better error handling, will add a custom error class
-rw-r--r--src/fedpkg/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fedpkg/__init__.py b/src/fedpkg/__init__.py
index b84a85a..ceffbbc 100644
--- a/src/fedpkg/__init__.py
+++ b/src/fedpkg/__init__.py
@@ -178,6 +178,22 @@ class PackageModule:
return f
return None
+ def lint(self):
+ """Run rpmlint over a built srpm"""
+
+ # Make sure we have a srpm to run on
+ srpm = "%s-%s-%s.src.rpm" % (self.module, self.ver, self.rel)
+ rpm = "%s-%s-%s.%s.rpm" % (self.module, self.ver, self.rel,
+ os.uname()[4])
+ if not os.path.exists(os.path.join(self.path, srpm)) and not \
+ os.path.exists(os.path.join(self.path, rpm)):
+ return "Need to build srpm and rpm first"
+ cmd = ['rpmlint', os.path.join(self.path, srpm),
+ os.path.join(self.path, rpm)]
+ output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
+ return output[0]
+
+
def new_sources(self, files):
"""Replace source file(s) in the lookaside cache"""