canonicalize prompting to prompt if MONKEYSPHERE_PROMPT != 'false'
[monkeysphere.git] / src / share / common
index de97ef76085a7fe52b33391d32562329f395fc99..97f001a1075786066911f7e11b23ac00688f6ee6 100644 (file)
@@ -281,7 +281,7 @@ get_gpg_expiration() {
 
     keyExpire="$1"
 
-    if [ -z "$keyExpire" -a "$PROMPT" = 'true' ]; then
+    if [ -z "$keyExpire" -a "$PROMPT" != 'false' ]; then
        cat >&2 <<EOF
 Please specify how long the key should be valid.
          0 = key does not expire
@@ -762,7 +762,7 @@ process_user_id() {
 }
 
 # output all valid keys for specified user ID literal
-keys_from_userid() {
+keys_for_userid() {
     local userID
     local noKey=
     local nKeys
@@ -1177,9 +1177,11 @@ process_authorized_user_ids() {
 # fingerprints, one per line:
 list_primary_fingerprints() {
     local fake=$(msmktempdir)
+    trap "rm -rf $fake" EXIT
     GNUPGHOME="$fake" gpg --no-tty --quiet --import
     GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \
        awk -F: '/^fpr:/{ print $10 }'
+    trap - EXIT
     rm -rf "$fake"
 }