64 lines
2.5 KiB
Diff
64 lines
2.5 KiB
Diff
From db5bcee5c902bc1979f46978e7f5032f134d24fe Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
|
|
Date: Mon, 11 Sep 2023 18:43:28 +0200
|
|
Subject: [PATCH 3/3] Reproducible exclusions order in maven metadata
|
|
|
|
---
|
|
python/javapackages/maven/dependency.py | 6 +++---
|
|
python/javapackages/metadata/dependency.py | 4 ++--
|
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/python/javapackages/maven/dependency.py b/python/javapackages/maven/dependency.py
|
|
index 8b92327c..534a631e 100644
|
|
--- a/python/javapackages/maven/dependency.py
|
|
+++ b/python/javapackages/maven/dependency.py
|
|
@@ -100,7 +100,7 @@ class Dependency(AbstractArtifact):
|
|
|
|
if self.exclusions:
|
|
exc_root = Element("exclusions")
|
|
- for exc in self.exclusions:
|
|
+ for exc in sorted(self.exclusions):
|
|
exc_root.insert(len(exc_root), exc.get_xml_element())
|
|
xml_root.insert(len(root), exc_root)
|
|
|
|
@@ -127,7 +127,7 @@ class Dependency(AbstractArtifact):
|
|
excnodes = xmlnode.findall("{*}exclusions/{*}exclusion")
|
|
|
|
exclusions = []
|
|
- for exc in [Exclusion.from_xml_element(x) for x in excnodes]:
|
|
+ for exc in [Exclusion.from_xml_element(x) for x in sorted(excnodes)]:
|
|
exclusions.append(exc)
|
|
|
|
return cls(parts["groupId"],
|
|
@@ -137,7 +137,7 @@ class Dependency(AbstractArtifact):
|
|
version=parts["version"],
|
|
scope=parts["scope"],
|
|
optional=parts["optional"],
|
|
- exclusions=exclusions)
|
|
+ exclusions=sorted(exclusions))
|
|
|
|
@classmethod
|
|
def from_mvn_str(cls, mvnstr):
|
|
diff --git a/python/javapackages/metadata/dependency.py b/python/javapackages/metadata/dependency.py
|
|
index 1709e1fb..d5082215 100644
|
|
--- a/python/javapackages/metadata/dependency.py
|
|
+++ b/python/javapackages/metadata/dependency.py
|
|
@@ -137,7 +137,7 @@ class MetadataDependency(ObjectBinding):
|
|
@classmethod
|
|
def from_mvn_dependency(cls, mvn_dep):
|
|
exclusions = set()
|
|
- for e in mvn_dep.exclusions:
|
|
+ for e in sorted(mvn_dep.exclusions):
|
|
exclusions.add(MetadataExclusion.from_mvn_exclusion(e))
|
|
|
|
return cls(mvn_dep.groupId, mvn_dep.artifactId,
|
|
@@ -145,4 +145,4 @@ class MetadataDependency(ObjectBinding):
|
|
classifier=mvn_dep.classifier,
|
|
optional=mvn_dep.optional,
|
|
requestedVersion=mvn_dep.version,
|
|
- exclusions=exclusions)
|
|
+ exclusions=sorted(exclusions))
|
|
--
|
|
2.42.0
|
|
|