Strip tildes from %version in %pypi_source by default, add tests

This commit is contained in:
Miro Hrončok 2020-05-11 19:02:37 +02:00
commit 4569c61d8d
3 changed files with 57 additions and 2 deletions

View file

@ -119,7 +119,7 @@
# Accepts zero to three arguments:
# 1: The PyPI project name, defaulting to %srcname if it is defined, then
# %pypi_name if it is defined, then just %name.
# 2: The PYPI version, defaulting to %version.
# 2: The PYPI version, defaulting to %version with tildes stripped.
# 3: The file extension, defaulting to "tar.gz". (A period will be added
# automatically.)
# Requires %__pypi_url and %__pypi_default_extension to be defined.
@ -146,7 +146,7 @@
\
-- If no second argument, use %version
if ver == '%2' then
ver = rpm.expand('%version')
ver = rpm.expand('%version'):gsub('~', '')
end
\
-- If no third argument, use the preset default extension