Open vooon opened 5 years ago
Hmm, that would require a re.MULTILINE
regex matching, maybe try a local dev version and change this line: https://github.com/c4urself/bump2version/blob/master/bumpversion/version_part.py#L137 to see if it works and send a PR?
Perhaps you can work around this limitation using a trick.
Version-bump the file twice -- which you can do as long as the INI headers are not identical, e.g. if the file name is written differently the second time.
Employ different parse
, serialize
, search
and replace
like this:
[bumpversion]
current_version = 0.5.0.1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+).(?P<build>\d+)
serialize = {major}.{minor}.{patch}.{build}
[bumpversion:file:rpm.spec]
search = Version: {current_version}
replace = Version: {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize = {major}.{minor}.{patch}
[bumpversion:file:./rpm.spec]
search = Release: {current_version}
replace= Release: {new_version}
parse = (?P<build>\d+)
serialize = {build}
I want to also bump release number of spec file, but it was on separate line. e.g.
My
.bumpversion.cfg