From owner-ports-jp@jp.freebsd.org  Wed Mar 25 17:35:16 1998
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) id RAA00974
	Wed, 25 Mar 1998 17:35:16 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) with SMTP id RAA00967
	for <ports-jp@jp.freebsd.org>; Wed, 25 Mar 1998 17:35:12 +0900 (JST)
From: kay@arch.t-kougei.ac.jp
Received: (qmail 5411 invoked by uid 3252); 25 Mar 1998 17:34:38 +0900
Message-ID: <19980325173438.30094@arch.t-kougei.ac.jp>
Date: Wed, 25 Mar 1998 17:34:38 +0900
To: ports-jp@jp.freebsd.org
References: <19980324162202R.kiri@kiri.toba-cmt.ac.jp> <199803241745.CAA09335@ail.ail-inc.co.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
X-Mailer: Mutt 0.89.1i-jp4
In-Reply-To: <199803241745.CAA09335@ail.ail-inc.co.jp>; from SADA Kenji on Wed, Mar 25, 1998 at 03:00:46AM +0900
Reply-To: ports-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24]
X-Sequence: ports-jp 3117
Subject: [ports-jp 3117] Re: ports on qmail
Errors-To: owner-ports-jp@jp.freebsd.org
Sender: owner-ports-jp@jp.freebsd.org

$B:G=i$KFM$C$D$$$?!"@P86$G$9!#(B

$B;d$O!"8+<i$k;v$7$+$G$-$J$$$R$H$G$9$,(B...$B!#(B($B$8!<!<(B)
$B$=$l$G!"(Bports$B;H$$$NJ}!9$KMWK>$,$"$j$^$9!#(B

$B0lIt$N(BMUA$B$GAw$i$l$FMh$k%a!<%k$N(BDate$BI=<($,(B +0900 $B$K$J$i$J$$$b$N$,(B
$B$"$j!"$3$l$r(Bqmail$B%5!<%P!<$GIU$1$k(Bqmail-date-localtime.patch$B$N:G=i$+$i(B
$BEv$F$F$7$^$C$F$O$I$&$G$7$g$&!#(B($B%Q%C%A$O%a!<%k$N:G8e$K$D$1$^$7$?!#(B)
$B$3$l$r$D$1$?;v$G!"5!G=$,JQ2=$9$k$o$1$G$O$J$$$N$GG!2?$,$G$7$g$&$+!#(B

$B$3$l$,!"(Bports$B$NN.57$KH?$9$k$H$+!"$b$&$d$C$F$k$H$$$&$N$G$"$l$P!"(B
$B$4$a$s$J$5$$!#(B

#$B$=$NB>!"(BHELO$B$r0l9T$r$7$+$_$J$$!"(BMUA$B$H$+$KBP1~$9$k%Q%C%A$H$+$b(B
#$B$"$C$?$O$:$J$s$G$9$,!"A\$7=P$;$^$;$s!#$=$l$i$b!"4^$s$G$b$i$($?$i(B
#$B$H;W$$$^$9!#(B


qmail-date-localtime.patch:
------------------$B$3$3$+$i(B---------------------------------------------
This patch causes the various qmail programs to generate date stamps in
the local timezone. I find GMT too annoying to convert from/to. I make
no warranties that it will work in your timezone, however it works for me.

--- qmail-1.01/date822fmt.c	Tue Apr 15 15:05:23 1997
+++ date822fmt.c	Fri Apr 18 00:39:41 1997
@@ -1,3 +1,4 @@
+#include <time.h>
 #include "datetime.h"
 #include "fmt.h"
 #include "date822fmt.h"
@@ -12,18 +13,51 @@
 {
   unsigned int i;
   unsigned int len;
+  time_t now;
+  datetime_sec utc;
+  datetime_sec local;
+  struct tm *tm;
+  struct datetime new_dt;
+  int minutes;
+
+  utc = datetime_untai(dt);
+  now = (time_t)utc;
+  tm = localtime(&now);
+  new_dt.year = tm->tm_year;
+  new_dt.mon = tm->tm_mon;
+  new_dt.mday = tm->tm_mday;
+  new_dt.hour = tm->tm_hour;
+  new_dt.min = tm->tm_min;
+  new_dt.sec = tm->tm_sec;
+  local = datetime_untai(&new_dt);
+
   len = 0;
-  i = fmt_uint(s,dt->mday); len += i; if (s) s += i;
+  i = fmt_uint(s,new_dt.mday); len += i; if (s) s += i;
   i = fmt_str(s," "); len += i; if (s) s += i;
-  i = fmt_str(s,montab[dt->mon]); len += i; if (s) s += i;
+  i = fmt_str(s,montab[new_dt.mon]); len += i; if (s) s += i;
   i = fmt_str(s," "); len += i; if (s) s += i;
-  i = fmt_uint(s,dt->year + 1900); len += i; if (s) s += i;
+  i = fmt_uint(s,new_dt.year + 1900); len += i; if (s) s += i;
   i = fmt_str(s," "); len += i; if (s) s += i;
-  i = fmt_uint0(s,dt->hour,2); len += i; if (s) s += i;
+  i = fmt_uint0(s,new_dt.hour,2); len += i; if (s) s += i;
   i = fmt_str(s,":"); len += i; if (s) s += i;
-  i = fmt_uint0(s,dt->min,2); len += i; if (s) s += i;
+  i = fmt_uint0(s,new_dt.min,2); len += i; if (s) s += i;
   i = fmt_str(s,":"); len += i; if (s) s += i;
-  i = fmt_uint0(s,dt->sec,2); len += i; if (s) s += i;
-  i = fmt_str(s," -0000\n"); len += i; if (s) s += i;
+  i = fmt_uint0(s,new_dt.sec,2); len += i; if (s) s += i;
+
+  if (local < utc) {
+    minutes = (utc - local + 30) / 60;
+    i = fmt_str(s," -"); len += i; if (s) s += i;
+    i = fmt_uint0(s,minutes / 60,2); len += i; if (s) s += i;
+    i = fmt_uint0(s,minutes % 60,2); len += i; if (s) s += i;
+  }
+  else {
+    minutes = (local - utc + 30) / 60;
+    i = fmt_str(s," +"); len += i; if (s) s += i;
+    i = fmt_uint0(s,minutes / 60,2); len += i; if (s) s += i;
+    i = fmt_uint0(s,minutes % 60,2); len += i; if (s) s += i;
+  }
+
+  i = fmt_str(s,"\n"); len += i; if (s) s += i;
+
   return len;
 }
------------------$B$3$3$^$G(B---------------------------------------------

