While using rpmdev-bumpspec it always bumping in end with (.1 if not any else .2 and so on) even I did not provide -r option i.e. $rpmdev-bumpspec $ git diff diff --git a/xxx.spec b/xxx.spec .spec index f50f921..01100fc 100644 --- a/xxx.spec +++ b/xxx.spec @@ -52,7 +52,7 @@ ExcludeArch: i686 Version: 1.4.3.34 -Release: %{?relprefix}4%{?prerel}%{?dist} +Release: %{?relprefix}4%{?prerel}%{?dist}.1 License: GPLv3+ and (ASL 2.0 or MIT) and MIT and (Unlicense or MIT) and MPLv2.0 and BSD and (ASL 2.0 with exceptions or ASL 2.0 or MIT) and ASL 2.0 and (ASL 2.0 or Boost) and ((MIT or ASL 2.0) and Unicode-DFS-2016) URL: https://www.port389.org Group: System Environment/Daemons @@ -933,6 +933,9 @@ exit 0 %doc README.md
%changelog +* Fri Feb 07 2025 Arun Bansal arbansal@xxxx.com - 1.4.3.34-4.1 +- rebuilt
Here Release macro should have update from %{?relprefix}4%{?prerel}%{?dist}.1 -> %{?relprefix}5%{?prerel}%{?dist}
And also -r option is not doing anything, there is only default bumping as mentioned above
Please refer #373 if string is None and opts.rightmost:
string = ""
Unfortunately, your "Release" tag is beyond the Fedora Packaging versioning schemes supported by the tool. The tool is not AI powered, nor does it use any magic driven parser to even attempt at understanding what release versioning scheme a packager has invented. And while it recognizes and supports some official release versioning schemes (and some macro usage, too), the Release tag you have chosen is not recognized.
One work-around would be: %global baserelease 4
%global baserelease 4
Release: %{?relprefix}%{baserelease}%{?prerel}%{?dist}
Yes, I know there is no AI and magic driven parser. But we can add logic to cater this case as well, because this pattern is quite common on RHEL packages and we have to do version bump this way. We update RHEL packages's spec file on fedora desktop and build through brew. If this case cater can also be cater then it will be very helpful. I can propose a fix via a MR and then it can be review. Let me know your opinion.
only this much change will require to be added. diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec index 5a6a909..061ba9b 100755 --- a/rpmdev-bumpspec +++ b/rpmdev-bumpspec @@ -59,6 +59,7 @@ class SpecFile(object): _tag_bump_patterns = ( re.compile(r"^Release\s:\s(\d+.)", re.I), re.compile(r"^Release\s:\s+%release_func\s+(\d+.)", re.I), + re.compile(r"^Release\s:\s+(%{.})(\d+.*)", re.I) ) I mean only above regex to be added Let me know your opinion if not, then may I use this updated file in my project?
Adding your first proposal to rpmdev-bumpspec 1.0.13, it didn't work with your spec file:
$ ./rpmdev-bumpspec -V xxx.spec xxx.spec -%{?relprefix} +%{?relprefix}.1
The likely reason was the early .* regex that would be much to unspecific for the goal of matching only well-known release versioning schemes. After you've changed the proposed patch, it falls back to bumping right-most:
.*
$ ./rpmdev-bumpspec -V xxx.spec xxx.spec - %{?relprefix}4%{?prerel}%{?dist} + %{?relprefix}4%{?prerel}%{?dist}.1
Adding your first proposal to rpmdev-bumpspec 1.0.13, it didn't work with your spec file: $ ./rpmdev-bumpspec -V xxx.spec xxx.spec -%{?relprefix} +%{?relprefix}.1 The likely reason was the early .* regex that would be much to unspecific for the goal of matching only well-known release versioning schemes. After you've changed the proposed patch, it falls back to bumping right-most: $ ./rpmdev-bumpspec -V xxx.spec xxx.spec - %{?relprefix}4%{?prerel}%{?dist} + %{?relprefix}4%{?prerel}%{?dist}.1
$ ./rpmdev-bumpspec -V xxx.spec xxx.spec -%{?relprefix} +%{?relprefix}.1 The likely reason was the early .* regex that would be much to unspecific for the goal of matching only well-known release versioning schemes. After you've changed the proposed patch, it falls back to bumping right-most:
I have raise PR https://pagure.io/rpmdevtools/pull-request/120, I also put some examples. Let me know feedback