Browse Source

build: Change DPKG_BUILD_RELEASE_DATE to use perl instead of date(1)

As the former is more portable, and we were using GNUisms.
Guillem Jover 7 years ago
parent
commit
2028cb7ac2
2 changed files with 3 additions and 1 deletions
  1. 2 0
      debian/changelog
  2. 1 1
      m4/dpkg-build.m4

+ 2 - 0
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).

+ 1 - 1
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