From: markus schnalke Date: Mon, 17 Apr 2017 17:35:21 +0000 (+0200) Subject: Fix mhsign for gpg2: Expiry date format X-Git-Tag: mmh-0.4~41 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=ee8d01d64e8832304256de53db07228e2be67f6a;hp=bd7e2d5cc610c87f2f8c2df507bb7eda86cce90e 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. --- 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; } '`"