@ignatenkobrain has has created this in Fedora's rust-srpm-macros:

```lua
%version_no_tilde() %{lua:
    local sep = rpm.expand('%1')
    local ver = rpm.expand('%2')
\
    if sep == '%1' then
        sep = '-'
    end
\
    if ver == '%2' then
        ver = rpm.expand('%version')
    end
    ver = ver:gsub('~', sep)
\
    print(ver)
}
```

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:

 - the name of this macro suggests there is no tilde, not that the tilde is 
replaced with anything
 - it seem incredibly hard to pass an empty string as a macro argument (I 
haven't figured out how to do that yet)

WDYT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1219
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to