namazu-dev(ring)


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

Re: File::MMagic bug



<199909261135.UAA28937@xxxxxxxxxxxxxx>の記事において
satoru-t@xxxxxxxxxxxxxxxxxxさんは書きました。

>>  * rfc207.txt が [text/plain] として認識されてしまう。
>> 
>>  * text/html; x-type=mhonarc' を認識しない。
>>    - mknmz から呼び出している
>>      $Magic->addMagicEntry('0	string		\<!--\ MHonArc	...);
>>      がきちんと動作していない?

  これはおそらく、どちらもchecktype_dataでtext/plainやtext/htmlなどと
認識されてしまうため、checktype_magicを呼び出さずにそこで認識を終えて
しまうのが原因だと思われます(mknmz.pl.in 510行付近)。
  そこで、次のようにchecktype_magicを呼び出す条件を増やしてみました。

	    my $mtype_n = $Magic->checktype_byfilename($cfile);
	    my $mtype_c = $Magic->checktype_data($$contref);
	    $mtype_c = $Magic->checktype_magic($$contref) 
	      if ((! defined $mtype_c) || $mtype_c =~ /^(text\/html|text\/plain|application\/octet-stream)$/);

  これで動作チェックをしようとおもったのですが、今のCVS上のソースでは
次のエラーが出て止まってしまいます...

Making all in conf
make[2]: Entering directory `/home/knok/namazu/build/namazu-2.0-pre/conf'
make[2]: *** No rule to make target `../lib/conf.pl', needed by `mknmz.conf-dist'.  Stop.
make[2]: Leaving directory `/home/knok/namazu/build/namazu-2.0-pre/conf'
-- 
野首 貴嗣
E-mail: knok@xxxxxxxxxxxxx (private)
        nokubi@xxxxxxxxx (official)