Hello community,

here is the log from the commit of package rust-packaging for openSUSE:Factory 
checked in at 2019-10-31 22:26:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rust-packaging (Old)
 and      /work/SRC/openSUSE:Factory/.rust-packaging.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rust-packaging"

Thu Oct 31 22:26:06 2019 rev:7 rq:744324 version:10

Changes:
--------
--- /work/SRC/openSUSE:Factory/rust-packaging/rust-packaging.changes    
2019-10-28 17:00:19.713755137 +0100
+++ /work/SRC/openSUSE:Factory/.rust-packaging.new.2990/rust-packaging.changes  
2019-10-31 22:26:08.472388226 +0100
@@ -1,0 +2,6 @@
+Wed Oct 30 22:34:38 UTC 2019 - Neal Gompa <[email protected]>
+
+- Fix version normalization via CargoSemVer
+  + 0001-metadata-normalize-version-via-CargoSemVer.patch
+
+-------------------------------------------------------------------

New:
----
  0001-metadata-normalize-version-via-CargoSemVer.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rust-packaging.spec ++++++
--- /var/tmp/diff_new_pack.R3eJ0V/_old  2019-10-31 22:26:09.852390085 +0100
+++ /var/tmp/diff_new_pack.R3eJ0V/_new  2019-10-31 22:26:09.868390107 +0100
@@ -35,6 +35,8 @@
 Patch0002:      0001-Ignore-Cargo.lock.patch
 # PATCH-FIX-UPSTREAM 
0001-metadata-replace-semantic-version-with-a-custom-pars.patch -- 
https://pagure.io/fedora-rust/rust2rpm/c/fcbf95a78efdb310f918363e69706e1a98d93a9f
 Patch0003:      0001-metadata-replace-semantic-version-with-a-custom-pars.patch
+# PATCH-FIX-UPSTREAM 0001-metadata-normalize-version-via-CargoSemVer.patch -- 
https://pagure.io/fedora-rust/rust2rpm/c/23e807d8ce571da4500f66075e08bfa412177972
+Patch0004:      0001-metadata-normalize-version-via-CargoSemVer.patch
 BuildArch:      noarch
 ExclusiveArch:  %{rust_arches} noarch
 

++++++ 0001-metadata-normalize-version-via-CargoSemVer.patch ++++++
>From 23e807d8ce571da4500f66075e08bfa412177972 Mon Sep 17 00:00:00 2001
From: Alberto Planas <[email protected]>
Date: Wed, 30 Oct 2019 17:28:32 +0100
Subject: [PATCH] metadata: normalize version via CargoSemVer

---
 rust2rpm/metadata.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
index 6dd8bb0..99debf3 100644
--- a/rust2rpm/metadata.py
+++ b/rust2rpm/metadata.py
@@ -220,10 +220,10 @@ class Metadata:
     def __init__(self, name, version):
         self.name = name
         self._version = version
-        version_normalized = Dependency._normalize_req(f"={self._version}")
-        if len(version_normalized) != 1:
-            raise Exception(f"Incorrect version: {self._version}")
-        self.version = version_normalized[0][1]
+        version_normalized = CargoSemVer.unparse_version(
+            CargoSemVer.coerce(
+                CargoSemVer.parse_version(self._version)))
+        self.version = version_normalized
         self.license = None
         self.license_file = None
         self.readme = None
-- 
2.21.0


Reply via email to