diff -Nru libmodule-install-autolicense-perl-0.08/Changes libmodule-install-autolicense-perl-0.10/Changes --- libmodule-install-autolicense-perl-0.08/Changes 2010-04-30 14:29:45.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/Changes 2017-02-17 13:23:28.000000000 +0000 @@ -1,6 +1,9 @@ Changelog for Module-Install-AutoLicense ======================================== +0.10 Fri Feb 17 13:22:59 GMT 2017 + - Handle perls without dot in @INC correctly + 0.08 Fri Apr 30 15:29:09 BST 2010 - Missed a test when making the parallel test execution work. diff -Nru libmodule-install-autolicense-perl-0.08/debian/changelog libmodule-install-autolicense-perl-0.10/debian/changelog --- libmodule-install-autolicense-perl-0.08/debian/changelog 2012-06-03 12:26:42.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/changelog 2019-01-16 12:08:55.000000000 +0000 @@ -1,3 +1,48 @@ +libmodule-install-autolicense-perl (0.10-1) unstable; urgency=medium + + [ upstream ] + * New release. + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ gregor herrmann ] + * debian/*: update URLs from {search,www}.cpan.org to MetaCPAN. + + [ Jonas Smedegaard ] + * Simplify rules: + + Stop resolve build-dependencies in rules file. + + Stop resolve binary package relations in rules file. + + Drop get-orig-source target: Use gbp import-orig --uscan. + + Do copyright-check in maintainer script (not during build). + Stop build-depend on devscripts. + + Use short-form dh sequencer (not cdbs). + Stop build-depend on cdbs. + * Stop build-depend on dh-buildinfo. + * Relax to (build-)depend unversioned on libmodule-install-perl: + Needed version satisfied even in oldstable. + * Mark build-dependency needed only for testsuite as such. + * Set Rules-Requires-Root: no. + * Enable autopkgtest. + * Declare compliance with Debian Policy 4.3.0. + * Bump debhelper compatibility level to 9. + * Wrap and sort control file. + * Update copyright info: + + Use https protocol in file format URL. + + Use License-Grant and License-Reference. + + Rewrap using semantic linefeeds. + + Extend ownership coverage for packaging. + + Relicense packaging as GPL-3+. + * Add lintian overrides regarding License-Reference. + * Update watch file: + + Bump to file format 4. + + Mention gbp --uscan in usage comment. + + Use substitution strings. + + Drop superfluous version mangling. + * Update git-buildpackage: Filter any .git* file. + + -- Jonas Smedegaard Wed, 16 Jan 2019 13:08:55 +0100 + libmodule-install-autolicense-perl (0.08-1) unstable; urgency=low * Initial packaging release. diff -Nru libmodule-install-autolicense-perl-0.08/debian/compat libmodule-install-autolicense-perl-0.10/debian/compat --- libmodule-install-autolicense-perl-0.08/debian/compat 2011-02-09 01:03:08.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/compat 2019-01-16 11:44:30.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru libmodule-install-autolicense-perl-0.08/debian/control libmodule-install-autolicense-perl-0.10/debian/control --- libmodule-install-autolicense-perl-0.08/debian/control 2012-06-03 12:29:31.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/control 2019-01-16 11:45:03.000000000 +0000 @@ -1,28 +1,29 @@ Source: libmodule-install-autolicense-perl Section: perl Priority: optional -Build-Depends: devscripts, - cdbs (>= 0.4.73~), - perl, +Build-Depends: debhelper, - dh-buildinfo, - libmodule-install-perl (>= 0.85), + libcapture-tiny-perl , + libmodule-install-perl, libsoftware-license-perl, - libcapture-tiny-perl + perl, Maintainer: Debian Perl Group -Uploaders: Jonas Smedegaard -Standards-Version: 3.9.3 -Vcs-Git: git://git.debian.org/git/pkg-perl/packages/libmodule-install-autolicense-perl -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libmodule-install-autolicense-perl.git -Homepage: http://search.cpan.org/dist/Module-Install-AutoLicense/ +Uploaders: + Jonas Smedegaard , +Standards-Version: 4.3.0 +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libmodule-install-autolicense-perl.git +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libmodule-install-autolicense-perl +Homepage: https://metacpan.org/release/Module-Install-AutoLicense +Rules-Requires-Root: no +Testsuite: autopkgtest-pkg-perl Package: libmodule-install-autolicense-perl Architecture: all -Depends: ${cdbs:Depends}, +Depends: + libmodule-install-perl, + libsoftware-license-perl, ${misc:Depends}, - ${perl:Depends} -Recommends: ${cdbs:Recommends} -Suggests: ${cdbs:Suggests} + ${perl:Depends}, Description: automagically generate LICENSE files Module::Install::AutoLicense is a Module::Install extension that generates a "LICENSE" file automatically whenever the author runs diff -Nru libmodule-install-autolicense-perl-0.08/debian/control.in libmodule-install-autolicense-perl-0.10/debian/control.in --- libmodule-install-autolicense-perl-0.08/debian/control.in 2012-06-03 11:36:15.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/control.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Source: libmodule-install-autolicense-perl -Section: perl -Priority: optional -Build-Depends: @cdbs@ -Maintainer: Debian Perl Group -Uploaders: Jonas Smedegaard -Standards-Version: 3.9.3 -Vcs-Git: git://git.debian.org/git/pkg-perl/packages/libmodule-install-autolicense-perl -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libmodule-install-autolicense-perl.git -Homepage: http://search.cpan.org/dist/Module-Install-AutoLicense/ - -Package: libmodule-install-autolicense-perl -Architecture: all -Depends: ${cdbs:Depends}, - ${misc:Depends}, - ${perl:Depends} -Recommends: ${cdbs:Recommends} -Suggests: ${cdbs:Suggests} -Description: automagically generate LICENSE files - Module::Install::AutoLicense is a Module::Install extension that - generates a "LICENSE" file automatically whenever the author runs - "Makefile.PL". On the user side it does nothing. - . - When "make distclean" is invoked by the author, the "LICENSE" is - removed. - . - The appropriate license is determined from the meta provided with the - "license" command and the holder of the license from the "author" - command. - . - Software::License is used to generate the "LICENSE" file. diff -Nru libmodule-install-autolicense-perl-0.08/debian/copyright libmodule-install-autolicense-perl-0.10/debian/copyright --- libmodule-install-autolicense-perl-0.08/debian/copyright 2012-06-03 11:41:57.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/copyright 2019-01-16 11:55:37.000000000 +0000 @@ -1,72 +1,65 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Module::Install::AutoLicense Upstream-Contact: Chris Williams -Source: http://search.cpan.org/dist/Module-Install-AutoLicense/ +Source: https://metacpan.org/release/Module-Install-AutoLicense Files: * Copyright: 2009, Chris Williams +License-Grant: + This module may be used, modified, and distributed + under the same terms as Perl itself. + Please see the license that came with your Perl distribution + for details. License: Artistic or GPL-1+ - This module may be used, modified, and distributed under the same terms - as Perl itself. Please see the license that came with your Perl - distribution for details. Comment: - Perl 5 is licensed under either the 'Artistic license' or the 'GNU - General Public License' version 1 or later. + Perl 5 is licensed under either the Artistic license + or the GNU General Public License version 1 or later. Files: inc/Module/Install* Copyright: 2001-2006, Audrey Tang 2002-2004, Brian Ingerson 2006,2008-2012, Adam Kennedy -License: Artistic or GPL-1+ - This program is free software; you can redistribute it and/or modify it +License-Grant: + This program is free software; + you can redistribute it and/or modify it under the same terms as Perl itself. +License: Artistic or GPL-1+ Comment: - Code lacks licensing, but is clearly a mangled convenience copy of - Module::Install containing above copyright and licensing. + Code lacks licensing, but is clearly a mangled convenience copy + of Module::Install containing above copyright and licensing. Files: inc/Module/Package.pm inc/Module/Install/Package.pm Copyright: 2011, Ingy döt Net License: Artistic or GPL-1+ Comment: - Code lacks licensing, but is clearly a mangled convenience copy of - Module::Package containing above copyright and licensing. + Code lacks licensing, but is clearly a mangled convenience copy + of Module::Package containing above copyright and licensing. Files: inc/Module/Install/GithubMeta.pm Copyright: Chris Williams Tatsuhiko Miyagawa License: Artistic or GPL-1+ Comment: - Code lacks licensing, but is clearly a mangled convenience copy of - Module::Install::GithubMeta containing above copyright and licensing. + Code lacks licensing, but is clearly a mangled convenience copy + of Module::Install::GithubMeta + containing above copyright and licensing. Files: debian/* -Copyright: 2012, Jonas Smedegaard -License: GPL-2+ +Copyright: 2012-2013,2016-2019, Jonas Smedegaard +License-Grant: + This program is free software; + you can redistribute it and/or modify it + under the terms of the GNU General Public License + as published by the Free Software Foundation; + either version 3, or (at your option) any later version. +License: GPL-3+ License: Artistic -Comment: - On Debian systems the 'Artistic License' is located in - '/usr/share/common-licenses/Artistic'. +License-Reference: /usr/share/common-licenses/Artistic License: GPL-1+ -Comment: - On Debian systems the 'GNU General Public License' version 1 is located - in '/usr/share/common-licenses/GPL-1'. +License-Reference: /usr/share/common-licenses/GPL-1 -License: GPL-2+ - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. -Comment: - On Debian systems the 'GNU General Public License' version 2 is located - in '/usr/share/common-licenses/GPL-2'. - . - You should have received a copy of the 'GNU General Public License' - along with this program. If not, see . +License: GPL-3+ +License-Reference: /usr/share/common-licenses/GPL-3 diff -Nru libmodule-install-autolicense-perl-0.08/debian/copyright-check libmodule-install-autolicense-perl-0.10/debian/copyright-check --- libmodule-install-autolicense-perl-0.08/debian/copyright-check 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/copyright-check 2018-06-30 13:49:21.000000000 +0000 @@ -0,0 +1,29 @@ +#!/bin/sh +# Copyright © 2016-2017 Jonas Smedegaard +# Description: helper script to update copyright_hints +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -eu + +# extract metadata from binary files before copyright check +# - but skip file formats unlikely to contain relevant metadata +export DEB_COPYRIGHT_EXTRACT_EXTS="png" +export DEB_COPYRIGHT_CHECK_IGNORE_EXTS="ico" + +make -f /usr/share/cdbs/1/rules/utils.mk pre-build || true +make -f /usr/share/cdbs/1/rules/utils.mk clean DEB_COPYRIGHT_CHECK_STRICT=1 + +# unconditionally merge changes - safe to do with git-tracked package +[ ! -f debian/copyright_newhints ] || mv -f debian/copyright_newhints debian/copyright_hints diff -Nru libmodule-install-autolicense-perl-0.08/debian/copyright_hints libmodule-install-autolicense-perl-0.10/debian/copyright_hints --- libmodule-install-autolicense-perl-0.08/debian/copyright_hints 2012-06-03 12:27:33.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/copyright_hints 2019-01-16 12:08:55.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: FIXME Upstream-Contact: FIXME Source: FIXME @@ -10,8 +10,8 @@ Makefile.PL debian/compat debian/control - debian/control.in debian/gbp.conf + debian/rules debian/source/format debian/watch have_make @@ -28,54 +28,61 @@ t/03_authors.t t/99_pod.t t/99_pod_coverage.t -Copyright: *No copyright* +Copyright: NONE License: UNKNOWN FIXME -Files: debian/rules -Copyright: 2012, Jonas Smedegaard -License: GPL-2+ +Files: inc/Module/Install/Metadata.pm +Copyright: NONE +License: AGPL and/or BSD~unspecified FIXME Files: LICENSE -Copyright: 1989, Free Software Foundation, Inc +Copyright: 1989, Free Software Foundation, Inc. 19xx name of author 19yy - 2009, Chris Williams - HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - HOLDERS AND/OR OTHER PARTIES - Holder - Holder maintains some semblance of - Holder may not be used to endorse or promote - Holder to include your - Holder" is whoever is named in the or s for - Holder, but only to the - Holder. A Package modified in such + 2017, Chris Williams . disclaimer" for the program, if - holder saying it may be + ed by the Free interest in the - notices and associated disclaimers + of this Package, but belong to whomever generated them, and may be sold the software, and -License: GPL-ever +License: Artistic or GPL-1+ FIXME -Files: inc/Module/Install/Metadata.pm -Copyright: -License: MIT/X11 (BSD like) +Files: README +Copyright: Chris Williams +License: Artistic or GPL-1+ FIXME -Files: inc/Module/Install.pm -Copyright: 2008, - 2010, Adam Kennedy -License: UNKNOWN +Files: lib/Module/Install/AutoLicense.pm +Copyright: E Chris Williams +License: Artistic or GPL-1+ and/or BSD~unspecified FIXME -Files: README -Copyright: Chris Williams +Files: inc/Module/Install/AutoLicense.pm +Copyright: NONE +License: BSD~unspecified + FIXME + +Files: debian/copyright-check +Copyright: 2016-2017, Jonas Smedegaard + check +License: GPL-3+ + FIXME + +Files: inc/Module/Install.pm +Copyright: 2008-2012, Adam Kennedy. License: UNKNOWN FIXME -Files: lib/Module/Install/AutoLicense.pm -Copyright: E Chris Williams +Files: debian/source/lintian-overrides +Copyright: Artistic + GPL-1+ + GPL-3+ + artistic + gpl-1+ + gpl-3+ License: UNKNOWN FIXME diff -Nru libmodule-install-autolicense-perl-0.08/debian/docs libmodule-install-autolicense-perl-0.10/debian/docs --- libmodule-install-autolicense-perl-0.08/debian/docs 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/docs 2019-01-16 12:08:55.000000000 +0000 @@ -0,0 +1 @@ +README diff -Nru libmodule-install-autolicense-perl-0.08/debian/gbp.conf libmodule-install-autolicense-perl-0.10/debian/gbp.conf --- libmodule-install-autolicense-perl-0.08/debian/gbp.conf 2010-05-14 14:58:56.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/gbp.conf 2019-01-16 00:21:04.000000000 +0000 @@ -3,3 +3,4 @@ [DEFAULT] pristine-tar = True sign-tags = True +filter = */.git* diff -Nru libmodule-install-autolicense-perl-0.08/debian/rules libmodule-install-autolicense-perl-0.10/debian/rules --- libmodule-install-autolicense-perl-0.08/debian/rules 2012-06-03 12:21:26.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/rules 2019-01-16 11:39:16.000000000 +0000 @@ -1,36 +1,4 @@ #!/usr/bin/make -f -# -*- mode: makefile; coding: utf-8 -*- -# Copyright 2012, Jonas Smedegaard -# Description: Main Debian packaging script for Module::Install::AutoLicense -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -include /usr/share/cdbs/1/rules/upstream-tarball.mk -include /usr/share/cdbs/1/rules/utils.mk -include /usr/share/cdbs/1/class/perl-makemaker.mk -include /usr/share/cdbs/1/rules/debhelper.mk - -DEB_UPSTREAM_PACKAGE = Module-Install-AutoLicense -DEB_UPSTREAM_URL = http://www.cpan.org/modules/by-module/Module -DEB_UPSTREAM_TARBALL_BASENAME_MANGLE = s/~/_/ -DEB_UPSTREAM_TARBALL_MD5 = 1bdc939ddf41388ee6893f1339726d09 - -# Needed both by upstream build process and at runtime -deps = libmodule-install-perl (>= 0.85), libsoftware-license-perl - -CDBS_BUILD_DEPENDS += , $(deps) -CDBS_DEPENDS_ALL = $(deps) - -# Needed by upstream testsuite -CDBS_BUILD_DEPENDS += , libcapture-tiny-perl +%: + dh $@ diff -Nru libmodule-install-autolicense-perl-0.08/debian/source/lintian-overrides libmodule-install-autolicense-perl-0.10/debian/source/lintian-overrides --- libmodule-install-autolicense-perl-0.08/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/source/lintian-overrides 2018-11-02 20:20:45.000000000 +0000 @@ -0,0 +1,7 @@ +# License is in License-Reference field (see bug#786450) +missing-license-paragraph-in-dep5-copyright artistic * +missing-license-paragraph-in-dep5-copyright gpl-1\+ * +missing-license-paragraph-in-dep5-copyright gpl-3\+ * +missing-license-text-in-dep5-copyright Artistic * +missing-license-text-in-dep5-copyright GPL-1\+ * +missing-license-text-in-dep5-copyright GPL-3\+ * diff -Nru libmodule-install-autolicense-perl-0.08/debian/watch libmodule-install-autolicense-perl-0.10/debian/watch --- libmodule-install-autolicense-perl-0.08/debian/watch 2012-06-03 11:32:54.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/debian/watch 2019-01-16 11:57:06.000000000 +0000 @@ -1,4 +1,4 @@ -# Run the "uscan" command to check for upstream updates and more. -version=3 -opts=uversionmangle=s/_(\d+)/~$1/ \ -http://search.cpan.org/dist/Module-Install-AutoLicense/ .*/Module-Install-AutoLicense-([\d._]+)\.tar\.gz debian +# run "uscan --report" to check or "gbp import-orig --uscan" to update +version=4 +https://metacpan.org/release/Module-Install-AutoLicense \ +.*/Module-Install-AutoLicense-@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/AutoLicense.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/AutoLicense.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/AutoLicense.pm 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/AutoLicense.pm 2017-02-17 13:25:37.000000000 +0000 @@ -0,0 +1,63 @@ +#line 1 +package Module::Install::AutoLicense; + +use strict; +use warnings; +use base qw(Module::Install::Base); +use vars qw($VERSION); + +$VERSION = '0.10'; + +my %licenses = ( + perl => 'Software::License::Perl_5', + apache => 'Software::License::Apache_2_0', + artistic => 'Software::License::Artistic_1_0', + artistic_2 => 'Software::License::Artistic_2_0', + lgpl2 => 'Software::License::LGPL_2_1', + lgpl3 => 'Software::License::LGPL_3_0', + bsd => 'Software::License::BSD', + gpl => 'Software::License::GPL_1', + gpl2 => 'Software::License::GPL_2', + gpl3 => 'Software::License::GPL_3', + mit => 'Software::License::MIT', + mozilla => 'Software::License::Mozilla_1_1', +); + +sub auto_license { + my $self = shift; + return unless $Module::Install::AUTHOR; + my %opts = @_; + $opts{lc $_} = delete $opts{$_} for keys %opts; + my $holder = $opts{holder} || _get_authors( $self ); + #my $holder = $opts{holder} || $self->author; + my $license = $self->license(); + unless ( defined $licenses{ $license } ) { + warn "No license definition for '$license', aborting\n"; + return 1; + } + my $class = $licenses{ $license }; + eval "require $class"; + my $sl = $class->new( { holder => $holder } ); + open LICENSE, '>LICENSE' or die "$!\n"; + print LICENSE $sl->fulltext; + close LICENSE; + $self->postamble(<<"END"); +distclean :: license_clean + +license_clean: +\t\$(RM_F) LICENSE +END + + return 1; +} + +sub _get_authors { + my $self = shift; + my $joined = join ', ', @{ $self->author() || [] }; + return $joined; +} + +'Licensed to auto'; +__END__ + +#line 125 diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Base.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Base.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Base.pm 2010-04-30 14:30:42.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Base.pm 2017-02-17 13:25:37.000000000 +0000 @@ -4,7 +4,7 @@ use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; } # Suspend handler for "redefined" warnings @@ -51,13 +51,18 @@ #line 106 sub is_admin { - $_[0]->admin->VERSION; + ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; +use vars qw{$VERSION}; +BEGIN { + $VERSION = $Module::Install::Base::VERSION; +} + my $fake; sub new { @@ -75,4 +80,4 @@ 1; -#line 154 +#line 159 diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Can.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Can.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Can.pm 2010-04-30 14:30:42.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Can.pm 2017-02-17 13:25:37.000000000 +0000 @@ -3,13 +3,12 @@ use strict; use Config (); -use File::Spec (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -29,7 +28,7 @@ eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } -# check if we can run some command +# Check if we can run some command sub can_run { my ($self, $cmd) = @_; @@ -38,16 +37,99 @@ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; - my $abs = File::Spec->catfile($dir, $_[1]); + require File::Spec; + my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } -# can we locate a (the) C compiler +# Can our C compiler environment build XS files +sub can_xs { + my $self = shift; + + # Ensure we have the CBuilder module + $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); + + # Do we have the configure_requires checker? + local $@; + eval "require ExtUtils::CBuilder;"; + if ( $@ ) { + # They don't obey configure_requires, so it is + # someone old and delicate. Try to avoid hurting + # them by falling back to an older simpler test. + return $self->can_cc(); + } + + # Do we have a working C compiler + my $builder = ExtUtils::CBuilder->new( + quiet => 1, + ); + unless ( $builder->have_compiler ) { + # No working C compiler + return 0; + } + + # Write a C file representative of what XS becomes + require File::Temp; + my ( $FH, $tmpfile ) = File::Temp::tempfile( + "compilexs-XXXXX", + SUFFIX => '.c', + ); + binmode $FH; + print $FH <<'END_C'; +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main(int argc, char **argv) { + return 0; +} + +int boot_sanexs() { + return 1; +} + +END_C + close $FH; + + # Can the C compiler access the same headers XS does + my @libs = (); + my $object = undef; + eval { + local $^W = 0; + $object = $builder->compile( + source => $tmpfile, + ); + @libs = $builder->link( + objects => $object, + module_name => 'sanexs', + ); + }; + my $result = $@ ? 0 : 1; + + # Clean up all the build files + foreach ( $tmpfile, $object, @libs ) { + next unless defined $_; + 1 while unlink; + } + + return $result; +} + +# Can we locate a (the) C compiler sub can_cc { my $self = shift; + + if ($^O eq 'VMS') { + require ExtUtils::CBuilder; + my $builder = ExtUtils::CBuilder->new( + quiet => 1, + ); + return $builder->have_compiler; + } + my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part @@ -78,4 +160,4 @@ __END__ -#line 156 +#line 245 diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Fetch.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Fetch.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Fetch.pm 2010-04-30 14:30:43.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Fetch.pm 2017-02-17 13:25:37.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/GithubMeta.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/GithubMeta.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/GithubMeta.pm 2010-04-30 14:30:43.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/GithubMeta.pm 2017-02-17 13:25:37.000000000 +0000 @@ -7,19 +7,22 @@ use base qw(Module::Install::Base); use vars qw($VERSION); -$VERSION = '0.10'; +$VERSION = '0.30'; sub githubmeta { my $self = shift; return unless $Module::Install::AUTHOR; return unless _under_git(); return unless $self->can_run('git'); - return unless my ($git_url) = `git remote show -n origin` =~ /URL: (.*)$/m; + my $remote = shift || 'origin'; + local $ENV{LC_ALL}='C'; + local $ENV{LANG}='C'; + return unless my ($git_url) = `git remote show -n $remote` =~ /URL: (.*)$/m; return unless $git_url =~ /github\.com/; # Not a Github repository my $http_url = $git_url; $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; - $http_url =~ s![\w\-]+\@([^:]+):!http://$1/!; - $http_url =~ s!\.git$!/tree!; + $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!; + $http_url =~ s!\.git$!/!; $self->repository( $git_url ); $self->homepage( $http_url ) unless $self->homepage(); return 1; @@ -47,4 +50,4 @@ 'Github'; __END__ -#line 108 +#line 113 diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Makefile.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Makefile.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Makefile.pm 2010-04-30 14:30:42.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Makefile.pm 2017-02-17 13:25:37.000000000 +0000 @@ -4,10 +4,11 @@ use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); +use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -101,24 +102,26 @@ my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { - if ($makemaker_argtype{$key} eq 'ARRAY') { - $args->{$key} = [] unless defined $args->{$key}; - unless (ref $args->{$key} eq 'ARRAY') { - $args->{$key} = [$args->{$key}] + if ($makemaker_argtype{$key}) { + if ($makemaker_argtype{$key} eq 'ARRAY') { + $args->{$key} = [] unless defined $args->{$key}; + unless (ref $args->{$key} eq 'ARRAY') { + $args->{$key} = [$args->{$key}] + } + push @{$args->{$key}}, + ref $new_args{$key} eq 'ARRAY' + ? @{$new_args{$key}} + : $new_args{$key}; } - push @{$args->{$key}}, - ref $new_args{$key} eq 'ARRAY' - ? @{$new_args{$key}} - : $new_args{$key}; - } - elsif ($makemaker_argtype{$key} eq 'HASH') { - $args->{$key} = {} unless defined $args->{$key}; - foreach my $skey (keys %{ $new_args{$key} }) { - $args->{$key}{$skey} = $new_args{$key}{$skey}; + elsif ($makemaker_argtype{$key} eq 'HASH') { + $args->{$key} = {} unless defined $args->{$key}; + foreach my $skey (keys %{ $new_args{$key} }) { + $args->{$key}{$skey} = $new_args{$key}{$skey}; + } + } + elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { + $self->makemaker_append($key => $new_args{$key}); } - } - elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { - $self->makemaker_append($key => $new_args{$key}); } else { if (defined $args->{$key}) { @@ -130,7 +133,7 @@ return $args; } -# For mm args that take multiple space-seperated args, +# For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; @@ -178,28 +181,22 @@ $self->makemaker_args( INC => shift ); } -my %test_dir = (); - sub _wanted_t { - /\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1; } sub tests_recursive { my $self = shift; - if ( $self->tests ) { - die "tests_recursive will not work if tests are already defined"; - } my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } - %test_dir = (); + my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; - File::Find::find( \&_wanted_t, $dir ); - if ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { - File::Find::find( \&_wanted_t, 'xt' ); - } - $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir ); + File::Find::find( + sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, + $dir + ); + $self->tests( join ' ', sort keys %tests ); } sub write { @@ -218,18 +215,22 @@ require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { - # MakeMaker can complain about module versions that include - # an underscore, even though its own version may contain one! - # Hence the funny regexp to get rid of it. See RT #35800 - # for details. - my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; - $self->build_requires( 'ExtUtils::MakeMaker' => $v ); - $self->configure_requires( 'ExtUtils::MakeMaker' => $v ); + # This previous attempted to inherit the version of + # ExtUtils::MakeMaker in use by the module author, but this + # was found to be untenable as some authors build releases + # using future dev versions of EU:MM that nobody else has. + # Instead, #toolchain suggests we use 6.59 which is the most + # stable version on CPAN at time of writing and is, to quote + # ribasushi, "not terminally fucked, > and tested enough". + # TODO: We will now need to maintain this over time to push + # the version up as new versions are released. + $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. - $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); - $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); + $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params @@ -244,13 +245,15 @@ 'all_from' if you prefer) in Makefile.PL. EOT - $DB::single = 1; if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; + } elsif ( $Module::Install::ExtraTests::use_extratests ) { + # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. + # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), @@ -297,13 +300,22 @@ # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; - # Delete bundled dists from prereq_pm - my $subdirs = ($args->{DIR} ||= []); + # Delete bundled dists from prereq_pm, add it to Makefile DIR + my $subdirs = ($args->{DIR} || []); if ($self->bundles) { + my %processed; foreach my $bundle (@{ $self->bundles }) { - my ($file, $dir) = @$bundle; - push @$subdirs, $dir if -d $dir; - delete $build_prereq->{$file}; #Delete from build prereqs only + my ($mod_name, $dist_dir) = @$bundle; + delete $prereq->{$mod_name}; + $dist_dir = File::Basename::basename($dist_dir); # dir for building this module + if (not exists $processed{$dist_dir}) { + if (-d $dist_dir) { + # List as sub-directory to be processed by make + push @$subdirs, $dist_dir; + } + # Else do nothing: the module is already present on the system + $processed{$dist_dir} = undef; + } } } @@ -356,9 +368,9 @@ . ($self->postamble || ''); local *MAKEFILE; - open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; + open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; + eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; - close MAKEFILE or die $!; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; @@ -378,7 +390,8 @@ # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; - open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; + seek MAKEFILE, 0, SEEK_SET; + truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; @@ -402,4 +415,4 @@ __END__ -#line 531 +#line 544 diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Metadata.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Metadata.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Metadata.pm 2010-04-30 14:30:42.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Metadata.pm 2017-02-17 13:25:37.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -151,15 +151,21 @@ sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { - my $self = shift; - unless ( @_ ) { - warn "You MUST provide an explicit true/false value to dynamic_config\n"; - return $self; + my $self = shift; + my $value = @_ ? shift : 1; + if ( $self->{values}->{dynamic_config} ) { + # Once dynamic we never change to static, for safety + return 0; } - $self->{values}->{dynamic_config} = $_[0] ? 1 : 0; + $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } +# Convenience command +sub static_config { + shift->dynamic_config(0); +} + sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; @@ -170,7 +176,7 @@ # Normalize the version $version = $self->_perl_version($version); - # We don't support the reall old versions + # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } @@ -178,43 +184,6 @@ $self->{values}->{perl_version} = $version; } -#Stolen from M::B -my %license_urls = ( - perl => 'http://dev.perl.org/licenses/', - apache => 'http://apache.org/licenses/LICENSE-2.0', - artistic => 'http://opensource.org/licenses/artistic-license.php', - artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', - lgpl => 'http://opensource.org/licenses/lgpl-license.php', - lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', - lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', - bsd => 'http://opensource.org/licenses/bsd-license.php', - gpl => 'http://opensource.org/licenses/gpl-license.php', - gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', - gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', - mit => 'http://opensource.org/licenses/mit-license.php', - mozilla => 'http://opensource.org/licenses/mozilla1.1.php', - open_source => undef, - unrestricted => undef, - restrictive => undef, - unknown => undef, -); - -sub license { - my $self = shift; - return $self->{values}->{license} unless @_; - my $license = shift or die( - 'Did not provide a value to license()' - ); - $self->{values}->{license} = $license; - - # Automatically fill in license URLs - if ( $license_urls{$license} ) { - $self->resources( license => $license_urls{$license} ); - } - - return 1; -} - sub all_from { my ( $self, $file ) = @_; @@ -354,6 +323,9 @@ require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); + + # for version integrity check + $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { @@ -364,7 +336,7 @@ { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) - ); + ); } # Add both distribution and module name @@ -375,7 +347,7 @@ ^ \s* package \s* ([\w:]+) - \s* ; + [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); @@ -479,42 +451,90 @@ } } +#Stolen from M::B +my %license_urls = ( + perl => 'http://dev.perl.org/licenses/', + apache => 'http://apache.org/licenses/LICENSE-2.0', + apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', + artistic => 'http://opensource.org/licenses/artistic-license.php', + artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', + lgpl => 'http://opensource.org/licenses/lgpl-license.php', + lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', + lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', + bsd => 'http://opensource.org/licenses/bsd-license.php', + gpl => 'http://opensource.org/licenses/gpl-license.php', + gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', + gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', + mit => 'http://opensource.org/licenses/mit-license.php', + mozilla => 'http://opensource.org/licenses/mozilla1.1.php', + open_source => undef, + unrestricted => undef, + restrictive => undef, + unknown => undef, +); + +sub license { + my $self = shift; + return $self->{values}->{license} unless @_; + my $license = shift or die( + 'Did not provide a value to license()' + ); + $license = __extract_license($license) || lc $license; + $self->{values}->{license} = $license; + + # Automatically fill in license URLs + if ( $license_urls{$license} ) { + $self->resources( license => $license_urls{$license} ); + } + + return 1; +} + sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ - (=head \d \s+ (?:licen[cs]e|licensing)\b.*?) + (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z - /ixms + /xms ) || __extract_license( ($matched) = $pod =~ m/ - (=head \d \s+ (?:copyrights?|legal)\b.*?) + (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z - /ixms + /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( - 'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1, - 'under the terms of (?:perl|the perl programming language) itself' => 'perl', 1, - 'Artistic and GPL' => 'perl', 1, - 'GNU general public license' => 'gpl', 1, - 'GNU public license' => 'gpl', 1, - 'GNU lesser general public license' => 'lgpl', 1, - 'GNU lesser public license' => 'lgpl', 1, - 'GNU library general public license' => 'lgpl', 1, - 'GNU library public license' => 'lgpl', 1, - 'BSD license' => 'bsd', 1, - 'Artistic license' => 'artistic', 1, - 'GPL' => 'gpl', 1, - 'LGPL' => 'lgpl', 1, - 'BSD' => 'bsd', 1, - 'Artistic' => 'artistic', 1, - 'MIT' => 'mit', 1, - 'proprietary' => 'proprietary', 0, + '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, + '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, + 'Artistic and GPL' => 'perl', 1, + 'GNU general public license' => 'gpl', 1, + 'GNU public license' => 'gpl', 1, + 'GNU lesser general public license' => 'lgpl', 1, + 'GNU lesser public license' => 'lgpl', 1, + 'GNU library general public license' => 'lgpl', 1, + 'GNU library public license' => 'lgpl', 1, + 'GNU Free Documentation license' => 'unrestricted', 1, + 'GNU Affero General Public License' => 'open_source', 1, + '(?:Free)?BSD license' => 'bsd', 1, + 'Artistic license 2\.0' => 'artistic_2', 1, + 'Artistic license' => 'artistic', 1, + 'Apache (?:Software )?license' => 'apache', 1, + 'GPL' => 'gpl', 1, + 'LGPL' => 'lgpl', 1, + 'BSD' => 'bsd', 1, + 'Artistic' => 'artistic', 1, + 'MIT' => 'mit', 1, + 'Mozilla Public License' => 'mozilla', 1, + 'Q Public License' => 'open_source', 1, + 'OpenSSL License' => 'unrestricted', 1, + 'SSLeay License' => 'unrestricted', 1, + 'zlib License' => 'open_source', 1, + 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; @@ -522,6 +542,7 @@ return $license; } } + return ''; } sub license_from { @@ -536,9 +557,9 @@ sub _extract_bugtracker { my @links = $_[0] =~ m#L<( - \Qhttp://rt.cpan.org/\E[^>]+| - \Qhttp://github.com/\E[\w_]+/[\w_]+/issues| - \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list + https?\Q://rt.cpan.org/\E[^>]+| + https?\Q://github.com/\E[\w_]+/[\w_]+/issues| + https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @@ -567,7 +588,7 @@ sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); - my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; + my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; @@ -602,8 +623,15 @@ return $v; } - - +sub add_metadata { + my $self = shift; + my %hash = @_; + for my $key (keys %hash) { + warn "add_metadata: $key is not prefixed with 'x_'.\n" . + "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; + $self->{values}->{$key} = $hash{$key}; + } +} ###################################################################### @@ -677,7 +705,7 @@ my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; - # Overwrite the non-configure dependency hashs + # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/Win32.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/Win32.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/Win32.pm 2010-04-30 14:30:43.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/Win32.pm 2017-02-17 13:25:37.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95'; + $VERSION = '1.17'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install/WriteAll.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install/WriteAll.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install/WriteAll.pm 2010-04-30 14:30:43.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install/WriteAll.pm 2017-02-17 13:25:37.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '0.95';; + $VERSION = '1.17'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff -Nru libmodule-install-autolicense-perl-0.08/inc/Module/Install.pm libmodule-install-autolicense-perl-0.10/inc/Module/Install.pm --- libmodule-install-autolicense-perl-0.08/inc/Module/Install.pm 2010-04-30 14:30:41.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/inc/Module/Install.pm 2017-02-17 13:25:37.000000000 +0000 @@ -17,12 +17,11 @@ # 3. The ./inc/ version of Module::Install loads # } -use 5.005; +use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); -use FindBin; use vars qw{$VERSION $MAIN}; BEGIN { @@ -32,7 +31,7 @@ # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '0.95'; + $VERSION = '1.17'; # Storage for the pseudo-singleton $MAIN = undef; @@ -127,6 +126,11 @@ #------------------------------------------------------------- unless ( -f $self->{file} ) { + foreach my $key (keys %INC) { + delete $INC{$key} if $key =~ /Module\/Install/; + } + + local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); @@ -135,12 +139,13 @@ goto &{"$self->{name}::import"}; } + local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again - delete $INC{"$self->{file}"}; - delete $INC{"$self->{path}.pm"}; + delete $INC{'inc/Module/Install.pm'}; + delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; @@ -151,15 +156,29 @@ sub autoload { my $self = shift; my $who = $self->_caller; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { - my $pwd = Cwd::cwd(); + my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } - $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym"; + unless ($$sym =~ s/([^:]+)$//) { + # XXX: it looks like we can't retrieve the missing function + # via $$sym (usually $main::AUTOLOAD) in this case. + # I'm still wondering if we should slurp Makefile.PL to + # get some context or not ... + my ($package, $file, $line) = caller; + die <<"EOT"; +Unknown function is found at $file line $line. +Execution of $file aborted due to runtime errors. + +If you're a contributor to a project, you may need to install +some Module::Install extensions from CPAN (or other repository). +If you're a user of a module, please contact the author. +EOT + } my $method = $1; if ( uc($method) eq $method ) { # Do nothing @@ -200,6 +219,7 @@ my $who = $self->_caller; foreach my $name ( sort keys %seen ) { + local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; @@ -210,14 +230,22 @@ sub new { my ($class, %args) = @_; + delete $INC{'FindBin.pm'}; + { + # to suppress the redefine warning + local $SIG{__WARN__} = sub {}; + require FindBin; + } + # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); - unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { + unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } - return $args{_self} if $args{_self}; + $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS'; + $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); @@ -268,8 +296,10 @@ sub load_extensions { my ($self, $path, $top) = @_; + my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; + $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { @@ -277,12 +307,13 @@ next if $self->{pathnames}{$pkg}; local $@; - my $new = eval { require $file; $pkg->can('new') }; + my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } - $self->{pathnames}{$pkg} = delete $INC{$file}; + $self->{pathnames}{$pkg} = + $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } @@ -293,7 +324,7 @@ my ($self, $path) = @_; my @found; - File::Find::find( sub { + File::Find::find( {no_chdir => 1, wanted => sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; @@ -307,9 +338,9 @@ # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { - my $content = Module::Install::_read($subpath . '.pm'); + my $content = Module::Install::_read($File::Find::name); my $in_pod = 0; - foreach ( split //, $content ) { + foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text @@ -322,7 +353,7 @@ } push @found, [ $file, $pkg ]; - }, $path ) if -d $path; + }}, $path ) if -d $path; @found; } @@ -344,24 +375,14 @@ return $call; } -# Done in evals to avoid confusing Perl::MinimumVersion -eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } -END_NEW -sub _read { - local *FH; - open( FH, "< $_[0]" ) or die "open($_[0]): $!"; - my $string = do { local $/; }; - close FH or die "close($_[0]): $!"; - return $string; -} -END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); @@ -382,30 +403,19 @@ return $string; } -# Done in evals to avoid confusing Perl::MinimumVersion -eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } -END_NEW -sub _write { - local *FH; - open( FH, "> $_[0]" ) or die "open($_[0]): $!"; - foreach ( 1 .. $#_ ) { - print FH $_[$_] or die "print($_[0]): $!"; - } - close FH or die "close($_[0]): $!"; -} -END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). -sub _version ($) { +sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { @@ -421,12 +431,12 @@ return $l + 0; } -sub _cmp ($$) { - _version($_[0]) <=> _version($_[1]); +sub _cmp { + _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS -sub _CLASS ($) { +sub _CLASS { ( defined $_[0] and @@ -438,4 +448,4 @@ 1; -# Copyright 2008 - 2010 Adam Kennedy. +# Copyright 2008 - 2012 Adam Kennedy. diff -Nru libmodule-install-autolicense-perl-0.08/lib/Module/Install/AutoLicense.pm libmodule-install-autolicense-perl-0.10/lib/Module/Install/AutoLicense.pm --- libmodule-install-autolicense-perl-0.08/lib/Module/Install/AutoLicense.pm 2010-04-30 14:29:02.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/lib/Module/Install/AutoLicense.pm 2017-02-17 13:20:23.000000000 +0000 @@ -5,7 +5,7 @@ use base qw(Module::Install::Base); use vars qw($VERSION); -$VERSION = '0.08'; +$VERSION = '0.10'; my %licenses = ( perl => 'Software::License::Perl_5', diff -Nru libmodule-install-autolicense-perl-0.08/LICENSE libmodule-install-autolicense-perl-0.10/LICENSE --- libmodule-install-autolicense-perl-0.08/LICENSE 2009-05-01 09:24:58.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/LICENSE 2017-02-17 13:25:37.000000000 +0000 @@ -1,9 +1,9 @@ -This software is copyright (c) 2009 by Chris Williams. +This software is copyright (c) 2017 by Chris Williams . This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. +the same terms as the Perl 5 programming language system itself. -Terms of Perl itself +Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any @@ -12,21 +12,22 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2009 by Chris Williams. +This software is Copyright (c) 2017 by Chris Williams . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -207,9 +208,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it @@ -235,8 +236,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + Also add information on how to contact you by electronic and paper mail. @@ -270,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2009 by Chris Williams. +This software is Copyright (c) 2017 by Chris Williams . This is free software, licensed under: diff -Nru libmodule-install-autolicense-perl-0.08/Makefile.PL libmodule-install-autolicense-perl-0.10/Makefile.PL --- libmodule-install-autolicense-perl-0.08/Makefile.PL 2010-04-29 11:41:29.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/Makefile.PL 2017-02-17 13:20:00.000000000 +0000 @@ -1,3 +1,4 @@ +use if ! ( grep { $_ eq '.' } @INC ), qw[lib .]; use strict; use inc::Module::Install; use Config; @@ -20,5 +21,6 @@ close HAVEMAKE; } auto_provides; +auto_license; githubmeta; WriteAll(); diff -Nru libmodule-install-autolicense-perl-0.08/MANIFEST libmodule-install-autolicense-perl-0.10/MANIFEST --- libmodule-install-autolicense-perl-0.08/MANIFEST 2010-04-20 09:55:25.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/MANIFEST 2017-02-17 13:24:54.000000000 +0000 @@ -1,6 +1,7 @@ Changes have_make inc/Module/Install.pm +inc/Module/Install/AutoLicense.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm diff -Nru libmodule-install-autolicense-perl-0.08/META.yml libmodule-install-autolicense-perl-0.10/META.yml --- libmodule-install-autolicense-perl-0.08/META.yml 2010-04-30 14:30:44.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/META.yml 2017-02-17 13:25:37.000000000 +0000 @@ -4,13 +4,14 @@ - 'Chris Williams ' build_requires: Capture::Tiny: 0.05 - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.59 File::Temp: 0 Test::More: 0.47 configure_requires: - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.59 distribution_type: module -generated_by: 'Module::Install version 0.95' +dynamic_config: 1 +generated_by: 'Module::Install version 1.17' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -23,13 +24,13 @@ provides: Module::Install::AutoLicense: file: lib/Module/Install/AutoLicense.pm - version: 0.08 + version: '0.10' requires: Module::Install: 0.85 Software::License: 0.01 perl: 5.6.0 resources: - homepage: http://github.com/bingos/module-install-autolicense/tree + homepage: https://github.com/bingos/module-install-autolicense/ license: http://dev.perl.org/licenses/ repository: git://github.com/bingos/module-install-autolicense.git -version: 0.08 +version: '0.10' diff -Nru libmodule-install-autolicense-perl-0.08/t/01_dist.t libmodule-install-autolicense-perl-0.10/t/01_dist.t --- libmodule-install-autolicense-perl-0.08/t/01_dist.t 2010-04-29 11:39:57.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/t/01_dist.t 2017-02-17 13:21:05.000000000 +0000 @@ -19,7 +19,8 @@ my $tmpdir = tempdir( DIR => 'dist', CLEANUP => 1 ); chdir $tmpdir or die "$!\n"; open MFPL, '>Makefile.PL' or die "$!\n"; -print MFPL <; diff -Nru libmodule-install-autolicense-perl-0.08/t/02_distdir.t libmodule-install-autolicense-perl-0.10/t/02_distdir.t --- libmodule-install-autolicense-perl-0.08/t/02_distdir.t 2010-04-29 11:41:02.000000000 +0000 +++ libmodule-install-autolicense-perl-0.10/t/02_distdir.t 2017-02-17 13:22:31.000000000 +0000 @@ -18,7 +18,8 @@ my $tmpdir = tempdir( DIR => 'dist', CLEANUP => 1 ); chdir $tmpdir or die "$!\n"; open MFPL, '>Makefile.PL' or die "$!\n"; -print MFPL < 'dist', CLEANUP => 1 ); chdir $tmpdir or die "$!\n"; open MFPL, '>Makefile.PL' or die "$!\n"; -print MFPL <;