[libfile-libmagic-perl] 03/06: Update patches:
gregor herrmann
gregoa at debian.org
Tue Aug 27 21:32:04 UTC 2013
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libfile-libmagic-perl.
commit b0debf84a387b749d131cb43144aded56f77f920
Author: gregor herrmann <gregoa at debian.org>
Date: Tue Aug 27 23:16:41 2013 +0200
Update patches:
- drop do-not-link-libz.patch, file-5.10.patch, new-devel-checklib.patch
(merged upstream)
- refresh fix-checklib-fail.patch (offset)
---
debian/patches/do-not-link-libz.patch | 16 --
debian/patches/file-5.10.patch | 85 --------
debian/patches/fix-checklib-fail.patch | 10 +-
debian/patches/new-devel-checklib.patch | 320 -------------------------------
debian/patches/series | 3 -
5 files changed, 5 insertions(+), 429 deletions(-)
diff --git a/debian/patches/do-not-link-libz.patch b/debian/patches/do-not-link-libz.patch
deleted file mode 100644
index 0b2a16e..0000000
--- a/debian/patches/do-not-link-libz.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-From: Ansgar Burchardt
-Date: Sun, 11 Apr 2010 17:53:55 +0900
-Bug-Debian: http://bugs.debian.org/577288
-Subject: Do not link libz
-Forwarded: https://rt.cpan.org/Ticket/Display.html?id=56479
---- libfile-libmagic-perl.orig/Makefile.PL
-+++ libfile-libmagic-perl/Makefile.PL
-@@ -15,7 +15,7 @@
- 'PREREQ_PM' => { },
- 'ABSTRACT_FROM' => 'LibMagic.pm', # retrieve abstract from module
- 'AUTHOR' => 'Andreas Fitzner <andreas.fitzner at fv-berlin.de>',
-- 'LIBS' => ['-lmagic -lz'], # e.g., '-lm'
-+ 'LIBS' => ['-lmagic'], # e.g., '-lm'
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'INC' => '-I.', # e.g., '-I. -I/usr/include/other'
- # Un-comment this if you add C files to link with later:
diff --git a/debian/patches/file-5.10.patch b/debian/patches/file-5.10.patch
deleted file mode 100644
index fc822bc..0000000
--- a/debian/patches/file-5.10.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-Description: adjust for magic 5.10
-Origin: vendor
-Bug: https://rt.cpan.org/Ticket/Display.html?id=75457
-Bug-Debian: http://bugs.debian.org/661800
-Forwarded: https://rt.cpan.org/Ticket/Display.html?id=75457
-Author: gregor herrmann <gregoa at debian.org>
-Last-Update: 2012-03-01
-
---- a/t/2-easy.t
-+++ b/t/2-easy.t
-@@ -7,7 +7,7 @@
- is( MagicBuffer("Hello World\n"), 'ASCII text' );
-
- is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
--is( MagicFile('t/samples/foo.c' ), 'ASCII C program text' );
-+is( MagicFile('t/samples/foo.c' ), 'C source, ASCII text' );
-
- # check the error handling
- eval { MagicBuffer(undef) };
---- a/t/3-complete.t
-+++ b/t/3-complete.t
-@@ -32,7 +32,7 @@
- is( magic_buffer( $handle, "Footastic\n" ), 'A foo file' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
-- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
-+ is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII text' );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'A foo file' );
-
- magic_close($handle);
-@@ -45,7 +45,7 @@
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
-- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
-+ is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
-
- magic_close($handle);
-@@ -58,7 +58,7 @@
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
-- is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
-+ is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
- is( magic_file( $handle, 't/samples/foo.foo' ), 'ASCII text' );
-
- magic_close($handle);
---- a/t/4-all.t
-+++ b/t/4-all.t
-@@ -8,7 +8,7 @@
- is( MagicBuffer("Hello World\n"), 'ASCII text' );
-
- is( MagicFile('t/samples/foo.txt'), 'ASCII text' );
--is( MagicFile('t/samples/foo.c' ), 'ASCII C program text' );
-+is( MagicFile('t/samples/foo.c' ), 'C source, ASCII text' );
-
- # subs from :complete
- my $handle = magic_open(MAGIC_NONE);
-@@ -16,7 +16,7 @@
- is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );
-
- is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text' );
--is( magic_file( $handle, 't/samples/foo.c' ), 'ASCII C program text' );
-+is( magic_file( $handle, 't/samples/foo.c' ), 'C source, ASCII text' );
-
- magic_close($handle);
-
---- a/t/6-oo.t
-+++ b/t/6-oo.t
-@@ -6,12 +6,12 @@
-
- my %standard = (
- 'foo.foo' => [ 'ASCII text', 'text/plain; charset=us-ascii' ],
-- 'foo.c' => [ 'ASCII C program text', 'text/x-c; charset=us-ascii' ],
-+ 'foo.c' => [ 'C source, ASCII text', 'text/x-c; charset=us-ascii' ],
- );
-
- my %custom = (
- 'foo.foo' => [ 'A foo file', 'text/plain; charset=us-ascii' ],
-- 'foo.c' => [ 'ASCII C program text', 'text/x-c; charset=us-ascii' ],
-+ 'foo.c' => [ 'ASCII text', 'text/plain; charset=us-ascii' ],
- );
-
- plan tests => 4 + 4*(keys %standard) + 4*(keys %custom);
diff --git a/debian/patches/fix-checklib-fail.patch b/debian/patches/fix-checklib-fail.patch
index 767b277..abd17c4 100644
--- a/debian/patches/fix-checklib-fail.patch
+++ b/debian/patches/fix-checklib-fail.patch
@@ -3,16 +3,16 @@ Origin: vendor
Forwarded: not-needed
Author: Alessandro Ghedini <ghedo at debian.org>
Reviewed-by: Alessandro Ghedini <ghedo at debian.org>
-Last-Update: 2012-08-07
+Last-Update: 2013-08-27
--- a/Makefile.PL
+++ b/Makefile.PL
-@@ -7,7 +7,7 @@
- use lib qw(inc);
+@@ -9,7 +9,7 @@
+ use lib qw( inc );
use Devel::CheckLib;
-check_lib_or_exit( lib => 'magic', header => 'magic.h' );
+assert_lib( lib => 'magic', header => 'magic.h' );
- WriteMakefile(
- 'NAME' => 'File::LibMagic',
+
+
diff --git a/debian/patches/new-devel-checklib.patch b/debian/patches/new-devel-checklib.patch
deleted file mode 100644
index f541010..0000000
--- a/debian/patches/new-devel-checklib.patch
+++ /dev/null
@@ -1,320 +0,0 @@
-Description: update to newer Devel::CheckLib
-Origin: vendor
-Bug: https://rt.cpan.org/Public/Bug/Display.html?id=85210
-Bug-Debian: http://bugs.debian.org/708074
-Forwarded: not needed
-Author: gregor herrmann <gregoa at debian.org>
-Last-Update: 2013-05-21
-
---- a/inc/Devel/CheckLib.pm
-+++ b/inc/Devel/CheckLib.pm
-@@ -2,17 +2,19 @@
-
- package Devel::CheckLib;
-
-+use 5.00405; #postfix foreach
- use strict;
- use vars qw($VERSION @ISA @EXPORT);
--$VERSION = '0.6';
--use Config;
-+$VERSION = '0.99';
-+use Config qw(%Config);
-+use Text::ParseWords 'quotewords';
-
- use File::Spec;
- use File::Temp;
-
- require Exporter;
- @ISA = qw(Exporter);
-- at EXPORT = qw(assert_lib check_lib_or_exit);
-+ at EXPORT = qw(assert_lib check_lib_or_exit check_lib);
-
- # localising prevents the warningness leaking out of this module
- local $^W = 1; # use warnings is a 5.6-ism
-@@ -50,15 +52,32 @@
- You pass named parameters to a function, describing to it how to build
- and link to the libraries.
-
--It works by trying to compile this:
-+It works by trying to compile some code - which defaults to this:
-
- int main(void) { return 0; }
-
- and linking it to the specified libraries. If something pops out the end
--which looks executable, then we know that it worked. That tiny program is
-+which looks executable, it gets executed, and if main() returns 0 we know
-+that it worked. That tiny program is
- built once for each library that you specify, and (without linking) once
- for each header file.
-
-+If you want to check for the presence of particular functions in a
-+library, or even that those functions return particular results, then
-+you can pass your own function body for main() thus:
-+
-+ check_lib_or_exit(
-+ function => 'foo();if(libversion() > 5) return 0; else return 1;'
-+ incpath => ...
-+ libpath => ...
-+ lib => ...
-+ header => ...
-+ );
-+
-+In that case, it will fail to build if either foo() or libversion() don't
-+exist, and main() will return the wrong value if libversion()'s return
-+value isn't what you want.
-+
- =head1 FUNCTIONS
-
- All of these take the same named parameters and are exported by default.
-@@ -95,6 +114,11 @@
-
- This can also be supplied on the command-line.
-
-+=item debug
-+
-+If true - emit information during processing that can be used for
-+debugging.
-+
- =back
-
- And libraries are no use without header files, so ...
-@@ -133,6 +157,11 @@
- result -- which is what you want if an external library dependency is not
- available.
-
-+=head2 check_lib
-+
-+This behaves exactly the same as C<assert_lib()> except that it is silent,
-+returning false instead of dieing, or true otherwise.
-+
- =cut
-
- sub check_lib_or_exit {
-@@ -143,6 +172,11 @@
- }
- }
-
-+sub check_lib {
-+ eval 'assert_lib(@_)';
-+ return $@ ? 0 : 1;
-+}
-+
- sub assert_lib {
- my %args = @_;
- my (@libs, @libpaths, @headers, @incpaths);
-@@ -160,7 +194,7 @@
- # work-a-like for Makefile.PL's LIBS and INC arguments
- # if given as command-line argument, append to %args
- for my $arg (@ARGV) {
-- for my $mm_attr_key qw(LIBS INC) {
-+ for my $mm_attr_key (qw(LIBS INC)) {
- if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) {
- # it is tempting to put some \s* into the expression, but the
- # MM command-line parser only accepts LIBS etc. followed by =,
-@@ -173,7 +207,7 @@
- # using special form of split to trim whitespace
- if(defined($args{LIBS})) {
- foreach my $arg (split(' ', $args{LIBS})) {
-- die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-l/i);
-+ die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-[lLR]/);
- push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2);
- }
- }
-@@ -184,40 +218,68 @@
- }
- }
-
-- my @cc = _findcc();
-+ my ($cc, $ld) = _findcc();
- my @missing;
-+ my @wrongresult;
-+ my @use_headers;
-
- # first figure out which headers we can't find ...
- for my $header (@headers) {
-+ push @use_headers, $header;
- my($ch, $cfile) = File::Temp::tempfile(
- 'assertlibXXXXXXXX', SUFFIX => '.c'
- );
-- print $ch qq{#include <$header>\nint main(void) { return 0; }\n};
-+ my $ofile = $cfile;
-+ $ofile =~ s/\.c$/$Config{_o}/;
-+ print $ch qq{#include <$_>\n} for @use_headers;
-+ print $ch qq{int main(void) { return 0; }\n};
- close($ch);
- my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
- my @sys_cmd;
- # FIXME: re-factor - almost identical code later when linking
- if ( $Config{cc} eq 'cl' ) { # Microsoft compiler
- require Win32;
-- @sys_cmd = (@cc, $cfile, "/Fe$exefile", (map { '/I'.Win32::GetShortPathName($_) } @incpaths));
-+ @sys_cmd = (
-+ @$cc,
-+ $cfile,
-+ "/Fe$exefile",
-+ (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
-+ "/link",
-+ @$ld
-+ );
- } elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
-- @sys_cmd = (@cc, (map { "-I$_" } @incpaths), "-o$exefile", $cfile);
-- } else { # Unix-ish
-- # gcc, Sun, AIX (gcc, cc)
-- @sys_cmd = (@cc, $cfile, (map { "-I$_" } @incpaths), "-o", "$exefile");
-+ @sys_cmd = (
-+ @$cc,
-+ @$ld,
-+ (map { "-I$_" } @incpaths),
-+ "-o$exefile",
-+ $cfile
-+ );
-+ } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
-+ @sys_cmd = (
-+ @$cc,
-+ @$ld,
-+ $cfile,
-+ (map { "-I$_" } @incpaths),
-+ "-o", "$exefile"
-+ );
- }
- warn "# @sys_cmd\n" if $args{debug};
- my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
-- push @missing, $header if $rv != 0 || ! -x $exefile;
-+ push @missing, $header if $rv != 0 || ! -x $exefile;
- _cleanup_exe($exefile);
-+ unlink $ofile if -e $ofile;
- unlink $cfile;
- }
-
-- # now do each library in turn with no headers
-+ # now do each library in turn with headers
- my($ch, $cfile) = File::Temp::tempfile(
- 'assertlibXXXXXXXX', SUFFIX => '.c'
- );
-- print $ch "int main(void) { return 0; }\n";
-+ my $ofile = $cfile;
-+ $ofile =~ s/\.c$/$Config{_o}/;
-+ print $ch qq{#include <$_>\n} foreach (@headers);
-+ print $ch "int main(void) { ".($args{function} || 'return 0;')." }\n";
- close($ch);
- for my $lib ( @libs ) {
- my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
-@@ -227,27 +289,54 @@
- my @libpath = map {
- q{/libpath:} . Win32::GetShortPathName($_)
- } @libpaths;
-- @sys_cmd = (@cc, $cfile, "${lib}.lib", "/Fe$exefile",
-- "/link", @libpath
-+ # this is horribly sensitive to the order of arguments
-+ @sys_cmd = (
-+ @$cc,
-+ $cfile,
-+ "${lib}.lib",
-+ "/Fe$exefile",
-+ (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
-+ "/link",
-+ @$ld,
-+ (map {'/libpath:'.Win32::GetShortPathName($_)} @libpaths),
- );
- } elsif($Config{cc} eq 'CC/DECC') { # VMS
- } elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
-- my @libpath = map { "-L$_" } @libpaths;
-- @sys_cmd = (@cc, "-o$exefile", "-l$lib", @libpath, $cfile);
-+ @sys_cmd = (
-+ @$cc,
-+ @$ld,
-+ "-o$exefile",
-+ (map { "-I$_" } @incpaths),
-+ (map { "-L$_" } @libpaths),
-+ "-l$lib",
-+ $cfile);
- } else { # Unix-ish
- # gcc, Sun, AIX (gcc, cc)
-- my @libpath = map { "-L$_" } @libpaths;
-- @sys_cmd = (@cc, $cfile, "-o", "$exefile", "-l$lib", @libpath);
-+ @sys_cmd = (
-+ @$cc,
-+ @$ld,
-+ $cfile,
-+ "-o", "$exefile",
-+ (map { "-I$_" } @incpaths),
-+ (map { "-L$_" } @libpaths),
-+ "-l$lib",
-+ );
- }
- warn "# @sys_cmd\n" if $args{debug};
- my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
-- push @missing, $lib if $rv != 0 || ! -x $exefile;
-+ push @missing, $lib if $rv != 0 || ! -x $exefile;
-+ my $absexefile = File::Spec->rel2abs($exefile);
-+ $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/;
-+ push @wrongresult, $lib if $rv == 0 && -x $exefile && system($absexefile) != 0;
-+ unlink $ofile if -e $ofile;
- _cleanup_exe($exefile);
- }
- unlink $cfile;
-
- my $miss_string = join( q{, }, map { qq{'$_'} } @missing );
-- die("Can't link/include $miss_string\n") if @missing;
-+ die("Can't link/include C library $miss_string, aborting.\n") if @missing;
-+ my $wrong_string = join( q{, }, map { qq{'$_'} } @wrongresult);
-+ die("wrong result: $wrong_string\n") if @wrongresult;
- }
-
- sub _cleanup_exe {
-@@ -257,16 +346,37 @@
- unlink $exefile if -f $exefile;
- unlink $ofile if -f $ofile;
- unlink "$exefile\.manifest" if -f "$exefile\.manifest";
-+ if ( $Config{cc} eq 'cl' ) {
-+ # MSVC also creates foo.ilk and foo.pdb
-+ my $ilkfile = $exefile;
-+ $ilkfile =~ s/$Config{_exe}$/.ilk/;
-+ my $pdbfile = $exefile;
-+ $pdbfile =~ s/$Config{_exe}$/.pdb/;
-+ unlink $ilkfile if -f $ilkfile;
-+ unlink $pdbfile if -f $pdbfile;
-+ }
- return
- }
-
-+# return ($cc, $ld)
-+# where $cc is an array ref of compiler name, compiler flags
-+# where $ld is an array ref of linker flags
- sub _findcc {
-+ # Need to use $keep=1 to work with MSWin32 backslashes and quotes
-+ my $Config_ccflags = $Config{ccflags}; # use copy so ASPerl will compile
-+ my @Config_ldflags = ();
-+ for my $config_val ( @Config{qw(ldflags perllibs)} ){
-+ push @Config_ldflags, $config_val if ( $config_val =~ /\S/ );
-+ }
-+ my @ccflags = grep { length } quotewords('\s+', 1, $Config_ccflags||'');
-+ my @ldflags = grep { length } quotewords('\s+', 1, @Config_ldflags);
- my @paths = split(/$Config{path_sep}/, $ENV{PATH});
- my @cc = split(/\s+/, $Config{cc});
-- return @cc if -x $cc[0];
-+ return ( [ @cc, @ccflags ], \@ldflags ) if -x $cc[0];
- foreach my $path (@paths) {
- my $compiler = File::Spec->catfile($path, $cc[0]) . $Config{_exe};
-- return ($compiler, @cc[1 .. $#cc]) if -x $compiler;
-+ return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags)
-+ if -x $compiler;
- }
- die("Couldn't find your C compiler\n");
- }
-@@ -355,10 +465,14 @@
-
- David Golden E<lt>dagolden at cpan.orgE<gt>
-
-+Yasuhiro Matsumoto E<lt>mattn at cpan.orgE<gt>
-+
- Thanks to the cpan-testers-discuss mailing list for prompting us to write it
- in the first place;
-
--to Chris Williams for help with Borland support.
-+to Chris Williams for help with Borland support;
-+
-+to Tony Cook for help with Microsoft compiler command-line options
-
- =head1 COPYRIGHT and LICENCE
-
diff --git a/debian/patches/series b/debian/patches/series
index 7755101..8dccbc9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1 @@
-do-not-link-libz.patch
-file-5.10.patch
fix-checklib-fail.patch
-new-devel-checklib.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libfile-libmagic-perl.git
More information about the Pkg-perl-cvs-commits
mailing list