diff options
author | mi <mi@FreeBSD.org> | 2001-06-27 07:13:34 +0800 |
---|---|---|
committer | mi <mi@FreeBSD.org> | 2001-06-27 07:13:34 +0800 |
commit | f92832279dfd214a7aba72c8725fe754d48d1673 (patch) | |
tree | ac886402d2d2d25b6458fcf074d26a02225fdac9 /mail | |
parent | c4096316bb32a02cf251493d1ec60ef0acc4ea6c (diff) | |
download | freebsd-ports-gnome-f92832279dfd214a7aba72c8725fe754d48d1673.tar.gz freebsd-ports-gnome-f92832279dfd214a7aba72c8725fe754d48d1673.tar.zst freebsd-ports-gnome-f92832279dfd214a7aba72c8725fe754d48d1673.zip |
Upgrade to 2.0.2. Add a big patch, which corrects handling of charsets
not explicitly listed by TkRat, but known to TCL (koi8-u, koi8-r, for
example). The patch is being reviewed by the author for inclusion into
the next release.
Add WWW to pkg-descr (http://www.tkrat.org/).
Diffstat (limited to 'mail')
-rw-r--r-- | mail/tkrat2/Makefile | 5 | ||||
-rw-r--r-- | mail/tkrat2/distinfo | 2 | ||||
-rw-r--r-- | mail/tkrat2/files/patch-charset | 128 | ||||
-rw-r--r-- | mail/tkrat2/pkg-descr | 2 |
4 files changed, 134 insertions, 3 deletions
diff --git a/mail/tkrat2/Makefile b/mail/tkrat2/Makefile index fd56dfc97c3a..8c967e04b1d8 100644 --- a/mail/tkrat2/Makefile +++ b/mail/tkrat2/Makefile @@ -6,10 +6,11 @@ # PORTNAME= tkrat -PORTVERSION= 2.0.1 +PORTVERSION= 2.0.2 CATEGORIES= mail tk83 MASTER_SITES= ftp://ftp.md.chalmers.se/pub/tkrat/ \ - ftp://ftp.sunet.se/pub/unix/mail/tkrat/ + ftp://ftp.sunet.se/pub/unix/mail/tkrat/ \ + http://www.tkrat.org/downloads/stable/ MAINTAINER= ports@FreeBSD.org diff --git a/mail/tkrat2/distinfo b/mail/tkrat2/distinfo index 947fa04e972c..0886bedf0f6f 100644 --- a/mail/tkrat2/distinfo +++ b/mail/tkrat2/distinfo @@ -1 +1 @@ -MD5 (tkrat-2.0.1.tar.gz) = 209bea909b353790699b65a4007a5916 +MD5 (tkrat-2.0.2.tar.gz) = c2014bbf4ffe71253f58a799e99f540a diff --git a/mail/tkrat2/files/patch-charset b/mail/tkrat2/files/patch-charset new file mode 100644 index 000000000000..66aa2606ce7a --- /dev/null +++ b/mail/tkrat2/files/patch-charset @@ -0,0 +1,128 @@ +This fairly intrusive patch fixes handling of the charsets, which are +not explicitly known to the TkRat, but whose TCL encoding is the same +as the charset (like koi8-u or koi8-r). + +Such charsets can be added explicitly to the user's + ~/.ratatosk/ratatoskrc + +The patch also considers the charset of the original message when replying, +instead of just ignoring it. + +The patch was submitted to the developer and may be included when the next +version comes out. + + -mi + +--- tkrat/compose.tcl Tue Feb 13 00:59:37 2001 ++++ tkrat/compose.tcl Tue Jun 26 14:29:18 2001 +@@ -49,4 +48,6 @@ + } + set handler [$msg reply $to] ++ global $handler ++ array set $handler [list charset [[$msg body] parameter charset]] + return [DoCompose $handler \ + [expr {($option(reply_bottom)) ? "1" : "-1"}] \ +@@ -377,6 +378,4 @@ + + proc ComposeExtracted {mgh} { +- global charsetMapping +- + upvar #0 $mgh mh + if [info exists mh(body)] { +@@ -411,15 +410,8 @@ + if [info exists p(charset)] { + set charset $p(charset) +- } else { +- if [info exists mh(charset)] { +- set charset $mh(charset) +- } else { +- set charset auto +- } ++ } elseif [info exists mh(charset)] { ++ set charset $mh(charset) + } +- if {"auto" == $charset} { +- set charset utf-8 +- } +- fconfigure $fh -encoding $charsetMapping($charset) ++ ConfigureEncoding $fh [SaneCharset $charset] + set mh(data) [read $fh] + close $fh +@@ -1024,4 +1017,32 @@ + } + ++# Cache the known charsets for subsequent SaneCharset invocations: ++set KnownCharsets [encoding names] ++ ++proc SaneCharset args { ++ global charsetMapping KnownCharsets ++ puts "SaneCharset: going through ``$args''" ++ foreach charset $args { ++ if {[info exists charsetMapping($charset)]} { ++ set charset $charsetMapping($charset) ++ } ++ if {[lsearch -exact $KnownCharsets $charset] != -1} { ++ return $charset ++ } ++ } ++ # XXX what else? ++ return _binary ++} ++ ++# If we were unable to figure out the encoding for some reason, ++# output the file without translations and hope for the best: ++proc ConfigureEncoding {fh encoding} { ++ if {"_binary" == $encoding} { ++ fconfigure $fh -translation binary ++ } else { ++ fconfigure $fh -encoding $encoding ++ } ++} ++ + # ComposeBuildStruct -- + # +@@ -1074,10 +1096,9 @@ + lappend bh(parameter) [list charset $charset] + } +- } else { +- if {"auto" == $charset} { +- set charset utf-8 +- } + } +- fconfigure $fh -encoding $charsetMapping($charset) ++ ++ set mh(charset) [set charset [SaneCharset $charset]] ++ ConfigureEncoding $fh $charset ++ + puts -nonewline $fh $bodydata + close $fh +@@ -1172,8 +1193,12 @@ + # Write data, change text visible and edit + set ecmd [lindex $editor($e) 0] +- set charset $charsetMapping([lindex $editor($e) 1]) ++ # If the charset preferred by the editor is not known, try the one ++ # used by the message itself -- so we get what was written already ++ # unmodified. It should be possible to specify _a list_ of charsets ++ # the editor can handle. XXX ++ set charset [SaneCharset [lindex $editor($e) 1] $mh(charset)] + set fname $option(tmp)/rat.[RatGenId] + set fh [open $fname w 0600] +- fconfigure $fh -encoding $charset ++ ConfigureEncoding $fh $charset + puts -nonewline $fh [$mh(composeBody) get 0.0 end] + close $fh +@@ -1195,5 +1220,6 @@ + $mh(composeBody) delete 0.0 end + set fh [open $fname r] +- fconfigure $fh -encoding $charset ++ # The charset is already sanitized by ComposeEEdit ++ ConfigureEncoding $fh $charset + while { -1 != [gets $fh line]} { + $mh(composeBody) insert end "$line\n" +@@ -2605,5 +2631,5 @@ + } + set editor($t(external_editor)) \ +- [list $option(editor) $charset] ++ [list $option(editor) [SaneCharset $charset]] + } + if ![info exists option(eeditor)] { diff --git a/mail/tkrat2/pkg-descr b/mail/tkrat2/pkg-descr index 73c1b0aca990..6578f01b6cb5 100644 --- a/mail/tkrat2/pkg-descr +++ b/mail/tkrat2/pkg-descr @@ -19,3 +19,5 @@ capabilities: * Uses sendmail OR direct SMTP or other MA * Supports Delivery Status Notifications - DSN ESMTP sendmail-8.7 * Supports PGP/MIME and "old-style PGP message receipt" + +WWW: http://www.tkrat.org/ |