SHA256
1
0
forked from pool/apache-ivy
Fridrich Strba 2023-09-19 06:26:47 +00:00 committed by Git OBS Bridge
parent 96c58388ed
commit fc9b9b371b
2 changed files with 46 additions and 4 deletions

View File

@ -0,0 +1,42 @@
--- apache-ivy-2.5.2/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java 2023-09-19 08:19:56.006332869 +0200
+++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java 2023-09-19 08:20:15.856475360 +0200
@@ -1472,7 +1472,7 @@
}
private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) {
- return new DefaultArtifact(mrid, new Date(), "metadata", "metadata", "ivy", true);
+ return new DefaultArtifact(mrid, System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date(), "metadata", "metadata", "ivy", true);
}
// not used any more, but may be useful for finer grained locking when downloading artifacts
--- apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java 2023-09-19 08:19:56.009666226 +0200
+++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java 2023-09-19 08:20:27.823227936 +0200
@@ -100,7 +100,7 @@
throw new NullPointerException("null arid not allowed");
}
if (publicationDate == null) {
- publicationDate = new Date();
+ publicationDate = System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date();
}
this.publicationDate = publicationDate;
this.arid = arid;
--- apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java 2023-09-19 08:19:56.009666226 +0200
+++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java 2023-09-19 08:21:12.330214087 +0200
@@ -272,7 +272,7 @@
this.resolvedRevId = id;
this.status = status;
this.publicationDate = pubDate;
- this.resolvedPublicationDate = publicationDate == null ? new Date() : publicationDate;
+ this.resolvedPublicationDate = publicationDate == null ? (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()) : publicationDate;
this.isDefault = isDefault;
this.parser = XmlModuleDescriptorParser.getInstance();
}
@@ -308,7 +308,7 @@
public void setPublicationDate(Date publicationDate) {
this.publicationDate = publicationDate;
if (resolvedPublicationDate == null) {
- resolvedPublicationDate = publicationDate == null ? new Date() : publicationDate;
+ resolvedPublicationDate = publicationDate == null ? (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()) : publicationDate;
}
}

View File

@ -31,11 +31,12 @@ Source0: https://archive.apache.org/dist/ant/ivy/%{version}/%{name}-%{ver
Source1: ivy.1
Source2: https://repo1.maven.org/maven2/org/apache/ivy/ivy/%{version}/ivy-%{version}.pom
Patch0: apache-ivy-global-settings.patch
Patch1: apache-ivy-publication-date.patch
BuildRequires: ant
BuildRequires: bouncycastle-pg
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
BuildRequires: jsch
BuildRequires: oro
BuildConflicts: java-devel >= 14
@ -75,11 +76,10 @@ JavaDoc documentation for %{name}
%prep
%setup -q
%patch0 -p1
%patch1 -p1
cp %{SOURCE2} pom.xml
%pom_remove_parent .
%pom_remove_dep :jsch.agentproxy
%if %{without httpclient}
@ -151,7 +151,7 @@ install -p -m644 build/artifact/jars/ivy.jar %{buildroot}%{_javadir}/ivy.jar
ln -sf ../ivy.jar %{buildroot}%{_javadir}/%{name}/ivy.jar
install -d -m 0755 %{buildroot}/%{_mavenpomdir}/
install -m 0644 pom.xml %{buildroot}/%{_mavenpomdir}/JPP-ivy.pom
%mvn_install_pom pom.xml %{buildroot}/%{_mavenpomdir}/JPP-ivy.pom
# Maven depmap
%add_maven_depmap JPP-ivy.pom ivy.jar