[devscripts] 02/04: bts: 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 b50e2a506b95822b05d8118b89095da668cab090
Author: Louis Bettens <louis at bettens.info>
Date:   Sat Nov 30 20:52:49 2013 +0100

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

diff --git a/scripts/bts.pl b/scripts/bts.pl
index ba4929f..80003df 100755
--- a/scripts/bts.pl
+++ b/scripts/bts.pl
@@ -61,6 +61,9 @@ use Getopt::Long;
 use Encode;
 
 use Scalar::Util qw(looks_like_number);
+use POSIX qw(locale_h strftime);
+
+setlocale(LC_TIME, "C"); # so that strftime is locale independent
 
 # Funny UTF-8 warning messages from HTML::Parse should be ignorable (#292671)
 $SIG{'__WARN__'} = sub { warn $_[0] unless $_[0] =~ /^Parsing of undecoded UTF-8 will give garbage when decoding entities/; };
@@ -2521,8 +2524,7 @@ sub send_mail {
     my $fromaddress = $fromaddresses[0];
     # Message-ID algorithm from git-send-email
     my $msgid = sprintf("%s-%s", time(), int(rand(4200)))."-bts-$fromaddress";
-    my $date = `date -R`;
-    chomp $date;
+    my $date = strftime "%a, %d %b %Y %T %z", localtime;
 
     my $message = fold_from_header("From: $from") . "\n";
     $message   .= "To: $to\n" if length $to;

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