* gpg-mailkeys: (Closes: #545186)
authorthialme-guest <thialme-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 10 Sep 2009 22:19:28 +0000 (22:19 +0000)
committerthialme-guest <thialme-guest@b513b33f-fedd-0310-b452-c3deb5f4c849>
Thu, 10 Sep 2009 22:19:28 +0000 (22:19 +0000)
  + The charset for the text of the message is deduced from the charset used
    by ~/.gpg-mailkeysrc and ~/.signature.
  + The text message is encoded in quoted printable and thus it requires a
    new dependency on qprint in debian/control.

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

debian/changelog
debian/control
gpg-mailkeys/gpg-mailkeys

index 8184d2ee510319887bf48d33fa2528cb7532bb39..7837e377947b7d673e71cd27ee1bf2eadf74b46c 100644 (file)
@@ -2,6 +2,8 @@ signing-party (1.1.2-1) UNRELEASED; urgency=low
 
   TODOs:
   * Check for Debian policy 3.8.3
+  * Update of the gpg-mailkeys man page to mention both the signature and
+    gpg-mailkeysrc files.
 
   [ Franck Joncourt ]
   * gpgsigs: 
@@ -19,6 +21,11 @@ signing-party (1.1.2-1) UNRELEASED; urgency=low
     + Warned the user if a local-user keyid is not listed as a keyid in
       ./caffrc. (Closes: #540165).
   * gpgdir: New upstream release.
+  * gpg-mailkeys: (Closes: #545186)
+    + The charset for the text of the message is deduced from the charset used
+      by ~/.gpg-mailkeysrc and ~/.signature.
+    + The text message is encoded in quoted printable and thus it requires a
+      new dependency on qprint in debian/control.
   * debian.control: added ${misc:Depends} as Depends for the keyanalyze
     package.
 
index d706963f39d66838430df038a269d1ff68cc1834..760776791bf69476d8e0d0e53b0e5b265838d2b1 100644 (file)
@@ -16,7 +16,7 @@ Package: signing-party
 Architecture: any
 Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, gnupg, 
  libgnupg-interface-perl, libtext-template-perl, libmime-tools-perl,
- libmailtools-perl, libterm-readkey-perl, libclass-methodmaker-perl
+ libmailtools-perl, libterm-readkey-perl, libclass-methodmaker-perl, qprint
 Recommends: exim4 | mail-transport-agent, libtext-iconv-perl | libintl-perl | recode, dialog | whiptail, libpaper-utils,
 # springraph
  libgd-gd2-noxpm-perl | libgd-gd2-perl
index cacaf1dfac3637ac23b29c69ce1f8341d085e063..7ba5139dfe6decf69a12ba012a8179561bd5cb5e 100755 (executable)
@@ -8,6 +8,33 @@ set -e
 
 VERSION='$Rev$'
 
+# Define the charset used in the text message of the mail
+LOCAL_CHARSET=""
+
+##
+# Get the local charset.
+#
+# The local charset is deduced from the charset used by both ~/.gpg-mailkeysrc
+# and ~/.signature. If none of these files exist, the local charset is assumed
+# to be us-ascii.
+
+get_local_charset ()
+{
+    local charset="us-ascii"
+    local file_list="$HOME/.signature $HOME/.gpg-mailkeysrc"
+
+    for filename in $file_list; do
+
+        if [ -e $filename ]; then
+            charset=`file --mime-encoding $filename | cut -d ' ' -f 2`
+            break
+        fi
+
+    done;
+
+    LOCAL_CHARSET=$charset
+}
+
 if [ -z "$*" ]; then
        printf "Send people their newly signed GPG key by mail.\n"
        printf "Usage: $0 keyid ...\n"
@@ -35,6 +62,8 @@ Enjoy,
 $NAME"
 fi
 
+get_local_charset
+
 FAILKEYS=
 
 while [ -n "$1" ]; do
@@ -66,18 +95,18 @@ Content-Disposition: inline
 
 
 --$BOUNDARY
-Content-Type: text/plain; charset=us-ascii
+Content-Type: text/plain; charset=$LOCAL_CHARSET
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
  
 
-$TEXT
+`echo "$TEXT" | qprint -e`
 
 EOM
 
 if [ -f ~/.signature ]; 
        then printf -- "--=20\n" >> $TEMPFILE 
-       cat ~/.signature >> $TEMPFILE
+       qprint -e ~/.signature >> $TEMPFILE
 fi
 
 cat << EOM >> $TEMPFILE