pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/49479: mail/exmh desn't always append local time to Date: on display (+FIX)



>Number:         49479
>Category:       pkg
>Synopsis:       mail/exmh desn't always append local time to Date: on display (+FIX)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 16 12:05:00 +0000 2014
>Originator:     Robert Elz
>Release:        NetBSD 6.99.17 (irrelevant) pkgsrc current 2014-12-16
>Organization:
	Prince of Songkla University
>Environment:
	
	
System: NetBSD perseus.noi.kre.to 6.99.17 NetBSD 6.99.17 (GENERIC) #1: Fri Feb 22 22:09:50 ICT 2013 kre%jade.coe.psu.ac.th@localhost:/usr/obj/current/i386/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	exmh is intended to append the local to the Date: header
	when it is displaying a message (if that is a different
	time than the time in the Date: - ie: if the message was
	posted from a different timezone than that in which it
	is being viewed) - and it does - unless the Date: header
	contains either a comment, or a +NNNN timezone indicator
	(for any NNNN including +0000 - like most messages on the
	NetBSD lists).  For messages without comments, and with
	tmezone indicators of -NNNN or (valid) alphabetic ones, it
	worked fine.

>How-To-Repeat:
	View the NetBSD mailing list using exmh - compare with messages
	(from other sources, since NetBSD mail all seems to be
	converted to +0000 - for whatever reason) from other sources
	west of Greenwich (-0500 or similar timezone offsets)

>Fix:
	Strictly, this might be considered a tcl bug, but if so, it is
	in a tcl function that is documented as obsolete, and shouldn't
	be used.   Hence, patching exmh to use the more modern interface
	to the tcl function seems like a better solution.  While doing
	that, also ignore comments, and special case -0000 (timezone
	unknown) so it isn't converted (a gigo operation).

	The patch below does that (it has been submitted upstream and
	is likely to appear in the next exmh release, assuming that
	ever happens).

	In addition, the patch needs to be added to the distinfo
	file, and PKREVISION++ in the Makefile.

	kre

$NetBSD$

Patch to correct locatime display for messages in +NNNN timezones
(and ignore -0000) in Date: header when viewing messages.
Submitted upstream, and should be added to exmh cvs soon.

--- lib/mime.tcl	2013-09-16 11:48:55.000000000 +0700
+++ lib/mime.tcl	2014-12-16 08:59:57.000000000 +0700
@@ -1302,7 +1302,12 @@
     global mime
 
     catch {
-	set msgtime   [clock scan $time]
+	set msgtime   [regsub -all {\([^)]*\)} $time {}]
+	set msgtime   [string trim $msgtime]
+	if [regexp {.* -0000$} $msgtime] {
+	    return
+	}
+	set msgtime   [clock scan $msgtime -format "%a, %d %b %Y %T %Z"]
 	set localtime [clock format $msgtime -format " %T"]
 	if { [string first $localtime $time] == -1 } {
 	    Preferences_Resource mime(localTimeFormat) localTimeFormat \



Home | Main Index | Thread Index | Old Index