ant/reproducible-build-manifest.patch
Fridrich Strba 372ab108d9 Accepting request 644719 from home:1Antoine1:branches:Java:packages
- Add reproducible-build-manifest.patch: Use less detailed version
  string for manifest's "Created-by" field (boo#1110024).

OBS-URL: https://build.opensuse.org/request/show/644719
OBS-URL: https://build.opensuse.org/package/show/Java:packages/ant?expand=0&rev=119
2018-10-25 21:10:16 +00:00

33 lines
1.5 KiB
Diff

Use Java major version for manifest's Created-by
No need of detailed version such java.vm.version. Java's jar command
uses java.version when it fills the manifest's "Created-by" field,
let's make ant do the same.
Using a detailed version makes that every Java release triggers a
new publication for ant-based applications, only because a line in
manifest has changed - not because the binary or dependencies have
changed. Using a less detailed version reduces these publications.
Using a less detailed version also prevents more subtle problems
such as in boo#1110024: noarch packages differ depending on the
builder architecture, when Java vm version contains an architecture
information (which is the case for openSUSE, though it's probably
not relevant).
--
--- a/src/main/org/apache/tools/ant/taskdefs/Manifest.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Manifest.java
@@ -816,10 +816,7 @@ public class Manifest {
try {
insr = new InputStreamReader(in, "UTF-8");
Manifest defaultManifest = new Manifest(insr);
- String version = System.getProperty("java.runtime.version");
- if (version == null) {
- version = System.getProperty("java.vm.version");
- }
+ String version = System.getProperty("java.version");
Attribute createdBy = new Attribute("Created-By",
version + " ("
+ System.getProperty("java.vm.vendor") + ")");