extras-buildsys/utils/pushscript Push.py,1.25,1.26

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Thu Dec 21 23:46:06 UTC 2006


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3615

Modified Files:
	Push.py 
Log Message:
- enter a loop of retries when signing has failed, and
  make it possible to break out of from it
- protect srpm array access



Index: Push.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Push.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- Push.py	11 Dec 2006 15:24:53 -0000	1.25
+++ Push.py	21 Dec 2006 23:46:06 -0000	1.26
@@ -348,13 +348,13 @@
     # if it is a noarch package, copy2 it to all arch locations
     # if it is a debuginfo package, move it into the 'debug' dir for that arch
 
-    if len(filedict['srpm']) > 1:
+    if len(filedict['srpm']) != 1:
         mark_pkg_pushed( os.path.join(needsignroot,name,os.path.basename(pkgrelroot)) )
         buildreportinfo = '%s-%s : INVALID build results, not published! INV\n' % (name,os.path.basename(pkgrelroot))
         if buildreport:
             rundirfile.write(buildreportinfo)
         rundirfile.close()
-        raise PushWarning, 'WARNING: Multiple source rpms in %s' % pkgrelroot
+        raise PushWarning, 'WARNING: %d source rpms in %s' % (len(filedict['srpm']),pkgrelroot)
     
     package = filedict['srpm'][0]
     (n,a,e,v,r) = naevr(package)
@@ -493,10 +493,18 @@
         WhatsNew.load(cfg.rundir)
         
         print "Signing Packages:"
-        rv = sign_pkgs( find_files(signtmpdir,'*.rpm') )
-        if rv:
-            print "Error signing packages! Please be patient - cleaning up."
-            raise Exception
+        while (True):
+            rv = sign_pkgs( find_files(signtmpdir,'*.rpm') )
+            if not rv:
+                break
+            while (True):
+                print 'Retry? (y/n)',
+                a = raw_input().lower()
+                if a=='n':
+                    raise Exception
+                if a=='y':
+                    break
+
 
         print "Copying packages into repositories:"
         global srpmlocdict
@@ -523,6 +531,9 @@
             WhatsNew.set(dist,name)
         
         WhatsNew.save(cfg.rundir)
+    except Exception:
+        shutil.rmtree(signtmpdir)
+        sys.exit(1)
     except:
         shutil.rmtree(signtmpdir)
         raise




More information about the fedora-extras-commits mailing list