From c0ac646aa25aa15aab52f834188bc3e16ad2d822 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Sep 14 2015 15:34:04 +0000 Subject: in newVersion(): split and reconstruct Release tag to preserve whitespace formatting --- diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec index 65f4409..fc2a6de 100755 --- a/rpmdev-bumpspec +++ b/rpmdev-bumpspec @@ -137,8 +137,9 @@ class SpecFile: r'[^: \t]*$', v, self.lines[i].rstrip()) + '\n' changed = changed or self.lines[i] != original elif self.lines[i].lower().startswith('release:'): - self.lines[i] = re.sub( - r'[^: \t]*$', r, self.lines[i].rstrip()) + '\n' + # split and reconstruct to preserve whitespace + split = re.split(r':',self.lines[i].rstrip()) + self.lines[i] = split[0] + ':' + re.sub(r'[^ \t]*$', r, split[1]) + '\n' changed = changed or self.lines[i] != original return changed