epel mirroring
[build.git] / module-tools.py
index 2cadc2b..85c4510 100755 (executable)
@@ -73,7 +73,7 @@ class Command:
             sys.stdout.flush()
         retcod=os.system(self.command + " &> " + self.tmp)
         if retcod != 0:
-            print "FAILED ! -- output quoted below "
+            print "FAILED ! -- out+err below (command was %s)"%self.command
             os.system("cat " + self.tmp)
             print "FAILED ! -- end of quoted output"
         elif self.options.verbose:
@@ -380,11 +380,16 @@ that for other purposes than tagging"""%topdir
     def unignored_lines (self, logfile):
         result=[]
         exclude="Tagging module %s"%self.name
+        white_line_matcher = re.compile("\A\s*\Z")
         for logline in file(logfile).readlines():
             if logline.strip() == Module.svn_magic_line:
                 break
-            if logline.find(exclude) < 0:
-                result += [ logline ]
+            if logline.find(exclude) >= 0:
+                continue
+            elif white_line_matcher.match(logline):
+                continue
+            else:
+                result.append(logline.strip()+'\n')
         return result
 
     def insert_changelog (self, logfile, oldtag, newtag):
@@ -527,7 +532,7 @@ that for other purposes than tagging"""%topdir
 
 ##############################
     sync_warning="""*** WARNING
-The module-init function has the following limitations
+The module-sync function has the following limitations
 * it does not handle changelogs
 * it does not scan the -tags*.mk files to adopt the new tags"""
 
@@ -698,6 +703,8 @@ Please write a changelog for this new tag in the section above
             buildname=Module.config['build']
         except:
             buildname="build"
+        if self.options.build_branch:
+            buildname+=":"+self.options.build_branch
         build = Module(buildname,self.options)
         build.init_moddir()
         build.init_edge_dir()
@@ -902,6 +909,8 @@ More help:
         if mode == "tag" :
             parser.add_option("-c","--no-changelog", action="store_false", dest="changelog", default=True,
                               help="do not update changelog section in specfile when tagging")
+            parser.add_option("-b","--build-branch", action="store", dest="build_branch", default=None,
+                              help="specify a build branch; used for locating the *tags*.mk files where adoption is to take place")
         if mode == "tag" or mode == "sync" :
             parser.add_option("-e","--editor", action="store", dest="editor", default=default_editor(),
                               help="specify editor")
@@ -956,7 +965,7 @@ More help:
             try:
                 method(module)
             except Exception,e:
-                print 'Skipping failed %s - %r'%(modname,e)
+                print 'Skipping failed %s: '%modname,e
 
 if __name__ == "__main__" :
     try: