-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macros: Add %version_notilde #722
macros: Add %version_notilde #722
Conversation
This has been originally part of rust-srpm-macros under %version_no_tilde, but people asked to move to RPM because more and more packagers started to use tilde version. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
@@ -335,16 +335,16 @@ package or when debugging this package.\ | |||
|
|||
# A colon separated list of desired locales to be installed; | |||
# "all" means install all locale specific files. | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why give someone a reason to reject this just because it includes unrelated whitespace changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed...
This sort of seems the kind of thing that would go in to redhat-rpm-config (or another distro-specific package) first instead of straight upstream to RPM. But I guess I don't fully understand how new macros are expected to flow into RPM these days. |
@jasontibbitts well, nowadays we try to avoid pushing anything to redhat-rpm-config if it would be useful for others. For some things which need more testing or thinking, redhat-rpm-config should be the first place... But for things like this I don't see any reason to not get it straight in RPM. |
Macro expansion internals aside, I do wonder. Where's %version_nocaret? (no, I dont want to see that either, but I sense there may well be something here) What's the actual use-case? |
So the upstream tarballs are never using tilde in their version, they are more like |
Right. And caret presents a similar case. /me mumbles something about "upstream version" sounding closer to the mark. |
Yeah, actually caret usually is used for parts which are not part of upstream version. like |
Something to that direction maybe. This also makes me think about the case in #715... |
# -v<version> Sets the version to be used for replacement. Default is %version. | ||
%version_notilde(v:) %{lua: | ||
local sep = rpm.expand('%1') | ||
local ver = rpm.expand('%{!-v:%{version}}%{-v:%{-v*}}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another remark here is that you might want to use %{VERSION} as the default instead - that will always refer to the main package version, whereas %{version} will point to whatever the last Version: tag in the spec was (it's rare but sometimes sub-packages have their own versions).
There might well be a case behind this, but not in this form. Lets close this and continue elsewhere. |
This has been originally part of rust-srpm-macros under
%version_no_tilde, but people asked to move to RPM because more and more
packagers started to use tilde version.
Signed-off-by: Igor Gnatenko i.gnatenko.brain@gmail.com