From ee8d01d64e8832304256de53db07228e2be67f6a Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Mon, 17 Apr 2017 19:35:21 +0200 Subject: [PATCH] Fix mhsign for gpg2: Expiry date format Gnupg2 uses --fixed-list-mode by default for --with-colons. Gnupg1 needs this option explicitly to generate the same output format (timestamps) for expiry dates. Thanks to Jan Unterbrink for reporting the bug. --- uip/mhsign.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/uip/mhsign.sh b/uip/mhsign.sh index 9d6c747..39a3f69 100755 --- a/uip/mhsign.sh +++ b/uip/mhsign.sh @@ -22,10 +22,11 @@ if [ -z "$userid" ] ; then userid="`mhparam pgpkey`" fi if [ -z "$userid" ] ; then - userid="`gpg --list-secret-keys --with-colons 2>/dev/null | + userid="`gpg --list-secret-keys --with-colons --fixed-list-mode \ + 2>/dev/null | grep '^sec' | sort -t: -k3,3nr -k 6,6nr | awk -F: ' - $7=="" || $7 > "'"\`date +%Y-%m-%d\`"'" { + $7=="" || $7 > "'"\`date +%s\`"'" { print $5; exit; } '`" -- 1.7.10.4