Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package strip-nondeterminism for openSUSE:Factory checked in at 2021-06-16 20:33:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/strip-nondeterminism (Old) and /work/SRC/openSUSE:Factory/.strip-nondeterminism.new.32437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "strip-nondeterminism" Wed Jun 16 20:33:27 2021 rev:6 rq:899924 version:1.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/strip-nondeterminism/strip-nondeterminism.changes 2019-11-06 13:47:33.947600940 +0100 +++ /work/SRC/openSUSE:Factory/.strip-nondeterminism.new.32437/strip-nondeterminism.changes 2021-06-16 20:33:36.954994754 +0200 @@ -1,0 +2,18 @@ +Mon Jun 14 10:21:07 UTC 2021 - Bernhard Wiedemann <bwiedem...@suse.com> + +- Update to version 1.12.0 + * Also normalise PO-Revision-Date in addition to POT-Creation-Date. + * Ignore unwritable files, printing a warning. + * Add a warning message under --verbose statement when the Archive::Cpio + package is missing. (MR: reproducible-builds/strip-nondeterminism!6) + * Fix an off-by-one error when parsing PNG modification times. + +------------------------------------------------------------------- +Fri Jun 11 11:43:06 UTC 2021 - Dominique Leuenberger <dims...@opensuse.org> + +- Move macros.strip-nondeterminism from /etc/rpm to + %{_rpmmacrodir} (boo#1185657). +- Install the macro file non-executable: it is loaded by rpm, never + run. + +------------------------------------------------------------------- Old: ---- strip-nondeterminism-1.6.1.tar.bz2 strip-nondeterminism-1.6.1.tar.bz2.asc New: ---- strip-nondeterminism-1.12.0.tar.bz2 strip-nondeterminism-1.12.0.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ strip-nondeterminism.spec ++++++ --- /var/tmp/diff_new_pack.chMrZY/_old 2021-06-16 20:33:37.574995812 +0200 +++ /var/tmp/diff_new_pack.chMrZY/_new 2021-06-16 20:33:37.574995812 +0200 @@ -1,7 +1,7 @@ # # spec file for package strip-nondeterminism # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,12 +17,12 @@ Name: strip-nondeterminism -Version: 1.6.1 +Version: 1.12.0 Release: 0 Summary: A tool for stripping non-deterministic information License: GPL-3.0-or-later Group: Development/Libraries/Perl -Url: https://anonscm.debian.org/git/reproducible/strip-nondeterminism.git +URL: https://anonscm.debian.org/git/reproducible/strip-nondeterminism.git Source: https://reproducible-builds.org/_lfs/releases/strip-nondeterminism/strip-nondeterminism-%{version}.tar.bz2 Source1: https://reproducible-builds.org/_lfs/releases/strip-nondeterminism/strip-nondeterminism-%{version}.tar.bz2.asc Source2: rpmmacros @@ -63,8 +63,8 @@ %{__make} test %install -mkdir -p %buildroot/etc/rpm/ %buildroot/%{_bindir}/ -install -p %{SOURCE2} %buildroot/etc/rpm/macros.strip-nondeterminism +mkdir -p %buildroot%{_rpmmacrodir} %buildroot/%{_bindir}/ +install -p %{SOURCE2} -m 644 %buildroot%{_rpmmacrodir}/macros.strip-nondeterminism install -p %{SOURCE3} -m 755 %buildroot/%{_bindir}/ %perl_make_install %perl_process_packlist @@ -74,6 +74,6 @@ %defattr(-,root,root,755) %doc README TODO %license COPYING -/etc/rpm/macros.strip-nondeterminism +%{_rpmmacrodir}/macros.strip-nondeterminism %changelog ++++++ strip-nondeterminism-1.6.1.tar.bz2 -> strip-nondeterminism-1.12.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/bin/dh_strip_nondeterminism new/strip-nondeterminism-1.12.0/bin/dh_strip_nondeterminism --- old/strip-nondeterminism-1.6.1/bin/dh_strip_nondeterminism 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/bin/dh_strip_nondeterminism 2021-05-07 13:35:16.000000000 +0200 @@ -63,9 +63,14 @@ $seen{"$inode.$dev"} = 1; my $normalizer = File::StripNondeterminism::get_normalizer_for_file($_); - if ($normalizer) { - push @nondeterministic_files, [$fn, $normalizer]; + return unless $normalizer; + + unless (-w $_) { + warning("Ignoring unwritable file: $_"); + return; } + + push @nondeterministic_files, [$fn, $normalizer]; } sub handler_name { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/bin/strip-nondeterminism new/strip-nondeterminism-1.12.0/bin/strip-nondeterminism --- old/strip-nondeterminism-1.6.1/bin/strip-nondeterminism 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/bin/strip-nondeterminism 2021-05-07 13:35:16.000000000 +0200 @@ -2,6 +2,7 @@ # # Copyright 2014 Andrew Ayer +# Copyright 2016-2017, 2019 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/changelog new/strip-nondeterminism-1.12.0/debian/changelog --- old/strip-nondeterminism-1.6.1/debian/changelog 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/changelog 2021-05-07 13:35:16.000000000 +0200 @@ -1,3 +1,119 @@ +strip-nondeterminism (1.11.0-1) unstable; urgency=medium + + [ Helmut Grohne ] + * Also normalise PO-Revision-Date in addition to POT-Creation-Date. + (Closes: #981895) + + -- Chris Lamb <la...@debian.org> Fri, 05 Feb 2021 12:04:06 +0000 + +strip-nondeterminism (1.10.0-1) unstable; urgency=medium + + [ Chris Lamb ] + * Ignore unwritable files, printing a warning. (Closes: #980356) + + [ Holger Levsen ] + * Update Standards-Version to 4.5.1, no changes needed. + + -- Chris Lamb <la...@debian.org> Mon, 18 Jan 2021 09:30:40 +0000 + +strip-nondeterminism (1.9.0-1) unstable; urgency=medium + + [ Marc Herbert ] + * Add a warning message under --verbose statement when the Archive::Cpio + package is missing. (MR: reproducible-builds/strip-nondeterminism!6) + + [ Chris Lamb ] + * Don't install the internal handler documentation generated from pod + documents. + * Correct a "situation" typo. + + -- Chris Lamb <la...@debian.org> Sat, 11 Jul 2020 11:38:49 +0100 + +strip-nondeterminism (1.8.1-2) unstable; urgency=medium + + [ Mattia Rizzolo ] + * d/control: + - depend only on libdebhelper-perl, to avoid any chance of a circular + dependency. + - bump debhelper compat level to 13. + + [ Holger Levsen ] + * Install the manpages for all different handlers into the + libfile-stripnondeterminism-perl package. + * Drop build-depends on dpkg-dev. dpkg-dev is part of build-essential and + the version requirement is met in jessie. + + -- Holger Levsen <hol...@debian.org> Sun, 05 Jul 2020 12:00:09 +0200 + +strip-nondeterminism (1.8.1-1) unstable; urgency=medium + + [ Bernhard M. Wiedemann ] + * Fix an off-by-one error when parsing PNG modification times. + (Closes: reproducible-builds/strip-nondeterminism#16) + + [ Chris Lamb ] + * Add deprecation plans to all handlers documenting how/if they could be + disabled/removed, etc. (Re: reproducible-builds/strip-nondeterminism#3) + + -- Chris Lamb <la...@debian.org> Tue, 26 May 2020 11:34:46 +0100 + +strip-nondeterminism (1.8.0-1) unstable; urgency=medium + + * Add support for custom .zip filename filtering and exclude two patterns of + files generated by Maven projects in "fork" mode. + (Closes: reproducible-builds/strip-nondeterminism#13) + + -- Chris Lamb <la...@debian.org> Fri, 17 Apr 2020 11:30:22 +0100 + +strip-nondeterminism (1.7.0-1) unstable; urgency=medium + + [ Chris Lamb ] + * Normalise *.sym files as Java archives. (Closes: #956160) + + [ Holger Levsen ] + * Wrap long lines in changelog entries: 0.025-1, 0.023-1. + + -- Chris Lamb <la...@debian.org> Thu, 09 Apr 2020 00:10:34 +0100 + +strip-nondeterminism (1.6.3-2) unstable; urgency=medium + + [ Debian Janitor ] + * Set upstream metadata fields: Repository, Repository-Browse. + * Set upstream metadata fields: Bug-Database, Bug-Submit. + + [ Holger Levsen ] + * Bump Standards-Version to 4.5.0. + + -- Holger Levsen <hol...@debian.org> Tue, 21 Jan 2020 12:39:36 +0100 + +strip-nondeterminism (1.6.3-1) unstable; urgency=medium + + * Add "file" as a dependency for libfile-stripnondeterminism-perl. + (Closes: #945212) + + -- Chris Lamb <la...@debian.org> Fri, 22 Nov 2019 11:46:57 -0500 + +strip-nondeterminism (1.6.2-1) unstable; urgency=medium + + [ Sven Joachim ] + * Prefer libdebhelper-perl over debhelper to break the circular dependency + between debhelper and dh-strip-nondeterminism. (Closes: #939720) + + [ Chris Lamb ] + * Move away from deprecated ADTTMP variable. + + -- Chris Lamb <la...@debian.org> Fri, 01 Nov 2019 10:55:52 -0700 + +strip-nondeterminism (1.6.1-1) unstable; urgency=medium + + * Drop the t/fixtures/zip/bug_803503.zip test fixtures as they are no longer + compatible with Archive::Zip >= 1.66. Thanks to gregor herrmann for liasing + on this issue with upstream. (Closes: #940973) + * Bump debhelper compat level to 12. + * Bump Standards-Version to 4.4.1. + + -- Chris Lamb <la...@debian.org> Tue, 15 Oct 2019 12:56:45 -0700 + strip-nondeterminism (1.6.0-1) unstable; urgency=medium [ Marc Herbert ] @@ -444,7 +560,8 @@ strip-nondeterminism (0.025-1) unstable; urgency=medium - * Drop all calls to unlink_on_destroy now that we copy the file. (Closes: #836670) + * Drop all calls to unlink_on_destroy now that we copy the file. + (Closes: #836670) - Extend testsuite to ensure no extra files are leftover again. -- Chris Lamb <la...@debian.org> Sun, 04 Sep 2016 17:43:00 +0100 @@ -476,7 +593,8 @@ * Support Android .apk files with the JAR normalizer. * handlers/png.pm: Drop unused Archive::Zip import * Remove hyphen from non-determinism and non-deterministic. - * javaproperties.pm: Match more styles of .properties and loosen filename matching. + * javaproperties.pm: Match more styles of .properties and loosen filename + matching. * Improve tests: - Make fixture runner generic to all normalizer types. - Replace (single) pearregistry test with a fixture. @@ -484,7 +602,8 @@ - Add gzip testcase fixture. - Replace t/javadoc.t with fixture - Replace t/ar.t with a fixture. - - t/javaproperties: move pom.properties and version.properties tests to fixtures + - t/javaproperties: move pom.properties and version.properties tests to + fixtures - t/fixtures.t: move to using subtests - t/fixtures.t: Explicitly test that we can find a normalizer - t/fixtures.t: Don't run normalizer if we didn't find one. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/control new/strip-nondeterminism-1.12.0/debian/control --- old/strip-nondeterminism-1.6.1/debian/control 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/control 2021-05-07 13:35:16.000000000 +0200 @@ -2,8 +2,7 @@ Section: devel Priority: optional Build-Depends: - debhelper-compat (= 12), - dpkg-dev (>= 1.17.14), + debhelper-compat (= 13), Build-Depends-Indep: libarchive-cpio-perl <!nocheck>, libarchive-zip-perl, @@ -17,7 +16,7 @@ Mattia Rizzolo <mat...@debian.org>, Chris Lamb <la...@debian.org>, Rules-Requires-Root: no -Standards-Version: 4.4.1 +Standards-Version: 4.5.1 Homepage: https://reproducible-builds.org/ Vcs-Git: https://salsa.debian.org/reproducible-builds/strip-nondeterminism.git Vcs-Browser: https://salsa.debian.org/reproducible-builds/strip-nondeterminism @@ -26,6 +25,7 @@ Section: perl Architecture: all Depends: + file, libarchive-zip-perl, libsub-override-perl, ${misc:Depends}, @@ -70,7 +70,7 @@ Package: dh-strip-nondeterminism Architecture: all Depends: - debhelper (>= 9.20151004), + libdebhelper-perl, libfile-stripnondeterminism-perl (= ${binary:Version}), ${misc:Depends}, ${perl:Depends}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/copyright new/strip-nondeterminism-1.12.0/debian/copyright --- old/strip-nondeterminism-1.6.1/debian/copyright 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/copyright 2021-05-07 13:35:16.000000000 +0200 @@ -4,7 +4,7 @@ Files: * Copyright: Copyright (C) 2014 Andrew Ayer - Copyright (C) 2017 Chris Lamb + Copyright (C) 2015-2020 Chris Lamb License: GPL-3+ License: GPL-3+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/not-installed new/strip-nondeterminism-1.12.0/debian/not-installed --- old/strip-nondeterminism-1.6.1/debian/not-installed 1970-01-01 01:00:00.000000000 +0100 +++ new/strip-nondeterminism-1.12.0/debian/not-installed 2021-05-07 13:35:16.000000000 +0200 @@ -0,0 +1 @@ +usr/share/man/man3/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/source/options new/strip-nondeterminism-1.12.0/debian/source/options --- old/strip-nondeterminism-1.6.1/debian/source/options 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/source/options 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -single-debian-patch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/source/patch-header new/strip-nondeterminism-1.12.0/debian/source/patch-header --- old/strip-nondeterminism-1.6.1/debian/source/patch-header 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/source/patch-header 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -Subject: Collected Debian patches for strip-nondeterminism -Author: Andrew Ayer <a...@andrewayer.name> - -Since I am also upstream for this package, there will normally not be -any patches to apply to the upstream source. However, occasionally -I'll pull up specific upstream commits prior to making an upstream -release. When this happens, this patch will collect all of those -modifications. - -I use Git to maintain both the upstream source and the Debian -packages, and generating individual patches rather than using git -cherry-pick takes extra work for no gain. Since I'm also upstream, -there's no need to separate the patches for later upstream submission. -Hence, I take this approach with a unified patch when it's necessary. - -For full commit history and separated commits, see the upstream Git -repository. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/tests/testsuite new/strip-nondeterminism-1.12.0/debian/tests/testsuite --- old/strip-nondeterminism-1.6.1/debian/tests/testsuite 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/debian/tests/testsuite 2021-05-07 13:35:16.000000000 +0200 @@ -2,7 +2,7 @@ set -eu -tmp="${AUTOPKGTEST_TMP:-"${ADTTMP:-"$(mktemp -d)"}"}" +tmp="${AUTOPKGTEST_TMP:-$(mktemp -d)}" mkdir -p "$tmp" cp -rv t/ bin/ "$tmp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/debian/upstream/metadata new/strip-nondeterminism-1.12.0/debian/upstream/metadata --- old/strip-nondeterminism-1.6.1/debian/upstream/metadata 1970-01-01 01:00:00.000000000 +0100 +++ new/strip-nondeterminism-1.12.0/debian/upstream/metadata 2021-05-07 13:35:16.000000000 +0200 @@ -0,0 +1,4 @@ +Repository: https://salsa.debian.org/reproducible-builds/strip-nondeterminism.git +Repository-Browse: https://salsa.debian.org/reproducible-builds/strip-nondeterminism +Bug-Database: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/issues +Bug-Submit: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/issues/new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/ar.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/ar.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/ar.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/ar.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # Copyright ?? 2014 J??r??my Bobbio <lu...@debian.org> # Copyright ?? 2014 Niko Tyni <nt...@debian.org> +# Copyright ?? 2016-2019 Chris Lamb <la...@debian.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,6 +28,15 @@ use File::StripNondeterminism; +=head1 DEPRECATION PLAN + +This handler was originally removed in late 2018 as binutils was deemed to be +reproducible (781262, #843811, etc.) However, it was re-introduced in late +2019 via issue #3 as an optional handler in order to support "not just 'older' +toolchains, it's also about 'other' toolchains". + +=cut + sub normalize { my ($file) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/bflt.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/bflt.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/bflt.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/bflt.pm 2021-05-07 13:35:16.000000000 +0200 @@ -33,6 +33,17 @@ use constant MAX_COUNT => 0xFFFFFF; use constant RESERVED_FLAGS => 0xFFFFFFC0; +=head1 DEPRECATION PLAN + +bFLT format is used in uClibc/uCLinux systems. As of 2020-04-30 there are zero +.bflt files being shipped in Debian packages so this handler is a good +candidate to commence deprecation via first making it optional, etc., perhaps +surveying whether any embedded distributions could be relying on this. + +Also see the uimage handler. + +=cut + # From elf2flt flat.h # /* # * To make everything easier to port and manage cross platform diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/cpio.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/cpio.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/cpio.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/cpio.pm 2021-05-07 13:35:16.000000000 +0200 @@ -21,12 +21,28 @@ use File::StripNondeterminism; +=head1 DEPRECATION PLAN + +This was added in mid-2017. As-of 2020-04-30, Debian ships a total of 8 .cpio +files in binary packages and none of these appear to be integral to the working +of those package. + +After consulting with the original (Bernhard, ie. OpenSuse) this handler is a +good candidate to commence deprecation via initially making it optional. + +=cut + sub normalize { my ($file) = @_; # if we cannot load the Cpio module, we just leave the file alone # to not have Archive::Cpio as a hard requirement # for strip-nondeterminism - eval {require Archive::Cpio} or return 0; + if (not eval {require Archive::Cpio}) { + if ($File::StripNondeterminism::verbose) { + print STDERR "Archive::Cpio not found\n"; + } + return 0; + } my $cpio = Archive::Cpio->new; eval {$cpio->read($file)}; return 0 if $@; # not a cpio archive if it throws an error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/gettext.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/gettext.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/gettext.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/gettext.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # # Copyright 2016 Reiner Herrmann <rei...@reiner-h.de> +# Copyright 2016 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -26,6 +27,13 @@ use File::StripNondeterminism; +=head1 DEPRECATION PLAN + +Situation unclear. Whilst #792687 is closed, many Gettext related files are +being normalised based on anecdotal viewings of build logs. + +=cut + sub read_file($) { my $filename = shift; @@ -74,17 +82,18 @@ my $trans_len = unpack($fmt, substr($buf, $trans_to + $i*8)); my $trans_offset = unpack($fmt, substr($buf, $trans_to + $i*8 + 4)); my $trans_msg = substr($buf, $trans_offset, $trans_len); - next unless $trans_msg =~ m/^POT-Creation-Date: (.*)/m; + next unless $trans_msg =~ m/^(POT-Creation-Date|PO-Revision-Date): (.*)/m; - my $pot_date = $1; + my $date_key = $1; + my $date_value = $2; my $time; - eval {$time = Time::Piece->strptime($pot_date, "%Y-%m-%d %H:%M%z");}; + eval {$time = Time::Piece->strptime($date_value, "%Y-%m-%d %H:%M%z");}; next if $@; next if $time <= $norm_time; my $new_time = strftime("%Y-%m-%d %H:%M%z", gmtime($norm_time)); $trans_msg - =~ s/\QPOT-Creation-Date: $pot_date\E/POT-Creation-Date: $new_time/; + =~ s/\Q$date_key: $date_value\E/$date_key: $new_time/; next if length($trans_msg) != $trans_len; $buf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/gzip.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/gzip.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/gzip.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/gzip.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # # Copyright 2014 Andrew Ayer +# Copyright 2016 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -34,6 +35,14 @@ FCOMMENT => 1 << 4, }; +=head1 DEPRECATION PLAN + +Given that so many libraries and utilities generate gzip archives themselves +(rather than delegating to one or two central libraries) it is infeasible to +get this upstreamed everywhere. + +=cut + sub normalize { my ($filename) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/jar.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/jar.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/jar.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/jar.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # # Copyright 2014 Andrew Ayer +# Copyright 2016-2018, 2020 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -29,6 +30,15 @@ use File::StripNondeterminism::handlers::javadoc; use File::Temp; +=head1 DEPRECATION PLAN + +Given that so many libraries and utilities generate .jar archives themselves +(although there is some centralisation) it is infeasible to get this upstreamed +everywhere. However, getting a change into OpenJDK would help a lot in Debian +andwould be the next step here. + +=cut + sub _jar_filename_cmp($$) { my ($a, $b) = @_; # META-INF/ and META-INF/MANIFEST.MF are expected to be the first @@ -41,6 +51,28 @@ return $a cmp $b; } +sub _jar_filename_filter($) { + my @filenames = @_; + + return grep { + # When a Maven project is built with the fork mode enabled for + # the maven-compiler.plugin, two extra files containing non + # reproducible elements are generated in the output directory + # and subsequently packaged in the jar. + # + # Remove executable script that could be run to recompile the + # project. It captures the build path. + $_ = undef if $_ eq "javac.sh"; + + # Contains the compiler arguments. The file name uses a random + # value. + $_ = undef if $_ =~ m/^org\.codehaus\.plexus\.compiler\.javac\.JavacCompiler\d+arguments$/; + + # Allow all other files + $_; + } @filenames; +} + sub _jar_normalize_manifest($) { my ($filename) = @_; @@ -126,6 +158,7 @@ $jar_filename, archive_filter => \&_jar_archive_filter, filename_cmp => \&_jar_filename_cmp, + filename_filter => \&_jar_filename_filter, member_normalizer => \&_jar_normalize_member ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/javadoc.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/javadoc.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/javadoc.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/javadoc.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,6 +1,6 @@ # # Copyright 2014 Andrew Ayer -# Copyright 2015 Chris Lamb <la...@debian.org> +# Copyright 2015-2016 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -28,6 +28,12 @@ use File::Basename; use POSIX qw(strftime); +=head1 DEPRECATION PLAN + +This could almost-certainly be changed in OpenJDK itself and then removed here. + +=cut + sub is_javadoc_file($) { my ($filename) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/jmod.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/jmod.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/jmod.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/jmod.pm 2021-05-07 13:35:16.000000000 +0200 @@ -26,6 +26,13 @@ use File::Temp; use File::Basename; +=head1 DEPRECATION PLAN + +This could likely be changed in OpenJDK itself and then removed here; it does +not appear that many other utilities generate (or even ship) .jmod files. + +=cut + sub is_jmod_file($) { # Only recent versions of file(1) can detect Jmod file so we perform a # manual test. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/png.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/png.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/png.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/png.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,5 @@ # -# Copyright 2015 Chris Lamb <la...@debian.org> +# Copyright 2016-2017, 2019 Chris Lamb <la...@debian.org> # Copyright 2015 Andrew Ayer <a...@andrewayer.name> # # This file is part of strip-nondeterminism. @@ -31,6 +31,13 @@ use List::Util qw/min/; use Time::Local qw/timegm/; +=head1 DEPRECATION PLAN + +Situation is not promising as so many libraries can generate or convert .png +files. + +=cut + sub crc($) { my ($data) = @_; return Archive::Zip::computeCRC32($data); @@ -51,7 +58,7 @@ sub parse_time_chunk($) { my ($data) = @_; my ($year, $mon, $mday, $hour, $min, $sec) = unpack('nCCCCC', $data); - return timegm($sec, $min, $hour, $mday, $mon, $year); + return timegm($sec, $min, $hour, $mday, $mon - 1, $year); } sub text_chunk($$) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/pyzip.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/pyzip.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/pyzip.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/pyzip.pm 2021-05-07 13:35:16.000000000 +0200 @@ -0,0 +1,106 @@ +# +# Copyright 2021 Chris Lamb <la...@debian.org> +# +# This file is part of strip-nondeterminism. +# +# strip-nondeterminism is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# strip-nondeterminism is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>. +# +package File::StripNondeterminism::handlers::pyzip; + +use strict; +use warnings; + +use File::StripNondeterminism; +use File::StripNondeterminism::Common qw(copy_data); +use File::Basename; +use File::StripNondeterminism::handlers::zip; +use File::Temp; +use Fcntl q/SEEK_SET/; + +=head1 ABOUT + +Python supports running .zip'd .py files: + + $ cat __main__.py + #!/usr/bin/python3 + print("Hello World") + $ zip pyzip.zip __main__.py + $ head -1 __main__.py | cat - pyzip.zip > pyzip + $ chmod a+x pyzip + +They require special handling to not mangle the shebang. + +=head1 DEPRECATION PLAN + +Unclear, as many tools can, after all, generate these .zip files. + +=cut + +sub is_pyzip_file { + my ($filename) = @_; + + my $fh; + my $str; + + return + open($fh, '<', $filename) + && read($fh, $str, 32) + && $str =~ /^#!.*\n\x{50}\x{4b}\x{03}\x{04}/s; +} + +sub normalize { + my ($filename) = @_; + + my $buf; + + # Create a .zip file without the shebang + my $stripped = File::Temp->new(DIR => dirname($filename)); + open my $fh, '<', $filename; + + # Save the shebang for later + my $shebang = <$fh>; + + # Copy through the rest of the file + while (read($fh, $buf, 4096) // die "$filename: read failed: $!") { + print $stripped $buf; + } + $stripped->close; + close $fh; + + # Normalize the stripped version + my $modified = File::StripNondeterminism::handlers::zip::normalize( + $stripped->filename + ); + + # If we didnt change anything, no need to mess around with a new file + return 0 if not $modified; + + # Create a file with the existing shebang + my $pyzip = File::Temp->new(DIR => dirname($filename)); + print $pyzip $shebang; + open $fh, '<', $stripped->filename; + while (read($fh, $buf, 4096)) { + print $pyzip $buf; + } + close $fh; + $pyzip->close; + + # Copy the result, preserving the attributes of the original + copy_data($pyzip->filename, $filename) + or die "$filename: unable to overwrite: copy_data: $!"; + + return 1; +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/uimage.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/uimage.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/uimage.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/uimage.pm 2021-05-07 13:35:16.000000000 +0200 @@ -25,6 +25,17 @@ use File::StripNondeterminism; use Fcntl q/SEEK_SET/; +=head1 DEPRECATION PLAN + +As of 2020-04-30 there are zero .uimage files being shipped in Debian packages +so this handler is a good candidate to commence deprecation via first making it +optional, etc., perhaps surveying whether any embedded distributions could be +relying on this. + +Also see the uimage handler. + +=cut + # /* # * Legacy format image header, # * all data in network byte order (aka natural aka bigendian). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/zip.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/zip.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism/handlers/zip.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism/handlers/zip.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # # Copyright 2014 Andrew Ayer +# Copyright 2016-2020 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -26,6 +27,15 @@ use Archive::Zip qw/:CONSTANTS :ERROR_CODES/; use Sub::Override; +=head1 DEPRECATION PLANS + +Given that so many libraries and utilities generate ZIP archives themselves +(rather than delegating to one or two central libraries) it is infeasible to +get this upstreamed everywhere. There are also countless formats that generate +ZIP files under different names (notably Jar archives and its many variants). + +=cut + # A magic number from Archive::Zip for the earliest timestamp that # can be represented by a Zip file. From the Archive::Zip source: # "Note, this isn't exactly UTC 1980, it's 1980 + 12 hours and 1 @@ -200,6 +210,16 @@ $canonical_time = SAFE_EPOCH if not defined $canonical_time or $canonical_time < SAFE_EPOCH; my @filenames = sort $filename_cmp $zip->memberNames(); + if (exists($options{filename_filter})) { + @filenames = $options{filename_filter}->(@filenames); + # Remove any members deleted by the custom filter + my %seen = map { $_ => 1 } @filenames; + for my $filename ($zip->memberNames()) { + next if $seen{$filename}; + print STDERR "Removing $filename from $zip_filename\n"; + $zip->removeMember($filename); + } + } for my $filename (@filenames) { my $member = $zip->removeMember($filename); if ($member->isEncrypted()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism.pm new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism.pm --- old/strip-nondeterminism-1.6.1/lib/File/StripNondeterminism.pm 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/lib/File/StripNondeterminism.pm 2021-05-07 13:35:16.000000000 +0200 @@ -1,5 +1,6 @@ # # Copyright 2014 Andrew Ayer +# Copyright 2015-2020 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. # @@ -25,7 +26,7 @@ our($VERSION, $canonical_time, $clamp_time, $verbose); -$VERSION = '1.6.1'; # <https://semver.org/> +$VERSION = '1.12.0'; # <https://semver.org/> sub init() { $ENV{'TZ'} = 'UTC'; @@ -64,7 +65,7 @@ return _handler('gzip'); } # jar - if (m/\.(jar|war|hpi|apk)$/ + if (m/\.(jar|war|hpi|apk|sym)$/ && _get_file_type($_) =~ m/(Java|Zip) archive data/) { return _handler('jar'); } @@ -108,6 +109,14 @@ && _get_file_type($_) =~ m/Zip archive data|EPUB document/) { return _handler('zip'); } + + # pyzip - check last due to call to file(1) + if (_get_file_type($_) =~ m/python3 script executable \(binary data\)/) { + my $handler = _handler('pyzip'); + return $handler + if File::StripNondeterminism::handlers::pyzip::is_pyzip_file($_); + } + return undef; } @@ -123,6 +132,7 @@ jmod => 1, uimage => 1, png => 1, + pyzip => 1, javaproperties => 1, zip => 1, ); Binary files old/strip-nondeterminism-1.6.1/t/fixtures/pyzip/pyzip.in and new/strip-nondeterminism-1.12.0/t/fixtures/pyzip/pyzip.in differ Binary files old/strip-nondeterminism-1.6.1/t/fixtures/pyzip/pyzip.out and new/strip-nondeterminism-1.12.0/t/fixtures/pyzip/pyzip.out differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strip-nondeterminism-1.6.1/t/fixtures.t new/strip-nondeterminism-1.12.0/t/fixtures.t --- old/strip-nondeterminism-1.6.1/t/fixtures.t 2019-10-15 21:56:27.000000000 +0200 +++ new/strip-nondeterminism-1.12.0/t/fixtures.t 2021-05-07 13:35:16.000000000 +0200 @@ -1,7 +1,7 @@ #!perl # -# Copyright 2016 Chris Lamb <la...@debian.org> +# Copyright 2016-2017, 2019 Chris Lamb <la...@debian.org> # # This file is part of strip-nondeterminism. #