[dpkg] 18/200: build: Change DPKG_BUILD_RELEASE_DATE to use perl instead of date(1)

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit 2028cb7ac2374e46242a0878b33519589be23fb7
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Nov 9 01:28:07 2016 +0100

    build: Change DPKG_BUILD_RELEASE_DATE to use perl instead of date(1)
    
    As the former is more portable, and we were using GNUisms.
---
 debian/changelog | 2 ++
 m4/dpkg-build.m4 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 0958302..1143be4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ dpkg (1.18.14) UNRELEASED; urgency=medium
     - Do not consider the compressor libraries available in configure if the
       headers are not usable.
     - Fix DPKG_BUILD_RELEASE_DATE to require DPKG_PROG_PERL, as it uses perl.
+    - Change DPKG_BUILD_RELEASE_DATE to use perl instead of date(1) to
+      format the timestamp, as the former is more portable.
 
   [ Updated man pages translations ]
   * German (Helge Kreutzmann).
diff --git a/m4/dpkg-build.m4 b/m4/dpkg-build.m4
index 771e6cf..1ea3e4b 100644
--- a/m4/dpkg-build.m4
+++ b/m4/dpkg-build.m4
@@ -15,7 +15,7 @@ AC_DEFUN([DPKG_BUILD_SHARED_LIBS], [
 AC_DEFUN([DPKG_BUILD_RELEASE_DATE], [
   AC_REQUIRE([DPKG_PROG_PERL])
   TIMESTAMP=$(PERL=$PERL $srcdir/run-script scripts/dpkg-parsechangelog.pl -l$srcdir/debian/changelog -STimestamp)
-  PACKAGE_RELEASE_DATE=$(date --utc --date="@$TIMESTAMP" +%Y-%m-%d)
+  PACKAGE_RELEASE_DATE=$($PERL -MPOSIX -e "print POSIX::strftime('%Y-%m-%d', gmtime('$TIMESTAMP'));")
   AC_SUBST([PACKAGE_RELEASE_DATE])
 ])# DPKG_BUILD_RELEASE_DATE
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list