summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MDK/Common.pm.pl2
-rw-r--r--MDK/Common/System.pm21
-rw-r--r--perl-MDK-Common.spec5
3 files changed, 18 insertions, 10 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl
index 62dcb51..019a7c9 100644
--- a/MDK/Common.pm.pl
+++ b/MDK/Common.pm.pl
@@ -74,7 +74,7 @@ use vars qw(@ISA @EXPORT $VERSION); #);
# perl_checker: RE-EXPORT-ALL
@EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-$VERSION = "1.1.17";
+$VERSION = "1.1.18";
1;
EOF
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm
index 427a9e5..7a6d194 100644
--- a/MDK/Common/System.pm
+++ b/MDK/Common/System.pm
@@ -226,18 +226,23 @@ sub compat_arch { better_arch(arch(), $_[0]) }
sub typeFromMagic {
my $f = shift;
- local *F; sysopen F, $f, 0 or return;
+ sysopen(my $F, $f, 0) or return;
my $tmp;
M: foreach (@_) {
- my ($name, @l) = @$_;
- while (@l) {
- my ($offset, $signature) = splice(@l, 0, 2);
- sysseek(F, $offset, 0) or next M;
- sysread(F, $tmp, length $signature);
- $tmp eq $signature or next M;
+ if (ref($_) eq 'CODE') {
+ my $name = $_->($F) or next M;
+ return $name;
+ } else {
+ my ($name, @l) = @$_;
+ while (@l) {
+ my ($offset, $signature) = splice(@l, 0, 2);
+ sysseek($F, $offset, 0) or next M;
+ sysread($F, $tmp, length $signature);
+ $tmp eq $signature or next M;
+ }
+ return $name;
}
- return $name;
}
undef;
}
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index c6f96a4..adb6a66 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -2,7 +2,7 @@
# do not change the version here, change in MDK/Common.pm.pl
%define version THEVERSION
-%define release 3mdk
+%define release 1mdk
%ifarch x86_64
%define build_option PERL_CHECKER_TARGET='debug-code BCSUFFIX=""'
@@ -64,6 +64,9 @@ rm -rf $RPM_BUILD_ROOT
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Mon Sep 6 2004 Pixel <pixel@mandrakesoft.com> 1.1.18-1mdk
+- more flexible typeFromMagic
+
* Wed Aug 18 2004 Pixel <pixel@mandrakesoft.com> 1.1.17-3mdk
- use DESTDIR
- add perl_checker-vim