Hello community, here is the log from the commit of package perl-strictures for openSUSE:Factory checked in at 2015-11-11 10:31:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-strictures (Old) and /work/SRC/openSUSE:Factory/.perl-strictures.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-strictures" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-strictures/perl-strictures.changes 2015-06-30 10:19:09.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-strictures.new/perl-strictures.changes 2015-11-11 10:35:46.000000000 +0100 @@ -1,0 +2,10 @@ +Mon Nov 9 10:25:39 UTC 2015 - co...@suse.com + +- updated to 2.000002 + see /usr/share/doc/packages/perl-strictures/Changes + + 2.000002 - 2015-11-04 + - use ExtUtils::HasCompiler to detect compiler rather than ExtUtils::CBuilder + - more comprehensive testing + +------------------------------------------------------------------- Old: ---- strictures-2.000001.tar.gz New: ---- strictures-2.000002.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-strictures.spec ++++++ --- /var/tmp/diff_new_pack.oSPja2/_old 2015-11-11 10:35:47.000000000 +0100 +++ /var/tmp/diff_new_pack.oSPja2/_new 2015-11-11 10:35:47.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-strictures -Version: 2.000001 +Version: 2.000002 Release: 0 %define cpan_name strictures Summary: Turn On Strict and Make Most Warnings Fatal ++++++ strictures-2.000001.tar.gz -> strictures-2.000002.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/Changes new/strictures-2.000002/Changes --- old/strictures-2.000001/Changes 2015-06-28 09:38:05.000000000 +0200 +++ new/strictures-2.000002/Changes 2015-11-05 00:26:34.000000000 +0100 @@ -1,5 +1,9 @@ Release history for strictures +2.000002 - 2015-11-04 + - use ExtUtils::HasCompiler to detect compiler rather than ExtUtils::CBuilder + - more comprehensive testing + 2.000001 - 2015-06-28 - update for perl 5.22 warning categories - avoid using goto &UNIVERSAL::VERSION on perl 5.8, since it segfaults some diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/MANIFEST new/strictures-2.000002/MANIFEST --- old/strictures-2.000001/MANIFEST 2015-06-28 09:38:13.000000000 +0200 +++ new/strictures-2.000002/MANIFEST 2015-11-05 00:26:50.000000000 +0100 @@ -1,4 +1,5 @@ Changes +inc/ExtUtils/HasCompiler.pm lib/strictures.pm lib/strictures/extra.pm maint/Makefile.PL.include diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/META.json new/strictures-2.000002/META.json --- old/strictures-2.000001/META.json 2015-06-28 09:38:13.000000000 +0200 +++ new/strictures-2.000002/META.json 2015-11-05 00:26:50.000000000 +0100 @@ -4,7 +4,7 @@ "mst - Matt S. Trout (cpan:MSTROUT) <m...@shadowcat.co.uk>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001", + "generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], @@ -67,5 +67,5 @@ "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git" } }, - "version" : "2.000001" + "version" : "2.000002" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/META.yml new/strictures-2.000002/META.yml --- old/strictures-2.000001/META.yml 2015-06-28 09:38:12.000000000 +0200 +++ new/strictures-2.000002/META.yml 2015-11-05 00:26:50.000000000 +0100 @@ -6,7 +6,7 @@ Test::More: '0' configure_requires: {} dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001' +generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -26,4 +26,4 @@ bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=strictures license: http://dev.perl.org/licenses/ repository: git://git.shadowcat.co.uk/p5sagit/strictures.git -version: '2.000001' +version: '2.000002' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/Makefile.PL new/strictures-2.000002/Makefile.PL --- old/strictures-2.000001/Makefile.PL 2015-01-30 13:08:27.000000000 +0100 +++ new/strictures-2.000002/Makefile.PL 2015-10-27 19:08:34.000000000 +0100 @@ -1,11 +1,11 @@ use strict; use warnings FATAL => 'all'; use 5.006; +require "inc/ExtUtils/HasCompiler.pm"; my $have_compiler = ! parse_args()->{PUREPERL_ONLY} - && eval { require ExtUtils::CBuilder; 1 } - && ExtUtils::CBuilder->new->have_compiler; + && ExtUtils::HasCompiler::can_compile_loadable_object(quiet => 1); my %extra_prereqs = ( indirect => 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/inc/ExtUtils/HasCompiler.pm new/strictures-2.000002/inc/ExtUtils/HasCompiler.pm --- old/strictures-2.000001/inc/ExtUtils/HasCompiler.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/strictures-2.000002/inc/ExtUtils/HasCompiler.pm 2015-10-27 19:09:04.000000000 +0100 @@ -0,0 +1,212 @@ +package ExtUtils::HasCompiler; +$ExtUtils::HasCompiler::VERSION = '0.012'; +use strict; +use warnings; + +use base 'Exporter'; +our @EXPORT_OK = qw/can_compile_loadable_object/; +our %EXPORT_TAGS = (all => \@EXPORT_OK); + +use Config; +use Carp 'carp'; +use File::Basename 'basename'; +use File::Spec::Functions qw/catfile catdir/; +use File::Temp qw/tempdir tempfile/; + +my $tempdir = tempdir(CLEANUP => 1); + +my $loadable_object_format = <<'END'; +#define PERL_NO_GET_CONTEXT +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef PERL_UNUSED_VAR +#define PERL_UNUSED_VAR(var) +#endif + +XS(exported) { +#ifdef dVAR + dVAR; +#endif + dXSARGS; + + PERL_UNUSED_VAR(cv); /* -W */ + PERL_UNUSED_VAR(items); /* -W */ + + XSRETURN_IV(42); +} + +#ifndef XS_EXTERNAL +#define XS_EXTERNAL(foo) XS(foo) +#endif + +/* we don't want to mess with .def files on mingw */ +#if defined(WIN32) && defined(__GNUC__) +# define EXPORT __declspec(dllexport) +#else +# define EXPORT +#endif + +EXPORT XS_EXTERNAL(boot_%s) { +#ifdef dVAR + dVAR; +#endif + dXSARGS; + + PERL_UNUSED_VAR(cv); /* -W */ + PERL_UNUSED_VAR(items); /* -W */ + + newXS("%s::exported", exported, __FILE__); +} + +END + +my $counter = 1; +my %prelinking = map { $_ => 1 } qw/MSWin32 VMS aix/; + +sub can_compile_loadable_object { + my %args = @_; + + my $config = $args{config} || 'ExtUtils::HasCompiler::Config'; + return if not $config->get('usedl'); + + my ($source_handle, $source_name) = tempfile(DIR => $tempdir, SUFFIX => '.c', UNLINK => 1); + my $basename = basename($source_name, '.c'); + + my $shortname = '_Loadable' . $counter++; + my $package = "ExtUtils::HasCompiler::$shortname"; + printf $source_handle $loadable_object_format, $basename, $package or do { carp "Couldn't write to $source_name: $!"; return }; + close $source_handle or do { carp "Couldn't close $source_name: $!"; return }; + + my $abs_basename = catfile($tempdir, $basename); + my $object_file = $abs_basename . $config->get('_o'); + my $loadable_object = $abs_basename . '.' . $config->get('dlext'); + my $incdir = catdir($config->get('archlibexp'), 'CORE'); + + my ($cc, $ccflags, $optimize, $cccdlflags, $ld, $ldflags, $lddlflags, $libperl, $perllibs) = map { $config->get($_) } qw/cc ccflags optimize cccdlflags ld ldflags lddlflags libperl perllibs/; + + if ($prelinking{$^O}) { + require ExtUtils::Mksymlists; + ExtUtils::Mksymlists::Mksymlists(NAME => $basename, FILE => $abs_basename, IMPORTS => {}); + } + my @commands; + if ($^O eq 'MSWin32' && $cc =~ /^cl/) { + push @commands, qq{$cc $ccflags $cccdlflags $optimize /I "$incdir" /c $source_name /Fo$object_file}; + push @commands, qq{$ld $object_file $lddlflags $libperl $perllibs /out:$loadable_object /def:$abs_basename.def /pdb:$abs_basename.pdb}; + } + elsif ($^O eq 'VMS') { + # Mksymlists is only the beginning of the story. + open my $opt_fh, '>>', "$abs_basename.opt" or do { carp "Couldn't append to '$abs_basename.opt'"; return }; + print $opt_fh "PerlShr/Share\n"; + close $opt_fh; + + my $incdirs = $ccflags =~ s{ /inc[^=]+ (?:=)+ (?:\()? ( [^\/\)]* ) }{}xi ? "$1,$incdir" : $incdir; + push @commands, qq{$cc $ccflags $optimize /include=($incdirs) $cccdlflags $source_name /obj=$object_file}; + push @commands, qq{$ld $ldflags $lddlflags=$loadable_object $object_file,$abs_basename.opt/OPTIONS,${incdir}perlshr_attr.opt/OPTIONS' $perllibs}; + } + else { + my @extra; + if ($^O eq 'MSWin32') { + push @extra, "$abs_basename.def"; + push @extra, '-l' . ($libperl =~ /lib([^.]+)\./)[0]; + } + elsif ($^O eq 'cygwin') { + push @extra, catfile($incdir, $config->get('useshrplib') ? 'libperl.dll.a' : 'libperl.a'); + } + elsif ($^O eq 'aix') { + $lddlflags =~ s/\Q$(BASEEXT)\E/$abs_basename/; + $lddlflags =~ s/\Q$(PERL_INC)\E/$incdir/; + } + push @commands, qq{$cc $ccflags $optimize "-I$incdir" $cccdlflags -c $source_name -o $object_file}; + push @commands, qq{$cc $optimize $object_file -o $loadable_object $lddlflags @extra $perllibs}; + } + + for my $command (@commands) { + print "$command\n" if not $args{quiet}; + system $command and do { carp "Couldn't execute $command: $!"; return }; + } + + # Skip loading when cross-compiling + return 1 if exists $args{skip_load} ? $args{skip_load} : $config->get('usecrosscompile'); + + require DynaLoader; + local @DynaLoader::dl_require_symbols = "boot_$basename"; + my $handle = DynaLoader::dl_load_file($loadable_object, 0); + if ($handle) { + my $symbol = DynaLoader::dl_find_symbol($handle, "boot_$basename") or do { carp "Couldn't find boot symbol for $basename"; return }; + my $compilet = DynaLoader::dl_install_xsub('__ANON__::__ANON__', $symbol, $source_name); + my $ret = eval { $compilet->(); $package->exported } or carp $@; + delete $ExtUtils::HasCompiler::{"$shortname\::"}; + eval { DynaLoader::dl_unload_file($handle) } or carp $@; + return defined $ret && $ret == 42; + } + else { + carp "Couldn't load $loadable_object: " . DynaLoader::dl_error(); + return; + } +} + +sub ExtUtils::HasCompiler::Config::get { + my (undef, $key) = @_; + return $ENV{uc $key} || $Config{$key}; +} + +1; + +# ABSTRACT: Check for the presence of a compiler + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +ExtUtils::HasCompiler - Check for the presence of a compiler + +=head1 VERSION + +version 0.012 + +=head1 DESCRIPTION + +This module tries to check if the current system is capable of compiling, linking and loading an XS module. + +B<Notice>: this is an early release, interface stability isn't guaranteed yet. + +=head1 FUNCTIONS + +=head2 can_compile_loadable_object(%opts) + +This checks if the system can compile, link and load a perl loadable object. It may take the following options: + +=over 4 + +=item * quiet + +Do not output the executed compilation commands. + +=item * config + +An L<ExtUtils::Config|ExtUtils::Config> (compatible) object for configuration. + +=item * skip_load + +This causes can_compile_loadable_object to not try to load the generated object. This defaults to true on a cross-compiling perl. + +=back + +=head1 AUTHOR + +Leon Timmermans <le...@cpan.org> + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2014 by Leon Timmermans. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/lib/strictures.pm new/strictures-2.000002/lib/strictures.pm --- old/strictures-2.000001/lib/strictures.pm 2015-06-28 09:38:00.000000000 +0200 +++ new/strictures-2.000002/lib/strictures.pm 2015-11-05 00:26:28.000000000 +0100 @@ -10,7 +10,7 @@ *_CAN_GOTO_VERSION = ($] >= 5.010000) ? sub(){1} : sub(){0}; } -our $VERSION = '2.000001'; +our $VERSION = '2.000002'; $VERSION = eval $VERSION; our @WARNING_CATEGORIES = grep { exists $warnings::Offsets{$_} } qw( @@ -106,7 +106,7 @@ sub import { my $class = shift; - my %opts = ref $_[0] ? %{$_[0]} : @_; + my %opts = @_ == 1 ? %{$_[0]} : @_; if (!exists $opts{version}) { $opts{version} = exists $^H{strictures_enable} ? delete $^H{strictures_enable} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/maint/Makefile.PL.include new/strictures-2.000002/maint/Makefile.PL.include --- old/strictures-2.000001/maint/Makefile.PL.include 2015-02-01 21:49:02.000000000 +0100 +++ new/strictures-2.000002/maint/Makefile.PL.include 2015-10-27 19:07:28.000000000 +0100 @@ -3,3 +3,7 @@ use Distar; author 'mst - Matt S. Trout (cpan:MSTROUT) <m...@shadowcat.co.uk>'; + +manifest_include inc => '.pm'; + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/t/extras.t new/strictures-2.000002/t/extras.t --- old/strictures-2.000001/t/extras.t 2015-05-28 02:14:23.000000000 +0200 +++ new/strictures-2.000002/t/extras.t 2015-11-04 00:56:22.000000000 +0100 @@ -5,9 +5,7 @@ : (skip_all => 'Extra tests disabled on perls <= 5.008003'); use File::Temp; - -my $tempdir = File::Temp::tempdir(CLEANUP => 1, TMPDIR => 1); -chdir $tempdir; +use Cwd 'cwd'; my %extras; BEGIN { @@ -27,100 +25,108 @@ $indirect++; }; -{ +my $cwd = cwd; +for my $version ( 1, 2 ) { + + my $tempdir = File::Temp::tempdir('strictures-XXXXXX', CLEANUP => 1, TMPDIR => 1); + chdir $tempdir; + local $strictures::Smells_Like_VCS = undef; eval qq{ #line 1 "t/nogit.t" -use strictures; +use strictures $version; 1; } or die "$@"; - ok defined $strictures::Smells_Like_VCS, 'VCS dir has been checked'; - ok !$strictures::Smells_Like_VCS, 'VCS dir not detected with no .git'; -} + ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)"; + ok !$strictures::Smells_Like_VCS, "VCS dir not detected with no .git (v$version)"; -mkdir '.git'; + mkdir '.git'; -{ - local $strictures::Smells_Like_VCS = undef; - eval qq{ + { + local $strictures::Smells_Like_VCS = undef; + eval qq{ #line 1 "t/withgit.t" -use strictures; -1; -} or die "$@"; - ok defined $strictures::Smells_Like_VCS, 'VCS dir has been checked'; - ok $strictures::Smells_Like_VCS, 'VCS dir detected with .git'; -} +use strictures $version; + 1; + } or die "$@"; + ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)"; + ok $strictures::Smells_Like_VCS, "VCS dir detected with .git (v$version)"; + } -$strictures::Smells_Like_VCS = 1; + chdir $cwd; + rmdir $tempdir; -for my $check ( - ["file.pl" => 0], - ["test.pl" => 0], - ["library.pm" => 0], - ["t/test.t" => 1], - ["xt/test.t" => 1], - ["t/one.faket" => 1], - ["lib/module.pm" => 1], - ["other/one.pl" => 0], - ["other/t/test.t" => 0], - ["blib/module.pm" => 1], -) { - my ($file, $want) = @$check; - $indirect = 0; - eval qq{ + local $strictures::Smells_Like_VCS = 1; + + for my $check ( + ["file.pl" => 0], + ["test.pl" => 0], + ["library.pm" => 0], + ["t/test.t" => 1], + ["xt/test.t" => 1], + ["t/one.faket" => 1], + ["lib/module.pm" => 1], + ["other/one.pl" => 0], + ["other/t/test.t" => 0], + ["blib/module.pm" => 1], + ) { + my ($file, $want) = @$check; + $indirect = 0; + eval qq{ #line 1 "$file" -use strictures; +use strictures $version; 1; - } or die "$@"; - my $not = $want ? '' : ' not'; - is $indirect, $want, - "file named $file does$not get extras"; -} - -{ - local $ENV{PERL_STRICTURES_EXTRA} = 1; - local %strictures::extra_load_states = (); - local @INC = (sub { - die "Can't locate $_[1] in \@INC (...).\n" - if $extras{$_[1]}; - }, @INC); - local %INC = %INC; - delete $INC{$_} - for keys %extras; + } or die "$@"; + my $not = $want ? '' : ' not'; + is $indirect, $want, + "file named $file does$not get extras (v$version)"; + } { - open my $fh, '>', \(my $str = ''); - my $e; + local $ENV{PERL_STRICTURES_EXTRA} = 1; + local %strictures::extra_load_states = (); + local @INC = (sub { + die "Can't locate $_[1] in \@INC (...).\n" + if $extras{$_[1]}; + }, @INC); + local %INC = %INC; + delete $INC{$_} + for keys %extras; + { - local *STDERR = $fh; - eval qq{ + open my $fh, '>', \(my $str = ''); + my $e; + { + local *STDERR = $fh; + eval qq{ #line 1 "t/load_fail.t" -use strictures; +use strictures $version; 1; - } or $e = "$@"; + } or $e = "$@"; + } + die $e if defined $e; + + like( + $str, + qr/Missing were:\n\n indirect multidimensional bareword::filehandles/, + "failure to load all three extra deps is reported (v$version)" + ); } - die $e if defined $e; - - like( - $str, - qr/Missing were:\n\n indirect multidimensional bareword::filehandles/, - "failure to load all three extra deps is reported" - ); - } - { - open my $fh, '>', \(my $str = ''); - my $e; { - local *STDERR = $fh; - eval qq{ + open my $fh, '>', \(my $str = ''); + my $e; + { + local *STDERR = $fh; + eval qq{ #line 1 "t/load_fail.t" -use strictures; +use strictures $version; 1; - } or $e = "$@"; - } - die $e if defined $e; + } or $e = "$@"; + } + die $e if defined $e; - is $str, '', "extra dep load failure is not reported a second time"; + is $str, '', "extra dep load failure is not reported a second time (v$version)"; + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strictures-2.000001/t/strictures.t new/strictures-2.000002/t/strictures.t --- old/strictures-2.000001/t/strictures.t 2015-06-28 09:37:21.000000000 +0200 +++ new/strictures-2.000002/t/strictures.t 2015-11-04 00:56:22.000000000 +0100 @@ -62,6 +62,16 @@ like $@, qr/strictures version $next required/, "Can't use strictures $next (this is version $v)"; +eval qq{ use strictures {version => $next}; }; + +like $@, qr/Major version specified as $next - not supported/, + "Can't use strictures version option $next (this is version $v)"; + +eval qq{ use strictures {version => undef}; }; + +like $@, qr/Major version specified as undef - not supported/, + "Can't use strictures version option undef"; + eval qq{ use strictures $strictures::VERSION; }; is $@, '',