summaryrefslogtreecommitdiff
path: root/scripts/dpkg-genbuildinfo.pl
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-11-14 00:51:06 +0100
committerGuillem Jover <guillem@debian.org>2016-11-16 03:20:13 +0100
commit8ff4522cf0f08659dee954ac2c6256c607b045df (patch)
tree9a9df2472d4e09511845ccd7420d083ff14c7b64 /scripts/dpkg-genbuildinfo.pl
parentda73ac074ed8b5e9aa20684b9da5c8e64469adb1 (diff)
downloaddpkg-8ff4522cf0f08659dee954ac2c6256c607b045df.tar.gz
dpkg-genbuildinfo: Add Build-Date field
This records the time the build happened. This might be useful when there is a need to track down problems caused by external time-based events not visible from inside the build system. Things like hardware, software deployment or other such failures.
Diffstat (limited to 'scripts/dpkg-genbuildinfo.pl')
-rwxr-xr-xscripts/dpkg-genbuildinfo.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
index ea0f4c5ef..32c7e7344 100755
--- a/scripts/dpkg-genbuildinfo.pl
+++ b/scripts/dpkg-genbuildinfo.pl
@@ -27,7 +27,7 @@ use warnings;
use Cwd;
use File::Basename;
-use POSIX qw(:fcntl_h strftime);
+use POSIX qw(:fcntl_h :locale_h strftime);
use Dpkg ();
use Dpkg::Gettext;
@@ -69,6 +69,16 @@ my $checksums = Dpkg::Checksums->new();
my %archadded;
my @archvalues;
+sub get_build_date {
+ my $date;
+
+ setlocale(LC_TIME, 'C');
+ $date = strftime('%a, %d %b %Y %T %z', localtime);
+ setlocale(LC_TIME, '');
+
+ return $date;
+}
+
# There is almost the same function in dpkg-checkbuilddeps, they probably
# should be factored out.
sub parse_status {
@@ -394,8 +404,8 @@ if ($changelog->{'Binary-Only'}) {
}
$fields->{'Build-Origin'} = get_current_vendor();
-
$fields->{'Build-Architecture'} = get_build_arch();
+$fields->{'Build-Date'} = get_build_date();
my $cwd = cwd();
if ($always_include_path) {