extras-buildsys/utils extras-push-new,1.14,1.15

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Tue May 23 17:00:12 UTC 2006


Author: mschwendt

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

Modified Files:
	extras-push-new 
Log Message:
combine build reports into a single mail


Index: extras-push-new
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/extras-push-new,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- extras-push-new	20 May 2006 14:34:28 -0000	1.14
+++ extras-push-new	23 May 2006 17:00:09 -0000	1.15
@@ -58,7 +58,7 @@
     doublesync = False
     force = False
 
-alldists = [ 'development', '5', '4', '3' ]
+alldists = [ '5', '4', '3', 'development' ] # also the order in build reports
 
 archdict = { '3' : ['x86_64', 'i386'], 
              '4' : ['ppc','x86_64', 'i386'],
@@ -450,34 +450,40 @@
 import smtplib
 from email.MIMEText import MIMEText
 
-def email_list(pkglist, dist):
+def email_list(distlist):
     """email mailing list with the new package listing"""
 
-    uniqued = rpmUtils.miscutils.unique(pkglist)
-    uniqued.sort()
+    body = ''
+    for dist in alldists:  # we do this for sorting the dists
+        if not dist in distlist:
+            continue
+        uniqued = rpmUtils.miscutils.unique( getlinesfromrunfile(dist) )
+        uniqued.sort()
     
-    output = "\nPackages built and released for %s %s: %s \n\n" % (project_hr, dist, len(uniqued))
-    for pkg in uniqued:
-        add = '%s\n' % (pkg)
-        output = output + add
+        body += "\nPackages built and released for %s %s: %s \n\n" % (project_hr, dist, len(uniqued))
+        for pkg in uniqued:
+            add = '    %s\n' % (pkg)
+            body += add
+        body += '\n'
+    body += mail_footer
     
-    output = output + mail_footer
-    msg = MIMEText(output)
+    msg = MIMEText(body)
     subject = '%s %s Package Build Report' % (project_hr, dist)
     msg['Subject'] = subject
     msg['From'] = mail_from
     msg['To'] = mail_to
     debugprint( msg.as_string() )
-    if DEBUG:
-        return
-    s = smtplib.SMTP()
-    if smtp_server:
-        s.connect(smtp_server)
-    else:
-        s.connect()
-    s.sendmail(mail_from, [mail_to], msg.as_string())
-    s.close()
-        
+    if not DEBUG:
+        s = smtplib.SMTP()
+        if smtp_server:
+            s.connect(smtp_server)
+        else:
+            s.connect()
+        s.sendmail(mail_from, [mail_to], msg.as_string())
+        s.close()
+    
+    for dist in distlist:
+        emptyrunfile(dist)
 
 # ====================================================================
 
@@ -551,9 +557,7 @@
     run_and_check('extras-sync')
 
     if opts.mail:
-        for dist in diststopush:
-            email_list( getlinesfromrunfile(dist), dist )
-            emptyrunfile(dist)
+        email_list( diststopush )
 
     lock.unlock()
     sys.exit(0)




More information about the fedora-extras-commits mailing list