Hello community,
here is the log from the commit of package perl-File-MMagic
checked in at Tue Dec 19 17:24:11 CET 2006.
--------
--- perl-File-MMagic/perl-File-MMagic.changes 2006-01-25 21:39:41.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-File-MMagic/perl-File-MMagic.changes 2006-12-19 17:07:12.000000000 +0100
@@ -1,0 +2,10 @@
+Tue Dec 19 17:01:02 CET 2006 - mfabian@suse.de
+
+- update to 1.27 (required by namazu 2.0.16).
+ • MMagic.pm (checktype_data): performance improve.
+ http://www.namazu.org/trac-namazu/trac.cgi/ticket/8
+ • MMagic.pm (magicMatchStr): Fixed time waste problem.
+ • MMagic.pm (__DATA__): Perfomance tuning for mknmz.
+ http://www.namazu.org/pipermail/namazu-devel-ja/2005-December/000793.html
+
+-------------------------------------------------------------------
Old:
----
File-MMagic-1.22.tar.bz2
New:
----
File-MMagic-1.27.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-File-MMagic.spec ++++++
--- /var/tmp/diff_new_pack.FXCXPC/_old 2006-12-19 17:20:46.000000000 +0100
+++ /var/tmp/diff_new_pack.FXCXPC/_new 2006-12-19 17:20:46.000000000 +0100
@@ -1,11 +1,11 @@
#
-# spec file for package perl-File-MMagic (Version 1.22)
+# spec file for package perl-File-MMagic (Version 1.27)
#
-# Copyright (c) 2004 SUSE LINUX AG, Nuernberg, Germany.
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://www.suse.de/feedback/
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
@@ -18,9 +18,9 @@
Requires: perl = %{perl_version}
Autoreqprov: on
Summary: Perl modules to guess file types
-Version: 1.22
+Version: 1.27
Release: 1
-Source: File-MMagic-%{version}.tar.bz2
+Source: http://search.cpan.org/CPAN/authors/id/K/KN/KNOK/File-MMagic-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -54,6 +54,13 @@
/var/adm/perl-modules/perl-File-MMagic
%changelog -n perl-File-MMagic
+* Tue Dec 19 2006 - mfabian@suse.de
+- update to 1.27 (required by namazu 2.0.16).
+ • MMagic.pm (checktype_data): performance improve.
+ http://www.namazu.org/trac-namazu/trac.cgi/ticket/8
+ • MMagic.pm (magicMatchStr): Fixed time waste problem.
+ • MMagic.pm (__DATA__): Perfomance tuning for mknmz.
+ http://www.namazu.org/pipermail/namazu-devel-ja/2005-December/000793.html
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Jul 29 2004 - ro@suse.de
++++++ File-MMagic-1.22.tar.bz2 -> File-MMagic-1.27.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/ChangeLog new/File-MMagic-1.27/ChangeLog
--- old/File-MMagic-1.22/ChangeLog 2004-03-15 09:22:12.000000000 +0100
+++ new/File-MMagic-1.27/ChangeLog 2006-05-23 07:55:27.000000000 +0200
@@ -1,3 +1,68 @@
+2006-05-23 NOKUBI Takatsugu
+
+ * MMagic.pm: Version 1.27.
+
+ * MMagic.pm (readMagicLine): Changed regex for magic entry.
+ (Reported by Dylan Vanderhoof, thank you)
+
+2006-05-17 NOKUBI Takatsugu
+
+ * MMagic.pm: Added a new line at the end of file.
+ (Reported by Vilmos Soti, thank you.)
+
+2006-02-08 Yukio USUDA
+
+ * MMagic.pm (magicMatch, dumpMagic): Fixed time waste problem.
+
+2006-01-30 NOKUBI Takatsugu
+
+ * MMagic.pm: Version 1.26.
+
+2006-01-12 Yukio USUDA
+
+ * MMagic.pm (magicMatchStr): Fixed Bug. Enbuged at Chageset 194.
+
+2006-01-11 NOKUBI Takatsugu
+
+ * README.* : Added the Trac URL.
+
+2006-01-05 Yukio USUDA
+
+ * MMagic.pm (checktype_data): performance improve.
+ http://www.namazu.org/trac-namazu/trac.cgi/ticket/8
+
+ * MMagic.pm (magicMatchStr): Fixed time waste problem.
+
+ * MMagic.pm (__DATA__): Perfomance tuning for mknmz.
+ http://www.namazu.org/pipermail/namazu-devel-ja/2005-December/000793.html
+
+2005-08-27 NOKUBI Takatsugu
+
+ * Version 1.25.
+
+ * Moved Build.PL to contrib directory.
+
+2005-08-01 NOKUBI Takatsugu
+
+ * Version 1.24.
+
+ * MMagic.pm (check_binary): Removed brackets, closes #13535.
+ (Reported by dakkar, thank you)
+
+2005-07-29 NOKUBI Takatsugu
+
+ * MMagic.pm: Version 1.23.
+
+2004-04-21 NOKUBI Takatsugu
+
+ * MMagic.pm (magicMatchStr): Added a length check.
+ Reported by Tadamasa Teranishi, thank you.
+
+2004-03-17 NOKUBI Takatsugu
+
+ * Build.PL: Added.
+ Contributed by Ryuji Abe, thank you.
+
2004-03-15 NOKUBI Takatsugu
* MMagic.pm: Version 1.22.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/MANIFEST new/File-MMagic-1.27/MANIFEST
--- old/File-MMagic-1.22/MANIFEST 2004-03-15 09:19:59.000000000 +0100
+++ new/File-MMagic-1.27/MANIFEST 2006-05-23 07:56:03.000000000 +0200
@@ -10,4 +10,6 @@
t/03-typecheck.t
t/test.html
t/04-string-mod.t
+t/test-magic
+contrib/Build.PL
META.yml Module meta-data (added by MakeMaker)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/META.yml new/File-MMagic-1.27/META.yml
--- old/File-MMagic-1.22/META.yml 2004-03-15 09:23:23.000000000 +0100
+++ new/File-MMagic-1.27/META.yml 2006-05-23 07:56:03.000000000 +0200
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: File-MMagic
-version: 1.22
+version: 1.27
version_from: MMagic.pm
installdirs: site
requires:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/MMagic.pm new/File-MMagic-1.27/MMagic.pm
--- old/File-MMagic-1.22/MMagic.pm 2004-03-15 09:23:04.000000000 +0100
+++ new/File-MMagic-1.27/MMagic.pm 2006-05-23 07:55:27.000000000 +0200
@@ -1,6 +1,6 @@
# File::MMagic
#
-# $Id: MMagic.pm,v 1.60 2004/03/15 08:23:04 knok Exp $
+# $Id: MMagic.pm 259 2006-05-23 05:55:32Z knok $
#
# This program is originated from file.kulp that is a production of The
# Unix Reconstruction Projct.
@@ -339,7 +339,7 @@
t => "\t",
f => "\f");
-$VERSION = "1.22";
+$VERSION = "1.27";
$allowEightbit = 1;
}
@@ -678,24 +678,26 @@
{
# in BSD's version, there's an effort to search from
# more specific to less, but I don't do that.
- my ($token, %val);
+ my %val;
foreach my $type (keys %{$self->{SPECIALS}}) {
- my $token = '(' .
- (join '|', sort {length($a) <=> length($b)} @{$self->{SPECIALS}->{$type}})
- . ')';
- my $tdata = $data;
- if ($tdata =~ /$token/mg) {
- $val{$type} = pos($tdata);
+ my $matched_pos = undef;
+ foreach my $token (@{$self->{SPECIALS}->{$type}}){
+ pos($data) = 0;
+ if ($data =~ /$token/mg) {
+ my $tmp = pos($data);
+ if ((! defined $matched_pos) || ($matched_pos > $tmp)) {
+ $matched_pos = $tmp;
+ }
+ }
}
+ $val{$type} = $matched_pos if $matched_pos;
}
-
# search latest match
if (%val) {
my @skeys = sort { $val{$a} <=> $val{$b} } keys %val;
$mtype = $skeys[0];
}
- ALLDONE:
# $mtype = 'text/plain' if (! defined $mtype);
}
if (! defined $mtype && check_binary($data)) {
@@ -727,11 +729,11 @@
my ($data) = @_;
my $len = length($data);
if ($allowEightbit) {
- my $count = ($data =~ tr/[\x00-\x08\x0b-\x0c\x0e-\x1a\x1c-\x1f]//); # exclude TAB, ESC, nl, cr
+ my $count = ($data =~ tr/\x00-\x08\x0b-\x0c\x0e-\x1a\x1c-\x1f//); # exclude TAB, ESC, nl, cr
return 1 if ($len <= 0); # no contents
return 1 if (($count/$len) > 0.1); # binary
} else {
- my $count = ($data =~ tr/[\x00-\x08\x0b-\x0c\x0e-\x1a\x1c-\x1f\x80-\xff]//); # exclude TAB, ESC, nl, cr
+ my $count = ($data =~ tr/\x00-\x08\x0b-\x0c\x0e-\x1a\x1c-\x1f\x80-\xff//); # exclude TAB, ESC, nl, cr
return 1 if ($len <= 0); # no contents
return 1 if (($count/$len) > 0.3); # binary
}
@@ -760,7 +762,10 @@
# this item, then parse out its structure. @$item is just the
# raw string, line number, and subtests until we need the real info.
# this saves time otherwise wasted parsing unused subtests.
- $item = readMagicLine(@$item) if @$item == 3;
+ if (@$item == 3){
+ my $tmp = readMagicLine(@$item);
+ @$item = @$tmp;
+ }
# $item could be undef if we ran into troubles while reading
# the entry.
@@ -913,11 +918,15 @@
# this item, then parse out its structure. @$item is just the
# raw string, line number, and subtests until we need the real info.
# this saves time otherwise wasted parsing unused subtests.
- $item = readMagicLine(@$item) if @$item == 3;
+ if (@$item == 3){
+ my $tmp = readMagicLine(@$item);
- # $item could be undef if we ran into troubles while reading
- # the entry.
- return unless defined($item);
+ # $item could be undef if we ran into troubles while reading
+ # the entry.
+ return unless defined($tmp);
+
+ @$item = @$tmp;
+ }
# $fh is not be defined if -c. that way we always return
# false for every item which allows reading/checking the entire
@@ -986,6 +995,7 @@
#numeric
# read up to 4 bytes
+ return if (length($str) < 4);
$data = substr($str, 0, 4);
# If template is a ref to an array of 3 letters,
@@ -1158,7 +1168,7 @@
# or hex offset or an indirect offset specified in parenthesis
# like (x[.[bsl]][+-][y]), or a relative offset specified by &.
# offtype : 0 = absolute, 1 = indirect, 2 = relative
- if ($line =~ s/^>*([&\(]?[a-flsx\.\+\-\d]+\)?)\s+(\S+)\s+//) {
+ if ($line =~ s/^>*([&\(]?[a-fA-Flsx\.\+\-\d]+\)?)\s+(\S+)\s+//) {
($offset,$type) = ($1,$2);
if ($offset =~ /^\(/) {
@@ -1312,7 +1322,10 @@
my $entry;
foreach $entry (@$magic) {
# delayed evaluation.
- $entry = readMagicLine(@$entry) if @$entry == 3;
+ if (@$entry == 3){
+ my $tmp = readMagicLine(@$entry);
+ @$entry = @$tmp;
+ }
next if !defined($entry);
@@ -1377,6 +1390,57 @@
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
+# html: file(1) magic for HTML (HyperText Markup Language) docs
+#
+# from Daniel Quinlan
+#
+0 string \<!DOCTYPE\ HTML text/html
+0 string \<!DOCTYPE\ html text/html
+0 string \<HEAD text/html
+0 string \<head text/html
+0 string \<TITLE text/html
+0 string \<title text/html
+0 string \<html text/html
+0 string \<HTML text/html
+0 string \<!-- text/html
+0 string \<h1 text/html
+0 string \<H1 text/html
+
+#------------------------------------------------------------------------------
+# mail.news: file(1) magic for mail and news
+#
+# There are tests to ascmagic.c to cope with mail and news.
+0 string Relay-Version: message/rfc822
+0 string #!\ rnews message/rfc822
+0 string N#!\ rnews message/rfc822
+0 string Forward\ to message/rfc822
+0 string Pipe\ to message/rfc822
+0 string Return-Path: message/rfc822
+0 string Received: message/rfc822
+0 string Path: message/news
+0 string Xref: message/news
+0 string From: message/rfc822
+0 string Article message/news
+
+# Acrobat
+# (due to clamen@cs.cmu.edu)
+0 string %PDF- application/pdf
+
+# ZIP archiver
+0 string PK application/x-zip
+
+#------------------------------------------------------------------------------
+# msword: file(1) magic for MS Word files
+#
+# Contributor claims:
+# Reversed-engineered MS Word magic numbers
+#
+
+0 string \376\067\0\043 application/msword
+#0 string \320\317\021\340\241\261 application/msword
+0 string \333\245-\0\0\0 application/msword
+
+#------------------------------------------------------------------------------
# Java
0 short 0xcafe
@@ -1530,21 +1594,6 @@
0 string \<Maker application/x-frame
#------------------------------------------------------------------------------
-# html: file(1) magic for HTML (HyperText Markup Language) docs
-#
-# from Daniel Quinlan <quinlan@yggdrasil.com>
-#
-0 string \
47 string EPSF image/eps
-# Acrobat
-# (due to clamen@cs.cmu.edu)
-0 string %PDF- application/pdf
-
#------------------------------------------------------------------------------
# sc: file(1) magic for "sc" spreadsheet
#
@@ -1832,9 +1849,6 @@
2 string -lh
6 string - application/x-lha
-# ZIP archiver
-0 string PK application/x-zip
-
# POSIX tar archives
257 string ustar\0 application/x-tar
257 string ustar\040\040\0 application/x-gtar
@@ -1855,3 +1869,4 @@
0 leshort 0xea60 application/x-arj
# RAR archiver (Greg Roelofs, newt@uchicago.edu)
0 string Rar! application/x-rar
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/Makefile.PL new/File-MMagic-1.27/Makefile.PL
--- old/File-MMagic-1.22/Makefile.PL 1999-10-27 11:44:08.000000000 +0200
+++ new/File-MMagic-1.27/Makefile.PL 2006-05-23 07:55:27.000000000 +0200
@@ -1,6 +1,6 @@
# File::MMagic Makefile.PL
#
-# $Id: Makefile.PL,v 1.3 1999/10/27 09:44:08 knok Exp $
+# $Id: Makefile.PL 192 2006-01-04 07:57:15Z knok $
use ExtUtils::MakeMaker;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/README.en new/File-MMagic-1.27/README.en
--- old/File-MMagic-1.22/README.en 2001-08-08 03:48:02.000000000 +0200
+++ new/File-MMagic-1.27/README.en 2006-05-23 07:55:27.000000000 +0200
@@ -1,6 +1,8 @@
File::MMagic
-Copyright(C) 1999-2001 NOKUBI Takatsugu
+Copyright(C) 1999-2006
+ NOKUBI Takatsugu
+ Yukio USUDA
1. Abstract
@@ -23,14 +25,6 @@
See COPYING file.
-5. Notice
+5. See also
-If you want to use the module under mod_perl environment, you'll need
-to divide the module into module part and magic entry file part, and use
-the magic file explicitly.
-Built-in magic entry does not work correctly under mod_perl.
-
-Ex.
-
-my $magic = File::MMagic::new('/etc/mime-magic');
- # /etc/mime-magic is separated file from MMagic.pm
+http://www.namazu.org/trac-namazu/trac.cgi/wiki/File-MMagic.en
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/README.ja new/File-MMagic-1.27/README.ja
--- old/File-MMagic-1.22/README.ja 2001-08-08 03:48:53.000000000 +0200
+++ new/File-MMagic-1.27/README.ja 2006-05-23 07:55:27.000000000 +0200
@@ -1,6 +1,8 @@
File::MMagic
-Copyright(C) 1999-2001 NOKUBI Takatsugu
+Copyright(C) 1999-2006
+ NOKUBI Takatsugu
+ Yukio USUDA
1. $B$O$8$a$K(B
@@ -43,13 +45,6 @@
The Apache HTTP server project
http://www.apache.org/
-5. $BCm0UE@(B
-
-$B$3$N%b%8%e!<%k$r(B mod_perl $B$GMxMQ$9$k$H$-$O!"(BMMagic.pm $B$+$i(B magic entry $BItJ,(B
-$B$rH4$-=P$7!"$=$l$r(B magic file $B$H$7$FM[$K;XDj$9$k$h$&$K$7$F2<$5$$!#(B
-$B%b%8%e!<%k$KAH$_9~$^$l$F$$$k(B magic entry $B$O(B mod_perl $B$G$O@5$7$/F0:n$7$^$;$s!#(B
-
-$BNc(B:
+5. $B;2>H(B
-my $magic = File::MMagic::new('/etc/mime-magic');
- # /etc/mime-magic is separated file from MMagic.pm
+http://www.namazu.org/trac-namazu/trac.cgi/wiki/File-MMagic
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/contrib/Build.PL new/File-MMagic-1.27/contrib/Build.PL
--- old/File-MMagic-1.22/contrib/Build.PL 1970-01-01 01:00:00.000000000 +0100
+++ new/File-MMagic-1.27/contrib/Build.PL 2006-05-23 07:55:28.000000000 +0200
@@ -0,0 +1,12 @@
+use Module::Build;
+
+my $build = Module::Build->new
+ (
+ module_name => 'File::MMagic',
+ dist_version_from => 'MMagic.pm',
+ license => 'open_source',
+ requires => {'perl' => '5.005'},
+ pm_files => {'MMagic.pm' => 'lib/File/MMagic.pm'},
+ );
+
+$build->create_build_script;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/t/01-selfcheck.t new/File-MMagic-1.27/t/01-selfcheck.t
--- old/File-MMagic-1.22/t/01-selfcheck.t 2003-11-21 03:25:52.000000000 +0100
+++ new/File-MMagic-1.27/t/01-selfcheck.t 2006-05-23 07:55:28.000000000 +0200
@@ -1,5 +1,5 @@
# perl-test
-# $Id: 01-selfcheck.t,v 1.2 2003/11/21 02:25:52 knok Exp $
+# $Id: 01-selfcheck.t 192 2006-01-04 07:57:15Z knok $
use strict;
use Test;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/t/02-extmagic.t new/File-MMagic-1.27/t/02-extmagic.t
--- old/File-MMagic-1.22/t/02-extmagic.t 2003-11-21 03:25:52.000000000 +0100
+++ new/File-MMagic-1.27/t/02-extmagic.t 2006-05-23 07:55:28.000000000 +0200
@@ -1,5 +1,5 @@
# perl-test
-# $Id: 02-extmagic.t,v 1.3 2003/11/21 02:25:52 knok Exp $
+# $Id: 02-extmagic.t 192 2006-01-04 07:57:15Z knok $
use strict;
use Test;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/t/03-typecheck.t new/File-MMagic-1.27/t/03-typecheck.t
--- old/File-MMagic-1.22/t/03-typecheck.t 2003-11-21 03:25:52.000000000 +0100
+++ new/File-MMagic-1.27/t/03-typecheck.t 2006-05-23 07:55:28.000000000 +0200
@@ -1,5 +1,5 @@
# perl-test
-# $Id: 03-typecheck.t,v 1.1 2003/11/21 02:25:52 knok Exp $
+# $Id: 03-typecheck.t 192 2006-01-04 07:57:15Z knok $
use strict;
use Test;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/t/04-string-mod.t new/File-MMagic-1.27/t/04-string-mod.t
--- old/File-MMagic-1.22/t/04-string-mod.t 2004-03-15 09:23:15.000000000 +0100
+++ new/File-MMagic-1.27/t/04-string-mod.t 2006-05-23 07:55:28.000000000 +0200
@@ -1,5 +1,5 @@
# perl-test
-# $Id: 04-string-mod.t,v 1.1 2004/03/15 08:23:15 knok Exp $
+# $Id: 04-string-mod.t 192 2006-01-04 07:57:15Z knok $
use strict;
use Test;
@@ -14,6 +14,6 @@
my $m1 = File::MMagic->new($dir . 'test-magic');
my $ret = $m1->checktype_filename($dir . 'test.html');
ok($ret eq 'text/html');
-my $m2 = new File::MMagic;
+my $m2 = File::MMagic->new();
$ret = $m2->checktype_filename($dir . 'test.html');
ok($ret eq 'text/html');
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/File-MMagic-1.22/t/test-magic new/File-MMagic-1.27/t/test-magic
--- old/File-MMagic-1.22/t/test-magic 1970-01-01 01:00:00.000000000 +0100
+++ new/File-MMagic-1.27/t/test-magic 2006-05-23 07:55:28.000000000 +0200
@@ -0,0 +1 @@
+0 string/cB \