mock mock.py,1.7,1.8

Jeremy Katz (katzj) fedora-extras-commits at redhat.com
Sun Jun 12 23:33:32 UTC 2005


Author: katzj

Update of /cvs/fedora/mock
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16286

Modified Files:
	mock.py 
Log Message:
error out if the user didn't pass a real srpm (#159987)



Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mock.py	12 Jun 2005 03:56:22 -0000	1.7
+++ mock.py	12 Jun 2005 23:33:30 -0000	1.8
@@ -628,6 +628,10 @@
         sys.exit(50)
     
     srpm = args[0] # we only take one and I don't care. :)
+    ts = rpmUtils.transaction.initReadOnlyTransaction()
+    hdr = rpmUtils.miscutils.hdrFromPackage(ts, srpm)
+    if hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
+        error("Specified srpm isn't a srpm!  Can't go on")
     
     # read in the config file by chroot name
     if options.chroot.endswith('.cfg'):




More information about the fedora-extras-commits mailing list