rebuild-scripts bumpspecfile.py,1.17,1.18

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Sun Mar 9 00:45:19 UTC 2008


Author: mschwendt

Update of /cvs/fedora/rebuild-scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13446

Modified Files:
	bumpspecfile.py 
Log Message:
return early from lines-loop if matched


Index: bumpspecfile.py
===================================================================
RCS file: /cvs/fedora/rebuild-scripts/bumpspecfile.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- bumpspecfile.py	9 Mar 2008 00:14:14 -0000	1.17
+++ bumpspecfile.py	9 Mar 2008 00:45:18 -0000	1.18
@@ -40,21 +40,17 @@
                        (re.compile(r"^%define\s+baserelease\s+(\d+.*)"), self.increase),
                        ]
         skip_pattern = re.compile(r"\$Revision:")
-        bumped = False
         for i in range(len(self.lines)):
             if skip_pattern.search(self.lines[i]):
                 continue
             for bumpit, bumpit_func in bump_patterns:
                 (self.lines[i], n) = bumpit.subn(bumpit_func, self.lines[i], 1)
-                if n:
-                    bumped = True
-                    break
-            if bumped:
-                break
-
-        if not bumped:  # no match at all
-            if self.verbose:
-                print >> sys.stderr, 'ERROR: No release value matched:', self.filename
+                if n:  # bumped
+                    return
+        # Here, no line matched at all.
+        # TODO: Bump ^Release: ... line least-insignificant.
+        if self.verbose:
+            print >> sys.stderr, 'ERROR: No release value matched:', self.filename
             sys.exit(1)
 
     def addChangelogEntry(self, evr, entry, email):




More information about the fedora-extras-commits mailing list