[Pgp-tools-commit] r343 - in trunk: debian gpg-mailkeys

thijs at alioth.debian.org thijs at alioth.debian.org
Thu Aug 2 12:01:03 UTC 2007


Author: thijs
Date: 2007-08-02 12:01:03 +0000 (Thu, 02 Aug 2007)
New Revision: 343

Modified:
   trunk/debian/changelog
   trunk/gpg-mailkeys/gpg-mailkeys
Log:
* gpg-mailkeys:
  + Resolve bashisms in gpg-mailkeys.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-08-02 10:14:16 UTC (rev 342)
+++ trunk/debian/changelog	2007-08-02 12:01:03 UTC (rev 343)
@@ -14,9 +14,11 @@
   * 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 at debian.org>  Thu,  2 Aug 2007 12:12:02 +0200
+ -- Thijs Kinkhorst <thijs at debian.org>  Thu, 02 Aug 2007 14:01:21 +0200
 
 signing-party (0.4.11-1) unstable; urgency=low
 

Modified: trunk/gpg-mailkeys/gpg-mailkeys
===================================================================
--- trunk/gpg-mailkeys/gpg-mailkeys	2007-08-02 10:14:16 UTC (rev 342)
+++ trunk/gpg-mailkeys/gpg-mailkeys	2007-08-02 12:01:03 UTC (rev 343)
@@ -9,8 +9,8 @@
 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 @@
 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 @@
 EOM
 
 if [ -f ~/.signature ]; 
-	then echo "--=20" >> $TEMPFILE 
+	then printf "--=20\n" >> $TEMPFILE 
 	cat ~/.signature >> $TEMPFILE
 fi
 
@@ -89,15 +90,14 @@
 
 --$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




More information about the Pgp-tools-commit mailing list