diff options
author | Jani Välimaa <wally@mageia.org> | 2023-01-07 09:27:14 +0200 |
---|---|---|
committer | Jani Välimaa <wally@mageia.org> | 2023-01-07 09:27:14 +0200 |
commit | 5f0aebe692304978a79a882601e4b8d8b07506a8 (patch) | |
tree | 0a495cd14b97d84a1b032af3a692817e2cc86c86 | |
parent | 1ba4497eb09acd56ccad75cbd3ab815ab818f150 (diff) | |
download | rpm-setup-5f0aebe692304978a79a882601e4b8d8b07506a8.tar rpm-setup-5f0aebe692304978a79a882601e4b8d8b07506a8.tar.gz rpm-setup-5f0aebe692304978a79a882601e4b8d8b07506a8.tar.bz2 rpm-setup-5f0aebe692304978a79a882601e4b8d8b07506a8.tar.xz rpm-setup-5f0aebe692304978a79a882601e4b8d8b07506a8.zip |
Add macros.gnome
Introduce %url_ver and %tarball_version macros
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | macros.gnome | 22 |
2 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,4 @@ +- add macros.gnome to introduce %url_ver and %tarball_version macros - rpm-spec-mode.el: fix compatibility with Emacs 28.1, patch from https://github.com/stigbjorlykke/rpm-spec-mode/pull/17 diff --git a/macros.gnome b/macros.gnome new file mode 100644 index 0000000..cb38bd0 --- /dev/null +++ b/macros.gnome @@ -0,0 +1,22 @@ +%tarball_version %{lua: +ver = string.gsub(rpm.expand("%{version}"), "~", ".") +print(ver) +} + +%url_ver %{lua: +ver = rpm.expand("%{version}") +majmin, count1 = string.gsub(ver, "^(%d+%.%d+).*", "%1", 1) +if count1 == 0 then + ver = string.gsub(ver, "~.*", "") + print(ver) + return +end +maj, count2 = string.gsub(majmin, "^(%d+).*", "%1", 1); +if count2 == 0 then + print(majmin) +elseif tonumber(majmin) < 40 then + print(majmin) +else + print(maj) +end +} |