Bug#893504: javatools: please make the generated MANIFEST.MF files reproducible

Chris Lamb lamby at debian.org
Mon Mar 19 13:32:47 UTC 2018


Source: javatools
Version: 0.62
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that javatools does not generate reproducible MANIFEST.MF files:

│ │ │ │ ├── META-INF/MANIFEST.MF
│ │ │ │ │┄ ordering differences only
│ │ │ │ │ @@ -4,37 +4,37 @@
│ │ │ │ │  Bundle-SymbolicName: org.w3c.css.sac
│ │ │ │ │  Bundle-Vendor: Debian.org
│ │ │ │ │  Bundle-Version: 1.4
│ │ │ │ │  Created-By: 1.3.1 (IBM Corporation)
│ │ │ │ │  Export-Package: org.w3c.css.sac,org.w3c.css.sac.helpers,org.w3c.dom.smil
│ │ │ │ │   ,org.w3c.dom.svg
│ │ │ │ │  
│ │ │ │ │ -Name: org/w3c/dom/
│ │ │ │ │ +Name: javax/xml/datatype/

(NB. "ordering differences only")

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/lib/Debian/Javahelper/Manifest.pm b/lib/Debian/Javahelper/Manifest.pm
index 0586cab..d56c933 100644
--- a/lib/Debian/Javahelper/Manifest.pm
+++ b/lib/Debian/Javahelper/Manifest.pm
@@ -63,8 +63,8 @@ manifest.
 =item $manifest->get_sections()
 
 Returns a list of all sections in B<$manifest>. The main section will
-always be the first in the list, but the remaining sections can come
-in any order (and this order can change in later invocations).
+always be the first in the list, and the remaining sections will be
+sorted in name order.
 
 Modifying the list will not change which sections are present in
 B<$manifest>, but modifying a section in this list will also update
@@ -114,13 +114,13 @@ sub get_section {
 
 sub get_sections {
     my $this = shift;
-    # There is always a main section.
-    my $main = $this->get_section(MAIN_SECTION, 1);
-    my @sections = ($main);
-    while( my ($name, $sec) = each(%$this) ){
+    my @sections = (); 
+    foreach my $name (sort(keys %$this)) {
         next if($name eq MAIN_SECTION);
-        push(@sections, $sec);
+        push(@sections, $this->{$name});
     }
+    # There is always a main section at the front
+    unshift(@sections, $this->get_section(MAIN_SECTION, 1));
     return @sections;
 }
 


More information about the pkg-java-maintainers mailing list