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

ed_ at garage.maemo.org ed_ at garage.maemo.org
Sun Sep 6 13:27:51 EEST 2009


Author: ed_
Date: 2009-09-06 13:27:50 +0300 (Sun, 06 Sep 2009)
New Revision: 144

Modified:
   trunk/buildme/tools/buildme
   trunk/buildme/tools/buildme.conf
   trunk/buildme/tools/buildme.conf.debug
Log:
use .changes files instead of .dsc to trigger the build

Modified: trunk/buildme/tools/buildme
===================================================================
--- trunk/buildme/tools/buildme	2009-09-06 10:26:29 UTC (rev 143)
+++ trunk/buildme/tools/buildme	2009-09-06 10:27:50 UTC (rev 144)
@@ -49,7 +49,7 @@
 from buildlib.sbdarch import SbdArch
 from buildlib.lock import Lockf
 from buildlib.dest import destfactory
-from buildlib.dsc import Dsc, DscException, LockException
+from buildlib.changes import Changes, ChangesException, LockException
 from buildlib.app import App
 from buildlib.logger import CustomLogger, create_uploader_handler, create_ml_handler, create_summary_handler
 
@@ -174,11 +174,11 @@
         except (OSError, IOError), exobj:
             raise Error("Can't create 'rejected' directory: %s" % exobj) 
 
-    # Collect files mentioned in .dsc 
+    # Collect files mentioned in .changes 
     fnames = [fname]
     try:
-        dsc = Dsc(fname, mustbesigned=False)
-        fnames += [os.path.join(incoming, info[-1]) for info in dsc.getFiles()]
+        changes = Changes(fname, mustbesigned=False)
+        fnames += [os.path.join(incoming, info[-1]) for info in changes.getFiles()]
     except:
         pass
 
@@ -197,7 +197,7 @@
 # FSM handlers
 
 def init(env):
-    """ Check if there is anything to process. Lock .dsc if found  """
+    """ Check if there is anything to process. Lock .changes if found  """
 
     product = env.params['options'].product
 
@@ -229,11 +229,11 @@
     incoming = conf.get(product, 'incoming_dir')
 
     fnames = [fname for (_, fname) in sorted([(os.stat(fname).st_mtime, fname) for fname in \
-                                               glob(os.path.join(incoming, '*.dsc'))])]
+                                               glob(os.path.join(incoming, '*.changes'))])]
     if not fnames:
         return FSM.NEXT
     else:
-        logger.debug("Found dsc files: %s" % fnames)
+        logger.debug("Found .changes files: %s" % fnames)
         env.params['fnames'] = fnames
 
     # flush ml_handler to send previous messages if any
@@ -292,7 +292,7 @@
 @runscriptafter()
 def setup_build(env):
     """ Setup build environment.
-        Verify .dsc file. Setup logging 
+        Verify .changes file. Setup logging 
     """
 
     conf = env.params['conf']
@@ -301,7 +301,6 @@
     fname = env.params['fname']
     destination = env.params['destination']
     result_dir = conf.get(product, 'result_dir')
-    upload_timeout = int(conf.get(product, 'upload_timeout'))
     builder_email = conf.get(product, 'builder_email')
 
     # flush ml_handler to send messages about previous fname
@@ -318,8 +317,8 @@
     logger.info(info)
 
     try:
-        dsc = Dsc(fname, exclude = ('.deb',), mustbesigned=False)
-    except DscException, exobj:
+        changes = Changes(fname, exclude = ('.deb',), mustbesigned=False)
+    except ChangesException, exobj:
         reject_fname(env, exobj)
         logger.removeHandler(handler)
         return FSM.NEXT
@@ -330,32 +329,20 @@
         return FSM.NEXT
 
     try:
-        dsc.verify()
-    except DscException, exobj:
+        changes.verify()
+    except ChangesException, exobj:
         logger.debug(exobj)
         reject_fname(env, exobj)
         logger.removeHandler(handler)
         return FSM.NEXT
-    except ChangeFileException, exobj:
-        # check dsc timeout
-        logger.debug(exobj)
-        if (datetime.now() - datetime.fromtimestamp(os.stat(fname).st_mtime)).seconds > upload_timeout:
-            reject_fname(env, exobj)
-            logger.removeHandler(handler)
-        else:
-            logger.clean()
-            logger.removeHandler(handler)
-            logger.debug("skipped, timeout isn't expired yet")
 
-        return FSM.NEXT
-
-    env.params['dsc'] = dsc
+    env.params['changes'] = changes
     env.params['extraopts'] = ""
-    env.params['targets'] = env.params['sbdtargets'].gettargets(dsc)
+    env.params['targets'] = env.params['sbdtargets'].gettargets(changes)
     env.params['firstbuild'] = True
     env.params['uploader_handler'] = handler
 
-    infras = infrasfactory(result_dir, dsc.name)
+    infras = infrasfactory(result_dir, changes.name)
 
     # create handler for summary.log
     create_summary_handler(logger, os.path.join(infras['logs'], 'summary.log'))
@@ -375,9 +362,9 @@
     # version check
     product = env.params['product']
     logger = env.params['logger']
-    dsc = env.params['dsc']
-    source = dsc['source']
-    version = dsc['version']
+    changes = env.params['changes']
+    source = changes['source']
+    version = changes['version']
 
     repo = env.params["conf"].get(product, 'src_repo')
     client = AptRepoClient(env.params["conf"].get(product, 'src_repo'))
@@ -416,7 +403,7 @@
     """ Copy files to destination. Run build command.  """
     
     logger = env.params['logger']
-    dsc = env.params['dsc']
+    changes = env.params['changes']
     destination = env.params['destination']
     target = env.params['target']
     extraopts = env.params['extraopts']
@@ -429,7 +416,7 @@
     build_command = conf.get(product, 'build_command', False, {'target' : target, 'extraopts' : extraopts})
     build_results = eval(conf.get(product, 'build_results', False, {'user' : destination.user, 'target' : target}))
     
-    logger.summary("Building %s for target '%s'" % (dsc.name.replace('_', ' '), target))
+    logger.summary("Building %s for target '%s'" % (changes.name.replace('_', ' '), target))
 
     # set up command
     destination.command = {'command' : build_command, 'results' : build_results}
@@ -437,14 +424,14 @@
     # prepare sources only once:
     if firstbuild:
         logger.debug("Moving files to '%s'" % infras['sources'])
-        dsc.movefiles(dest = infras['sources'])
+        changes.movefiles(dest = infras['sources'])
         logger.debug("copy files to destination")
-        destination.copyto(dsc.getpaths())
+        destination.copyto(changes.getpaths())
         env.params['firstbuild'] = False
 
     # Run sbdmock
     logger.debug('run build command')
-    (env.params['rcode'], _) = destination.run(dsc.fname)
+    (env.params['rcode'], _) = destination.run(changes.fname)
     
     return FSM.OK
 
@@ -534,7 +521,7 @@
 def remove_sources(env):
     """ Send email """
     
-    env.params['destination'].remove(env.params['dsc'].getpaths())
+    env.params['destination'].remove(env.params['changes'].getpaths())
 
     if env.params['rcode']:
         return FSM.STOP
@@ -577,7 +564,7 @@
         preserve = env.params['options'].preserve
 
         logger.summary("%s %s has been queued for loading into %s extras-devel repository" % \
-            (env.params['dsc']['source'], env.params['dsc']['version'], product))
+            (env.params['changes']['source'], env.params['changes']['version'], product))
 
         for fname in glob(os.path.join(resultdir, '*')):
             try:

Modified: trunk/buildme/tools/buildme.conf
===================================================================
--- trunk/buildme/tools/buildme.conf	2009-09-06 10:26:29 UTC (rev 143)
+++ trunk/buildme/tools/buildme.conf	2009-09-06 10:27:50 UTC (rev 144)
@@ -9,7 +9,6 @@
 gpg_key = 0xb11fff2f
 build_command = sbdmock -r %(target)s -u %(extraopts)s
 build_results = ("/scratchbox/users/%(user)s/home/%(user)s/%(target)s/result",)
-upload_timeout = 14400
 result_url = https://garage.maemo.org/builder/%(product)s/%(build_dir)s/
 src_repo = deb-src file:///var/www/extras-devel/ %(product)s free non-free
 allowed_categories = desktop development education games graphics multimedia navigation network office science social system utilities accessories communication other programming support themes tools

Modified: trunk/buildme/tools/buildme.conf.debug
===================================================================
--- trunk/buildme/tools/buildme.conf.debug	2009-09-06 10:26:29 UTC (rev 143)
+++ trunk/buildme/tools/buildme.conf.debug	2009-09-06 10:27:50 UTC (rev 144)
@@ -9,7 +9,6 @@
 gpg_key = 0xb11fff2f
 build_command = sbdmock -r %(target)s -u %(extraopts)s
 build_results = ("/scratchbox/users/%(user)s/home/%(user)s/%(target)s/result",)
-upload_timeout = 14400
 result_url = https://garage.maemo.org/builder/%(product)s/%(build_dir)s/
 src_repo = deb-src file:///var/www/extras-devel/ %(product)s free non-free
 allowed_categories = desktop development education games graphics multimedia navigation network office science social system utilities accessories communication other programming support themes tools



More information about the Extras-cauldron-commits mailing list