extras-buildsys/utils/pushscript Push.py,1.44,1.45

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Tue Sep 11 00:01:50 UTC 2007


Author: mschwendt

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

Modified Files:
	Push.py 
Log Message:
* Make pushing in updates-testing mode require explicit args, e.g.

  epel-push testing/5 testing/4
  epel-push all

so specifying only the normal/stable repo numbers does not trigger
any pushes from plague-results to the testing repos. Specifying
stable dist numbers can still be used to handle external changes
to the stable repos (moved/removed packages etc.)

* No empty build reports anymore. We've had this long ago, but then
wanted to simulate the daily rawhide reports, even in case of zero pkgs.




Index: Push.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Push.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- Push.py	23 Aug 2007 12:11:17 -0000	1.44
+++ Push.py	11 Sep 2007 00:01:47 -0000	1.45
@@ -188,28 +188,31 @@
     or None."""
 
     changedrepo = None
+    srcdist = dist  # the plague-results dist number
 
-    srcdist = dist
-    distdir = '%s-%s-%s' % (cfg.distro, dist, cfg.project)
+    # When we're in updates-testing override mode, adjust the "srcdist"
+    # parameter to point to the single plague-results directory, and
+    # reject pushing to non-testing repositories.
+    if hasattr(cfg.opts,'pushtotesting') and cfg.opts.pushtotesting:
+        if dist.startswith('testing/'):
+            srcdist = dist.replace('testing/','')
+        else:  # no-op
+            return 0, changedrepo
+    
+    distdir = '%s-%s-%s' % (cfg.distro, srcdist, cfg.project)
     needsignroot = os.path.join(cfg.stagesdir, distdir)
-
-    if hasattr(cfg.opts,'pushtotesting') and cfg.opts.pushtotesting and not dist.startswith('testing/') and not dist=='development':
-        dist = 'testing/%s' % dist
-        destroot = os.path.join(cfg.treedir, dist)
-    else:
-        destroot = os.path.join(cfg.treedir, dist)
+    destroot = os.path.join(cfg.treedir, dist)
+    print '='*70
+    print 'Target repository:', destroot
+    print '='*70
     if not os.path.exists(destroot):
         os.makedirs(destroot)
-    
-    if srcdist.startswith('testing/'):
-        return 0, changedrepo
-    
     Utils.make_std_repodirs(cfg,dist,destroot)
     
     repolockname = os.path.join(needsignroot,REPO_LOCKFILE_NAME)
     repolock = LockFile(name=repolockname,blocking=True)
     try:
-        print 'Waiting for repository lock on %s:' % distdir,
+        print 'Waiting for repository lock on %s:' % needsignroot,
         sys.stdout.flush()
         repolock.lock()
         print 'OK'
@@ -334,14 +337,20 @@
         if not dist in distlist:
             continue
         brm = BuildReportManager(cfg.rundir,dist)
-    
-        body += "\nPackages built and released for %s %s: %s\n\n" % (cfg.project_hr, dist, brm.GetCount())
+        count = brm.GetCount()
+        if not count:
+            continue
+        body += "\nPackages built and released for %s %s: %s\n\n" % (cfg.project_hr, dist, count)
         body += brm.GetReport()
         body += '\n\n'
 
     for dist in cfg.alldists:  # we do this for sorting the dists
         if not dist in distlist:
             continue
+        brm = BuildReportManager(cfg.rundir,dist)
+        count = brm.GetCount()
+        if not count:
+            continue
         body += "\nChanges in %s %s: \n\n" % (cfg.project_hr, dist)
         try:
             WhatsNew.load(cfg.rundir)
@@ -349,6 +358,9 @@
         except:
             pass
 
+    if not len(body):
+        print 'Empty build report. Nothing sent.'
+        return
     body += cfg.mail_footer
     
     email.Charset.add_charset('utf-8',email.Charset.SHORTEST,None,None)
@@ -410,7 +422,6 @@
             sys.exit(errno.EINVAL)
         if d not in diststopush:
             diststopush.append(d)
-    Utils.debugprint(diststopush)
     if not len(diststopush):
         usage()
 




More information about the fedora-extras-commits mailing list