Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.6:Update
rpmdevtools
limit_newversion_re.sub_to_a_single_replacement...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File limit_newversion_re.sub_to_a_single_replacement.patch of Package rpmdevtools
From ea772dae0d8bb266233c3fd9e2012281a821ef44 Mon Sep 17 00:00:00 2001 From: Josh Stone <jistone@redhat.com> Date: Nov 02 2018 23:20:22 +0000 Subject: Limit newVersion's re.sub to a single replacement Python 3.7 changed `re.sub` to replace empty matches next to a previous non-empty match, which caused `SpecFile.newVersion` to double its replacements. We can use `count=1` to limit this. ref: https://bugs.python.org/issue32308 --- diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec index 35e6c9c..06737b5 100755 --- a/rpmdev-bumpspec +++ b/rpmdev-bumpspec @@ -134,13 +134,13 @@ class SpecFile(object): original = self.lines[i] if self.lines[i].lower().startswith('version:'): self.lines[i] = re.sub( - r'[^: \t]*$', v, self.lines[i].rstrip()) + '\n' + r'[^: \t]*$', v, self.lines[i].rstrip(), count=1) + '\n' changed = changed or self.lines[i] != original elif self.lines[i].lower().startswith('release:'): # 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' + re.sub(r'[^ \t]*$', r, split[1], count=1) + '\n' changed = changed or self.lines[i] != original return changed
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor