diff options
author | Guillem Jover <guillem@debian.org> | 2016-08-20 18:47:41 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-10-30 04:45:18 +0100 |
commit | 6c32c76ba20b641e14fc1533cecb3ca674850a90 (patch) | |
tree | af9414f40be14ba3bedf4f557aa75bb8676f5402 /scripts/dpkg-source.pl | |
parent | 66a12fb8b22f13bb89dd59bf13db2fb939d3de87 (diff) | |
download | dpkg-6c32c76ba20b641e14fc1533cecb3ca674850a90.tar.gz |
dpkg-source: Make the program reproducible when run standalone
Running dpkg-source directly is more common than running dpkg-deb
directly. In addition dpkg-source needs to parse the changelog anyway,
something that dpkg-deb does not need nor, in any case, has an easy way
to do currently.
So let's make it generate reproducible source by default.
Diffstat (limited to 'scripts/dpkg-source.pl')
-rwxr-xr-x | scripts/dpkg-source.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 40a70fd14..bf2c5bec8 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -236,6 +236,9 @@ if ($options{opmode} =~ /^(build|print-format|(before|after)-build|commit)$/) { my $changelog = changelog_parse(%ch_options); my $control = Dpkg::Control::Info->new($controlfile); + # <https://reproducible-builds.org/specs/source-date-epoch/> + $ENV{SOURCE_DATE_EPOCH} ||= $changelog->{timestamp}; + my $srcpkg = Dpkg::Source::Package->new(options => \%options); my $fields = $srcpkg->{fields}; |