]> git.sthu.org Git - pgp-tools.git/commitdiff
* gpg-mailkeys:
authorthijs <thijs@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 2 Aug 2007 12:01:03 +0000 (12:01 +0000)
committerthijs <thijs@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 2 Aug 2007 12:01:03 +0000 (12:01 +0000)
  + Resolve bashisms in gpg-mailkeys.

git-svn-id: svn://svn.debian.org/pgp-tools/trunk@343 b513b33f-fedd-0310-b452-c3deb5f4c849

debian/changelog
gpg-mailkeys/gpg-mailkeys

index cfe10cf534ce457d568cc09514e4cba43be60237..854e4ce5b2c7360cfd3f7bf97fe3eee658d39d9e 100644 (file)
@@ -14,9 +14,11 @@ signing-party (0.4.11-2) UNRELEASED; urgency=low
   * caff:
     + Add filename to one of the MIME parts as its absence breaks certain virus
       scanners.
+  * gpg-mailkeys:
+    + Resolve bashisms in gpg-mailkeys.
   * Cleanup package dependencies.
 
- -- Thijs Kinkhorst <thijs@debian.org>  Thu,  2 Aug 2007 12:12:02 +0200
+ -- Thijs Kinkhorst <thijs@debian.org>  Thu, 02 Aug 2007 14:01:21 +0200
 
 signing-party (0.4.11-1) unstable; urgency=low
 
index d9ca25968dff3d540d237b40f0d23704ce1ddec2..f274aa5296f8442252bb57bd3c82aa8d8af91191 100755 (executable)
@@ -9,8 +9,8 @@ set -e
 VERSION='$Rev$'
 
 if [ -z "$*" ]; then
-       echo "Send people their newly signed GPG key by mail."
-       echo "Usage: $0 keyid ..."
+       printf "Send people their newly signed GPG key by mail.\n"
+       printf "Usage: $0 keyid ...\n"
        exit 1
 fi
 
@@ -38,20 +38,21 @@ fi
 FAILKEYS=
 
 while [ -n "$1" ]; do
-       echo -n "[$1] "
+       printf "[$1] "
        TEMPFILE=`mktemp -t gpg2mail.XXXXXX`
        ADDR=`gpg --with-colons --fixed-list-mode --list-key $1 | sed -e 's/^uid:[^re][^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:<]*<[^:>]*>\):.*/@@uid@@ \1/' -e '/^@@uid@@ /!d' -e 's/([^)]*)//g' -e 's/  */ /g' -e 's/^@@uid@@ //' | head -1`
        if [ -z "$ADDR" ]; then
-               echo "(no usable user ids)"
+               printf "(no usable user ids)\n"
                FAILKEYS="$FAILKEYS:$1"
                shift 1
                continue
        fi
-       BOUNDARY="ksp-$$-boundary-$RANDOM"
+       NANOTIME=`date +%s-%N`
+       BOUNDARY="ksp-$$-boundary-$NANOTIME"
        
-       echo -n "$ADDR:"
+       printf "$ADDR:"
        if [ $FROM ]; then
-               echo >$TEMPFILE "From: $NAME <$FROM>"
+               printf >$TEMPFILE "From: $NAME <$FROM>\n"
        fi
 cat << EOM >> $TEMPFILE
 To: $ADDR
@@ -75,7 +76,7 @@ $TEXT
 EOM
 
 if [ -f ~/.signature ]; 
-       then echo "--=20" >> $TEMPFILE 
+       then printf "--=20\n" >> $TEMPFILE 
        cat ~/.signature >> $TEMPFILE
 fi
 
@@ -89,15 +90,14 @@ Content-Disposition: attachment; filename="$1.asc"
 
 --$BOUNDARY--
 EOM
-       echo -n " sending"
+       printf " sending"
        /usr/sbin/sendmail -ti <$TEMPFILE
        rm $TEMPFILE
-       echo " done."
+       printf " done.\n"
        shift 1
 done
 
 if [ -n "$FAILKEYS" ]; then
-       echo
-       echo "Note: The following keys could not be sent:"
-       echo "$FAILKEYS" | tr ':' '\n' | sed -e '/^ *$/d' -e 's/^/  /'
+       printf "\nNote: The following keys could not be sent:\n"
+       printf "$FAILKEYS\n" | tr ':' '\n' | sed -e '/^ *$/d' -e 's/^/  /'
 fi