summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2012-02-11 16:46:51 (GMT)
committerVille Skyttä <ville.skytta@iki.fi>2012-02-11 16:46:51 (GMT)
commit8ab7ef7a2b53ae2081b1629cee2c9e64edc51a12 (patch)
treed71ebe1aa606bca9daaf343f968d4cc444cfa367
parent485ba3f91506b76a57a14e5c47d6bc93a9ce74bf (diff)
downloadrpmdevtools-8ab7ef7.zip
rpmdevtools-8ab7ef7.tar.gz
rpmdevtools-8ab7ef7.tar.xz
bumpspec: Bump subpackage releases too.
https://bugzilla.redhat.com/789330
-rw-r--r--NEWS5
-rwxr-xr-xrpmdev-bumpspec17
2 files changed, 16 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 20fb707..e2fdf16 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+rpmdevtools x.x (201x-xx-xx)
+
+ Ville Skyttä:
+ - Make -bumpspec bump subpackage releases too (#789330).
+
rpmdevtools 8.2 (2011-11-12)
Ville Skyttä:
diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec
index c859477..3018730 100755
--- a/rpmdev-bumpspec
+++ b/rpmdev-bumpspec
@@ -1,7 +1,7 @@
#!/usr/bin/python -t
# -*- mode: Python; indent-tabs-mode: nil; coding: utf-8 -*-
#
-# Copyright (c) 2005-2011 Fedora Project
+# Copyright (c) 2005-2012 Fedora Project
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ import time
from optparse import OptionParser
-__version__ = "1.0.10"
+__version__ = "1.0.11"
class BumpSpecError(Exception):
pass
@@ -54,6 +54,7 @@ class SpecFile:
)
def bumpRelease(self):
+ bumped = False
for i in range(len(self.lines)):
skipped = False
for pattern in SpecFile._skip_patterns:
@@ -65,8 +66,9 @@ class SpecFile:
for pattern in SpecFile._bump_patterns:
(self.lines[i], n) = \
pattern.subn(self.increase, self.lines[i], 1)
- if n: # bumped
- return
+ bumped = bumped or n
+ if bumped:
+ return
# Here, no line matched at all.
# Happens with macro-overloaded spec files e.g.
@@ -77,8 +79,11 @@ class SpecFile:
new = self.increaseFallback(old)
if self.verbose:
self.debugdiff(old, new)
- self.lines[i] = self.lines[i].replace(old, new)
- return
+ if old != new:
+ self.lines[i] = self.lines[i].replace(old, new)
+ bumped = True
+ if bumped:
+ return
if self.verbose:
sys.stderr.write('ERROR: No release value matched: %s\n' %