Correctly handle both old and new signature timestamps from GPG
authorJacob Bachmeyer <jcb@gnu.org>
Sun, 13 Feb 2022 04:33:22 +0000 (22:33 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Sun, 13 Feb 2022 04:33:22 +0000 (22:33 -0600)
upload-ftp-v1.2.pl

index c2749919f374c209259789a0c75db50abdad2faa..2f34a868cccf8e7b36bc7037b30f009a5c317dbf 100755 (executable)
@@ -979,6 +979,10 @@ sub read_directive_file {
 
     ftp_syslog('debug', "($log_style) DEBUG: Signature made $1") if DEBUG;
 
+    # Some versions of GPG also mention the key used to make the signature
+    # on this line, while others do not.  The testing mock does.
+    $timestr =~ s/ using .*//; # trim to only timestamp
+
     # If the time/date string starts with a weekday (e.g. "Wed Apr 28 16:40:03 2004 EDT"),
     # chop off the weekday - Date::Manip doesn't like it
     $timestr =~ s/^[a-z]+? ([a-z]+)/$1/i;