[devscripts] 01/04: debchange: replace call to date -R with strftime()

James McCoy jamessan at debian.org
Sat Dec 7 03:13:08 UTC 2013


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 17e98375611abb6011959b17f2a15a804a92f1ec
Author: Louis Bettens <louis at bettens.info>
Date:   Sat Nov 30 20:12:00 2013 +0100

    debchange: replace call to date -R with strftime()
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 scripts/debchange.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index 82875d6..3ec288d 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -43,6 +43,9 @@ use Dpkg::Compression;
 use Dpkg::Vendor qw(get_current_vendor);
 use lib '/usr/share/devscripts';
 use Devscripts::Debbugs;
+use POSIX qw(locale_h strftime);
+
+setlocale(LC_TIME, "C"); # so that strftime is locale independent
 
 # Predeclare functions
 sub fatal($);
@@ -989,8 +992,7 @@ if (@ARGV and ! $TEXT) {
 }
 
 # Get the date
-my $date_cmd = ($opt_tz ? "TZ=$opt_tz " : "") . "date -R";
-chomp(my $DATE=`$date_cmd`);
+my $DATE=strftime "%a, %d %b %Y %T %z", localtime();
 
 if ($opt_news && !$opt_i && !$opt_a) {
     if ($VERSION eq $changelog{'Version'} && !$opt_v && !$opt_l) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list