diff --git a/0001-Relax-version-validation.patch b/0001-Relax-version-validation.patch deleted file mode 100644 index 299c13a..0000000 --- a/0001-Relax-version-validation.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 3abc0e781f69872c199f8078fd9ec165650be8b3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Tue, 2 Feb 2016 13:18:12 +0100 -Subject: [PATCH] Relax version validation - -Check the format only if version starts with a digit. This allows having -non-numeric versions such as Rawhide. - -Fixes #11 ---- - doc/terminology.rst | 6 ++++++ - productmd/composeinfo.py | 6 +++++- - tests/test_composeinfo.py | 10 +++++++++- - 3 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/doc/terminology.rst b/doc/terminology.rst -index 785693b..a98f1da 100644 ---- a/doc/terminology.rst -+++ b/doc/terminology.rst -@@ -108,6 +108,12 @@ Recommended schema is dot separated numbers: - * **X.Y.Z** -- bugfix version / hotfix version - - -+.. note :: -+ It is technically possible to use arbitrary string as a version, but this -+ is highly discouraged as it does not allow sorting. If you need it, just -+ start your version with any non-digit character. -+ -+ - .. _Milestones: - - ========== -diff --git a/productmd/composeinfo.py b/productmd/composeinfo.py -index bb6c757..aece4a0 100644 ---- a/productmd/composeinfo.py -+++ b/productmd/composeinfo.py -@@ -374,8 +374,12 @@ class BaseProduct(productmd.common.MetadataBase): - self._assert_type("name", list(six.string_types)) - - def _validate_version(self): -+ """If the version starts with a digit, it must be a sematic-versioning -+ style string. -+ """ - self._assert_type("version", list(six.string_types)) -- self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) -+ if re.match('^\d', self.version): -+ self._assert_matches_re("version", [r"^\d+(\.\d+)*$"]) - - def _validate_short(self): - self._assert_type("short", list(six.string_types)) -diff --git a/tests/test_composeinfo.py b/tests/test_composeinfo.py -index e24984d..79cad82 100755 ---- a/tests/test_composeinfo.py -+++ b/tests/test_composeinfo.py -@@ -29,7 +29,7 @@ import shutil - DIR = os.path.dirname(__file__) - sys.path.insert(0, os.path.join(DIR, "..")) - --from productmd.composeinfo import ComposeInfo, Variant -+from productmd.composeinfo import ComposeInfo, Variant, Release - - - class TestComposeInfo(unittest.TestCase): -@@ -117,6 +117,14 @@ class TestComposeInfo(unittest.TestCase): - ci.compose.label = "GA" - self.assertRaises(ValueError, ci.dump, self.ci_path) - -+ def test_release_non_numeric_version(self): -+ r = Release(None) -+ r.name = "Fedora" -+ r.short = "f" -+ r.version = "Rawhide" -+ -+ r.validate() -+ - - if __name__ == "__main__": - unittest.main() --- -2.5.0 - diff --git a/python-productmd.spec b/python-productmd.spec index 565a222..76d83cb 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -22,7 +22,6 @@ Group: Development/Tools License: LGPLv2+ URL: https://github.com/release-engineering/productmd Source0: productmd-%{version}.tar.gz -Patch0: 0001-Relax-version-validation.patch Obsoletes: productmd <= %{version}-%{release} Provides: productmd = %{version}-%{release} @@ -113,7 +112,7 @@ popd %changelog * Thu Feb 18 2016 Dennis Gilmore - 1.0-11 -- add patch to allow us to use rawhide as the version +- update from git to allow us to use rawhide as the version * Thu Feb 04 2016 Fedora Release Engineering - 1.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 92b88ea..afa2bdd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e46907ebeb70c2d96f4c2beca5f65850 productmd-1.0.tar.gz +5e0c776551ebca6aeb89f233ca290a19 productmd-1.0.tar.bz2