[Extras-cauldron-commits] r52 - trunk/buildme/tools

ed_ at garage.maemo.org ed_ at garage.maemo.org
Thu May 22 00:06:54 EEST 2008


Author: ed_
Date: 2008-05-22 00:06:54 +0300 (Thu, 22 May 2008)
New Revision: 52

Modified:
   trunk/buildme/tools/buildme
Log:
flush ml_handler to avoid 2 messages in one email; fixed: check for split results when splitting dsc name

Modified: trunk/buildme/tools/buildme
===================================================================
--- trunk/buildme/tools/buildme	2008-05-19 20:18:19 UTC (rev 51)
+++ trunk/buildme/tools/buildme	2008-05-21 21:06:54 UTC (rev 52)
@@ -142,7 +142,12 @@
             else:
                 build_status = "OK"
 
-        package, version = os.path.splitext(os.path.basename(env.params['fname']))[0].split('_')
+        splitted = os.path.splitext(os.path.basename(env.params['fname']))[0].split('_')
+        if len(splitted) == 2:
+            package, version = splitted
+        else:
+            package = splitted[0]
+            version = ""
 
         return env.params['conf'].get(env.params['product'], 'subject_template', False,
                         {'package' : package, 'version' : version, 'build_status' : build_status})
@@ -223,8 +228,9 @@
         env.params['fnames'] = fnames
 
     # create handler for mailing list notifications
+    env.params['ml_handler'] = None
     if conf.has_option(product, 'mail_list'):
-        create_ml_handler(logger, conf.get(product, 'mail_list'),
+        env.params['ml_handler'] = create_ml_handler(logger, conf.get(product, 'mail_list'),
                                   conf.get(product, 'builder_email'), Subject(env))
 
     # get destination names from config
@@ -283,6 +289,10 @@
     upload_timeout = int(conf.get(product, 'upload_timeout'))
     builder_email = conf.get(product, 'builder_email')
 
+    # flush ml_handler to send messages about previous fname
+    if env.params['ml_handler']:
+        env.params['ml_handler'].flush()
+
     uploader = pwd.getpwuid(os.stat(fname).st_uid).pw_name
     info = "Processing package %s. Uploader: %s, builder: %s" % \
             (os.path.splitext(os.path.basename(fname))[0].replace('_', ' '), uploader, destination.user)



More information about the Extras-cauldron-commits mailing list