[pkg-perl-tools] 02/03: patchedit: always set Last-Update to the mtime of the patch file

gregor herrmann gregoa at debian.org
Tue Jun 28 19:46:09 UTC 2016


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

gregoa pushed a commit to branch master
in repository pkg-perl-tools.

commit 9ce55085557d514f783fcd718133b38eade31e0d
Author: gregor herrmann <gregoa at debian.org>
Date:   Tue Jun 28 21:43:10 2016 +0200

    patchedit: always set Last-Update to the mtime of the patch file
    
    when in fix mode.
---
 bin/patchedit | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/patchedit b/bin/patchedit
index 494f83f..d309e14 100755
--- a/bin/patchedit
+++ b/bin/patchedit
@@ -192,8 +192,10 @@ sub fix_patch {
         $patch_content->{'Reviewed-by'} ||= "$author\n"
             unless $patch_content->{'Reviewed-by'}
             || $patch_content->{'Acked-by'};
+        # stat[9] = mtime
         $patch_content->{'Last-Update'}
-            ||= DateTime->now->set_time_zone('local')->strftime('%Y-%m-%d')
+            = DateTime->from_epoch( epoch => ( stat($patch) )[9] )
+            ->set_time_zone('local')->strftime('%Y-%m-%d')
             . "\n";
         $patch_content->{'Applied-Upstream'} ||= "*** FIXME ***\n";
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list