-
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
RFE: Convenient %version without tilde macro #1219
Comments
This was actually suggested here first (see #722) and rejected in this form with the notion that there might be something there however. So of the problem is figuring what that "something like" is. Singling out tilde seems odd. I could imagine there being cases where you want these "rpm embellishments" stripped out, but that should then also cover caret (and any other such thing that might get added in the future), which calls for a more generic name. "Upstream version" was mentioned in the PR, but that doesn't sound right either because the tilde/caret parts typically are from upstream. Something like "bare version" (any phonetic resemblance to large four feet mammals is purely coincidental), but this all makes me think we're going backwards here, and that we should start by disassembling Version to its components at the "source" already. There's this "main" or "bare" version which is typically something like [major[.minor[.micro[.nano]]]] and these can have pre- and post-modifiers that affect the sorting. Should spec have separate tags to declare these as individual components that rpm arranges into a Version as we know it? Or something... As for passing passing empty strings (or strings with spaces etc) as a macro argument, use %{quote:} |
I get your point. But before we come ou with a concept of native "pre/post tag", I think we should have a way to address this in a common way. I like |
Thanks. Ugly, but works. |
I think |
As I noted above, the problem with "upstream version" is that the pre/post suffixes are upstream. So upstream version and the bare version are two different things. |
technically, since we are at RPM level, I wouldn't mind having this syntax:
To remove whatever symbols I like. |
What about this:
Would that fly? Or should I include it in python-srpm-macros instead? |
See also #1764 |
Examples: %{gsub 3.1~~dev1 ~} -> 3.1dev1 %{gsub 2.3^post5 ^ -} -> 2.3-post5 %{gsub foo_bar [^%%w]+ -} -> foo-bar %{gsub aaa a b 2} -> bba %{gsub dummy} -> dummy %{gsub} -> (empty string) Related to rpm-software-management#1219 Related to https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/101
I believe this is now fixed with #2181, closing. |
OK, "fixed" might be an overstatement, given that the original request was more about the ability to extract the plain version from a string containing a tilde (AIUI) than about adding primitives to be able to do that (which #2181 does). In any case, something similar is being discussed here: #2715. |
@ignatenkobrain has has created this in Fedora's rust-srpm-macros:
I'd like to have something like this part of the standard issued macros. However, I think the default should be empty separator for 2 reasons:
WDYT?
The text was updated successfully, but these errors were encountered: