$OpenBSD: patch-lib_keyringer_functions,v 1.3 2018/06/03 15:39:24 jca Exp $

- no mount -l/tmpfs in OpenBSD
- use gpg2, upstream seems to rely on gpg being gpg2

Index: lib/keyringer/functions
--- lib/keyringer/functions.orig
+++ lib/keyringer/functions
@@ -123,7 +123,7 @@ function keyringer_check_tmp {
 
   # Ramdisk check
   mount="`df "$path" | sed -n '$p' | awk '{ print $NF }'`"
-  mount -l -t tmpfs | awk '{ print $3 }' | grep -q -e "^$mount$"
+  mount -t mfs | awk '{ print $3 }' | grep -q -e "^$mount$"
 }
 
 # Setup a temporary file
@@ -314,9 +314,9 @@ function keyringer_set_env {
   fi
 
   if [ ! -z "$KEYID" ]; then
-    GPG="gpg --quiet -u $KEYID"
+    GPG="gpg2 --quiet -u $KEYID"
   else
-    GPG="gpg --quiet"
+    GPG="gpg2 --quiet"
   fi
 
   # Check keyring config version
@@ -601,7 +601,7 @@ function keyringer_recv_keys {
   local recipient="$1"
 
   echo "Trying to receive missing key $recipient..."
-  gpg --batch --recv-keys "$recipient"
+  gpg2 --batch --recv-keys "$recipient"
 }
 
 # Refresh keys from keyserver
@@ -611,7 +611,7 @@ function keyringer_refresh_keys {
   local recipient="$1"
 
   echo "Trying to refresh key $recipient..."
-  gpg --batch --recv-keys "$recipient"
+  gpg2 --batch --recv-keys "$recipient"
 }
 
 # Check recipient size
@@ -698,7 +698,7 @@ function keyringer_check_recipients {
 function keyringer_check_recipient_key {
   local recipient="$1"
 
-  gpg --list-key "$recipient" &> /dev/null
+  gpg2 --list-key "$recipient" &> /dev/null
   if [ "$?" != "0" ]; then
     if [ "$BASENAME" == "check" ]; then
       refresh="no"
@@ -727,7 +727,7 @@ function keyringer_check_expiration {
   seconds="`date +%s`"
 
   # Check the main key
-  expiry="`gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^pub | head -n1 | cut -d : -f 7`"
+  expiry="`gpg2 --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^pub | head -n1 | cut -d : -f 7`"
 
   # TODO: Time to expire can be configured via repository options.
   ahead="$((86400 * 30 + $seconds))"
@@ -754,7 +754,7 @@ function keyringer_check_expiration {
 
   # Check the subkeys
   local subkey=""
-  for subkey in $(gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^sub); do
+  for subkey in $(gpg2 --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^sub); do
     local expiry=$(cut -d : -f 7 <<< "$subkey")
 
     if [[ -z "$expiry" ]]; then
@@ -851,7 +851,7 @@ function keyringer_create_new_recipients {
       recipient="`grep -e "^default-key" ~/.gnupg/gpg.conf | cut -d ' ' -f 2`"
 
       if [ ! -z "$recipient" ]; then
-        key="`gpg --fingerprint --with-colons $recipient 2> /dev/null`"
+        key="`gpg2 --fingerprint --with-colons $recipient 2> /dev/null`"
 
         if [ "$?" == "0" ]; then
           fpr="`echo "$key" | grep -e '^fpr:' | head -1 | cut -d : -f 10`"
