[Checkins] SVN: keas.build/trunk/src/keas/build/build.py switch processing order

Adam Groszer agroszer at gmail.com
Wed Feb 16 09:24:58 EST 2011


Log message for revision 120381:
  switch processing order

Changed:
  U   keas.build/trunk/src/keas/build/build.py

-=-
Modified: keas.build/trunk/src/keas/build/build.py
===================================================================
--- keas.build/trunk/src/keas/build/build.py	2011-02-16 13:59:35 UTC (rev 120380)
+++ keas.build/trunk/src/keas/build/build.py	2011-02-16 14:24:58 UTC (rev 120381)
@@ -219,10 +219,24 @@
     # Write out the new project config -- the pinned versions
     projectConfigFilename = '%s-%s.cfg' %(projectName, projectVersion)
     logger.info('Writing project configuration file: ' + projectConfigFilename)
-    projectFile = open(projectConfigFilename, 'w')
-    projectParser.write(projectFile)
+    projectParser.write(open(projectConfigFilename, 'w'))
 
+    filesToUpload = [projectConfigFilename]
+
+    # Process config files, check for dependent config files
+    # we should make sure that they are on the server
+    # by design only the projectConfigFilename will have variable dependencies
+    if template_path:
+        dependencies = getDependentConfigFiles(os.path.dirname(template_path),
+                                               projectConfigFilename,
+                                               addSelf=False,
+                                               outfile=projectConfigFilename)
+        filesToUpload.extend(dependencies)
+
     # Dump package repo infos
+    # do it here, projectConfigFilename might be rewritten by
+    # getDependentConfigFiles
+    projectFile = open(projectConfigFilename, 'a')
     projectFile.write('\n')
     projectFile.write('# package SVN infos:\n')
     for pkg, pkginfo in pkginfos.items():
@@ -236,18 +250,6 @@
                     pkginfo[1][0], pkginfo[1][1])
     projectFile.close()
 
-    filesToUpload = [projectConfigFilename]
-
-    # Process config files, check for dependent config files
-    # we should make sure that they are on the server
-    # by design only the projectConfigFilename will have variable dependencies
-    if template_path:
-        dependencies = getDependentConfigFiles(os.path.dirname(template_path),
-                                               projectConfigFilename,
-                                               addSelf=False,
-                                               outfile=projectConfigFilename)
-        filesToUpload.extend(dependencies)
-
     # Create deployment configurations
     for section in config.sections():
         if section == base.BUILD_SECTION:



More information about the checkins mailing list