Skip to content
Commits on Source (5)
image: debian:unstable
test:
stage: test
except:
- debian
before_script:
- apt-get -q update
- mount -o remount,rw /dev
- env DEBIAN_FRONTEND=noninteractive apt-get -q -y install --no-install-recommends aspcud apt-cudf git
- git checkout debian
- env DEBIAN_FRONTEND=noninteractive apt-get -q -y --solver aspcud -o APT::Solver::Strict-Pinning=0 -o Debug::pkgProblemResolver=yes build-dep .
- git checkout -
script:
- perl Makefile.PL
- make test TEST_VERBOSE=1
......@@ -17,7 +17,7 @@ WriteMakefile(
'Archive::Cpio' => 0, # required to pass tests
'Archive::Zip' => 0,
'Getopt::Long' => 0,
'Monkey::Patch' => 0,
'Sub::Override' => 0,
},
LICENSE => "gpl",
dist => { COMPRESS => 'gzip -9nf', SUFFIX => 'gz', },
......
strip-nondeterminism (1.2.1-1) unstable; urgency=medium
[ Niko Tyni ]
* Use Sub::Override for Archive::Zip workarounds instead of Monkey::Patch
(see reproducible-builds/strip-nondeterminism#8 for more information).
(Closes: #931730)
[ Chris Lamb ]
* Add a ".gitlab-ci.yml" to automatically run the testsuite on
salsa.debian.org.
-- Chris Lamb <lamby@debian.org> Mon, 15 Jul 2019 10:31:13 -0300
strip-nondeterminism (1.2.0-2) unstable; urgency=medium
* Bump standards version to 4.4.0, no changes needed.
......
......@@ -25,7 +25,7 @@ use POSIX qw(tzset);
our($VERSION, $canonical_time, $clamp_time);
$VERSION = '1.2.0'; # <https://semver.org/>
$VERSION = '1.2.1'; # <https://semver.org/>
sub init() {
$ENV{'TZ'} = 'UTC';
......
......@@ -24,7 +24,7 @@ use warnings;
use File::Temp;
use File::StripNondeterminism;
use Archive::Zip qw/:CONSTANTS :ERROR_CODES/;
use Monkey::Patch qw/patch_class/;
use Sub::Override;
# A magic number from Archive::Zip for the earliest timestamp that
# can be represented by a Zip file. From the Archive::Zip source:
......@@ -231,21 +231,24 @@ sub normalize {
# stored value of localExtraField (!) and reload it again from the existing
# file handle in/around rewindData.
#
# We therefore monkey-patch the accessor methods of the Member class to
# We therefore override the accessor methods of the Member class to
# ensure that normalised values are used in this final save.
#
# <https://salsa.debian.org/reproducible-builds/strip-nondeterminism/issues/4>
my @patches = map {
patch_class('Archive::Zip::Member', $_, sub {
my $fn = shift;
my $result = $fn->(@_);
my @overrides = map {
my $full_name = "Archive::Zip::Member::$_";
my $orig_sub = \&$full_name;
Sub::Override->new(
$full_name => sub {
my $result = $orig_sub->(@_);
return defined($result) ?
normalize_extra_fields($canonical_time, $result) : $result;
});
}
);
} qw(cdExtraField localExtraField);
return 0 unless $zip->overwrite() == AZ_OK;
undef @patches; # Remove our monkey patches
$_->restore for @overrides;
chmod($old_perms, $zip_filename);
return 1;
}
......