mhsign: Bugfix: Don't ignore MMHPGPKEY and the Pgpkey profile entry.
authormarkus schnalke <meillo@marmaro.de>
Tue, 25 Nov 2014 06:01:31 +0000 (07:01 +0100)
committermarkus schnalke <meillo@marmaro.de>
Tue, 25 Nov 2014 06:09:37 +0000 (07:09 +0100)
Bugreport and patch by Philipp Takacs <philipp@bureaucracy.de>. Thanks.
Additionally: use `test -z'.

uip/mhsign.sh

index e6f54b3..9a06053 100755 (executable)
@@ -18,12 +18,14 @@ function=sign
 
 # find out the signing key
 userid="$MMHPGPKEY"
-if [ "x$userid" = "x" ] ; then
+if [ -z "$userid" ] ; then
        userid="`mhparam pgpkey`"
 fi
-userid="`gpg --list-secret-keys --with-colons 2>/dev/null |
-               sed -n '/^sec/{p;q;}' | cut -d: -f5`"
-if [ "x$userid" = x ] ; then
+if [ -z "$userid" ] ; then
+       userid="`gpg --list-secret-keys --with-colons 2>/dev/null |
+                       sed -n '/^sec/{p;q;}' | cut -d: -f5`"
+fi
+if [ -z "$userid" ] ; then
        echo "No secret key found" >&2
        exit 1
 fi