hns - 日記自動生成システム - Version 2.19.9

先月 2006年11月 来月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2006年11月01日(水) 旧暦 [n年日記] [更新:"2006/11/02 09:52:50"]

#1 [Namazu] htmlsplit 選択

混乱してしまったので、整理して見る。 htmlsplit の指定があった場合:
  • mknmz::process_file の中で場合分けして、 mknmz::namazu_core の呼出方法が二通りある。 それは引数の最後の三つで伝える。
    1. $uri, $id, $#parts
    2. undef, undef, undef
  • mknmz::namazu_core の中では、 その引数によって
    1. $id ( -> $part_id ) から $msg_prefix を作る
    2. 後の二つの引数はその $msg_prefix を作るのに使われるだけ
    3. (だから $msg_prefix を渡す形でもいいかも知れない)
    4. $uri は generate_url に渡して作り直す
    5. filter は 860 行目付近の次の行で呼出す
      ::filter($orig_cfile, $contref, $weighted_str, $headings, $fields);';
      

元々の問題 | 変更が必要な理由:

  • jeedosaquin の filter で get_uri する時に $mother_cfile と $fragment が必要
  • そのためには sub filter (::filter) の引数を変更する必要がある
  • そのためには、全ての filter/*.pl の ::filter の引数を変更する必要がある
だったと思う。いまは ::html_filter とかも変更しようとしているが、実はそれは不要 (?)

apply_filter は ?:

上の ::filter の呼出しは apply_filter の中だから、apply_filter の引数の変更は必要。 例えば呼出形式は次のようなもの。
 mknmz::apply_filter($orig_cfile, \$datafork,
                        $weighted_str, $headings, $fields,
                        $dummy_shelterfilename, $mmtype);
呼んでいるのは macbinary.pl, mailnews.pl, zip.pl。これは nesting_filter でも呼ばれている ので、nesting_filter にも 引数を渡してもらうことが必要。 nesting_filter は mailnews.pl と zip.pl の中で別々に定義されている。 事情は両者とも同じ。

とりあえず完了:

namazu-mef-rc/ これで少なくとも日記の検索が出来るようになった。185 日分くらい落していた (索引を作っていなかった) ような気がする。 ... しまった pre2 より新しい RC2 があった ...
Day '31' out of range 1..30 at /usr/pkg/share/namazu/pl/time.pl line 245
これは何かな ..
    245         my $mtime = timegm($sec, $min, $hour, $mday, $month, $year);
$mday は 0..30 な数なので -1 をしておく必要がある ? (というのも、ちょっと変) 放っておけば、と思ったが、その後で止ってしまった。 どうも日の方ではなくて月の方が 1 つずれているということらしい → Day '31' out of range 1..30
168716/1170509 - /home/makoto/Mail/junk/2805 [message/rfc822]
Day too big - 47387 > 24855
Sec too small - 47387 < 74752
Sec too big - 47387 > 11647
Cannot handle date (49, 21, 03, 28, 8, 2099) 
    at /usr/pkg/share/namazu/pl/time.pl line 245
ttyqc:makoto@trapani 5:20:53/061102(...makoto/Mail)> 
grep Date /e/u/home/makoto/Mail/junk/2806
Date: Tue, 29 Sep 2099 03:21:49 +0800
/usr/pkg/lib/perl5/5.8.0/Time/Local.pm より
    100 sub timegm {
    101     my ($sec,$min,$hour,$mday,$month,$year) = @_;
    102 
    103     if ($year >= 1000) {
    104         $year -= 1900;
    105     }
    106     elsif ($year < 100 and $year >= 0) {
    107         $year += ($year > $Breakpoint) ? $Century : $NextCentury;
    108     }
    109     
    110     unless ($Options{no_range_check}) {
    111         if (abs($year) >= 0x7fff) {
    112             $year += 1900;
    113             croak "Cannot handle date ($sec, $min, $hour, $mday, $month, *$year*)";
    114         }

patch for pl/time.pl:

$Options{no_range_check} を指定しておいた方がいい気がする::
--- pl/time.pl-orig	2006-11-01 12:27:34.000000000 +0900
+++ pl/time.pl	2006-11-02 09:09:08.000000000 +0900
@@ -26,6 +26,8 @@
 package time;
 use strict;
 use Time::Local;
+# http://www.rfs.jp/sb/perl/04/01.html
+use Time::Local  qw(timegm_nocheck); 
 
 #
 # get timezone :
@@ -242,7 +244,7 @@
         $year += 2000 if ($year < 50);
         $year += 1900 if (50 <= $year && $year <= 99);
 
-	my $mtime = timegm($sec, $min, $hour, $mday, $month, $year);
+	my $mtime = timegm_nocheck($sec, $min, $hour, $mday, $month, $year);
 
         my $offset;
         if ($timezone =~ /([+-])(\d{2})([0-5][0-9])/) {



最近の日記
2024年05月08日
comparison on ./buildsh tools
2024年05月06日
py-setuptools (python 3.11.9)
make release took 1 hours and 10 min
qemu invocation for 10.99.10
2024年05月05日
Windows 10 version
serial connection
bc bench
2024年05月04日
Trial on 10.99.10
another version (later trial) to succeed
2024年04月29日
dkim
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)