mock mock.py,1.9,1.10

Seth Vidal (skvidal) fedora-extras-commits at redhat.com
Thu Jun 16 20:07:53 UTC 2005


Author: skvidal

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

Modified Files:
	mock.py 
Log Message:

- catch srpm not found traceback
- fix fc4 config files




Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mock.py	12 Jun 2005 23:35:39 -0000	1.9
+++ mock.py	16 Jun 2005 20:07:51 -0000	1.10
@@ -631,14 +631,21 @@
     if len(args) < 1:
         error("No srpm specified - nothing to do")
         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)
+    try:
+        hdr = rpmUtils.miscutils.hdrFromPackage(ts, srpm)
+    except rpmUtils.RpmUtilsError, e:
+        error("Specified srpm %s cannot be found/opened" % srpm)
+        sys.exit(50)
+
     if hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
         error("Specified srpm isn't a srpm!  Can't go on")
         sys.exit(50)
     
+    
     # read in the config file by chroot name
     if options.chroot.endswith('.cfg'):
         cfg = '%s/%s' % (config_path, options.chroot)




More information about the fedora-extras-commits mailing list