- dch doesn't allow a empty version
- when checking for old version in unittests, only check if a
version is available. Doesn't work to check for an empty string
or a whitespace.
Remove tagname from data_test_from_commandline.json so this can
be reused for the PKGBUILD tests where the tag keyname is different
compared to RPM specfiles.
Use the functionality for converting PEP440 compatible python versions
to rpm compatible versions. Given the following example .spec:
%define component heat
Version: 5.0.0.0b2.dev261
%setup -q -n %{component}-%{version}
Will be transformed to something like:
%define component heat
%define version_unconverted 5.0.0.0b2.dev261
Version: 5.0.0.0~b2~dev261
%setup -q -n %{component}-%{version_unconverted}
This is the next needed addition to handle python package versions which
are PEP440 compatible. While using the converted (PEP440 compatible)
version in the 'Version' tag, for the '%setup' section, the unconverted
version needs to be used. The new function can be used to replace the
'%{version}' in the '%setup' section.
This function will be used to set the tarball version in a .spec
file. This is needed for PEP440 compatible versions for python
packages. Imagine the detected python version by 'set_version' is
'5.0.0.0a1.dev13'. The converted version will be '5.0.0.0~a1~dev13' (so
5.0.0.0 > 5.0.0.0~a1~dev13 is valid).
In the .spec file, the 'Version' tag will be set to '5.0.0.0~a1~dev13'
but we still need the unconverted version '5.0.0.0a1.dev13' because this
is the version which will be use in the '%setup' section to enter the
correct directory during the setup step. So the setup section should
then look like '%setup -q -n %{component}-%{unconverted_version}'
In addition to the current tests running with zypper, also test that the
generated versions are compatible with dpkg.
Also improve the assertion output in case of a test failure.
Python's PEP440 compatible versions can look like "1.1alpha" which means
in the pip world (pip is python's package manager), that "1.1 >
1.1alpha". Comparing the same version with rpm, the result is
"1.1alpha > 1.1". This commit adds code to convert PEP440 versions to
rpm versions without loosing the correct version compare semantics.
Currently only test tarballs with empty directories can be created. This
commit also allows to add empty files to the test tarball. This is
needed for package type detection tests.
For the following reasons:
- integration of https://github.com/openSUSE/\
obs-service-set_version_pysemver simpler
- testsuite is in python
- try "import this" to get more reasons :)