[cpanoutdated] 01/08: Imported Upstream version 0.31

Lucas Kanashiro kanashiro.duarte at gmail.com
Fri Jun 3 14:32:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

kanashiro-guest pushed a commit to branch master
in repository cpanoutdated.

commit af630ac1476588d3763c0d16f34d208f54c2530a
Author: Lucas Kanashiro <kanashiro.duarte at gmail.com>
Date:   Fri Jun 3 10:39:48 2016 -0300

    Imported Upstream version 0.31
---
 Changes                  |   9 ++++
 MANIFEST                 |   2 +
 META.json                |  23 ++++++---
 META.yml                 |  19 ++++++--
 cpanfile                 |   6 ++-
 lib/App/cpanoutdated.pm  |   2 +-
 minil.toml               |   1 +
 script/cpan-outdated     | 118 +++++++++++++++++++++++++----------------------
 t/02_permissive_filter.t |  13 ++++++
 9 files changed, 125 insertions(+), 68 deletions(-)

diff --git a/Changes b/Changes
index 6de69ea..188b93b 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,12 @@
+0.31 2016-05-26T20:38:01Z
+    - Check also core modules (unless explicitely excluded) to report
+      dual-life (core+CPAN) modules #32
+
+0.30 2016-05-03T23:29:25Z
+    - Use HTTP::Tiny instead of LWP::UserAgent (grinnz, dolmen)
+    - Lazy load the modules the script optionally uses (dolmen)
+    - Meta: declare dependencies including from perl core
+
 0.29 2015-07-28T14:18:42Z
 
     - Limit the modules to check #28
diff --git a/MANIFEST b/MANIFEST
index 50b82d0..42beb22 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5,9 +5,11 @@ META.json
 README.md
 cpanfile
 lib/App/cpanoutdated.pm
+minil.toml
 script/cpan-outdated
 t/00_compile.t
 t/01_compare_version.t
+t/02_permissive_filter.t
 xt/02_perlcritic.t
 xt/06_version.t
 META.yml
diff --git a/META.json b/META.json
index fde77af..852c234 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Tokuhiro Matsuno"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Minilla/v2.4.3",
+   "generated_by" : "Minilla/v3.0.1",
    "license" : [
       "perl_5"
    ],
@@ -43,10 +43,14 @@
       "runtime" : {
          "requires" : {
             "CPAN::DistnameInfo" : "0.1",
+            "ExtUtils::Installed" : "0",
+            "File::Temp" : "0",
+            "Getopt::Long" : "0",
+            "HTTP::Tiny" : "0.012",
             "IO::Zlib" : "0",
-            "LWP" : "0",
             "Module::CoreList" : "0",
             "Module::Metadata" : "1.000007",
+            "Pod::Usage" : "0",
             "URI" : "0",
             "local::lib" : "1.006008",
             "perl" : "5.008001",
@@ -57,7 +61,7 @@
    "provides" : {
       "App::cpanoutdated" : {
          "file" : "lib/App/cpanoutdated.pm",
-         "version" : "0.29"
+         "version" : "0.31"
       }
    },
    "release_status" : "stable",
@@ -71,7 +75,8 @@
          "web" : "https://github.com/tokuhirom/cpan-outdated"
       }
    },
-   "version" : "0.29",
+   "version" : "0.31",
+   "x_authority" : "cpan:TOKUHIROM",
    "x_contributors" : [
       "Jesse Luehrs <doy at tozt.net>",
       "Fuji, Goro <gfuji at cpan.org>",
@@ -83,8 +88,12 @@
       "Oleg Gashev <oleg at gashev.net>",
       "David Steinbrunner <dsteinbrunner at pobox.com>",
       "opendevnet <grtodd at gmail.com>",
-      "Olivier Mengué <dolmen at cpan.org>",
       "Tatsuhiko Miyagawa <miyagawa at bulknews.net>",
-      "Tokuhiro Matsuno <tokuhirom at gmail.com>"
-   ]
+      "Joenio Costa <joenio at colivre.coop.br>",
+      "Tatsuhiko Miyagawa <miyagawa at gmail.com>",
+      "Dan Book <grinnz at grinnz.com>",
+      "Tokuhiro Matsuno <tokuhirom at gmail.com>",
+      "Olivier Mengué <dolmen at cpan.org>"
+   ],
+   "x_serialization_backend" : "JSON::PP version 2.27400"
 }
diff --git a/META.yml b/META.yml
index 2b388eb..7147ad0 100644
--- a/META.yml
+++ b/META.yml
@@ -6,7 +6,7 @@ build_requires: {}
 configure_requires:
   Module::Build::Tiny: '0.035'
 dynamic_config: 0
-generated_by: 'Minilla/v2.4.3, CPAN::Meta::Converter version 2.150001'
+generated_by: 'Minilla/v3.0.1, CPAN::Meta::Converter version 2.150005'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,13 +25,17 @@ no_index:
 provides:
   App::cpanoutdated:
     file: lib/App/cpanoutdated.pm
-    version: '0.29'
+    version: '0.31'
 requires:
   CPAN::DistnameInfo: '0.1'
+  ExtUtils::Installed: '0'
+  File::Temp: '0'
+  Getopt::Long: '0'
+  HTTP::Tiny: '0.012'
   IO::Zlib: '0'
-  LWP: '0'
   Module::CoreList: '0'
   Module::Metadata: '1.000007'
+  Pod::Usage: '0'
   URI: '0'
   local::lib: '1.006008'
   perl: '5.008001'
@@ -40,7 +44,8 @@ resources:
   bugtracker: https://github.com/tokuhirom/cpan-outdated/issues
   homepage: https://github.com/tokuhirom/cpan-outdated
   repository: git://github.com/tokuhirom/cpan-outdated.git
-version: '0.29'
+version: '0.31'
+x_authority: cpan:TOKUHIROM
 x_contributors:
   - 'Jesse Luehrs <doy at tozt.net>'
   - 'Fuji, Goro <gfuji at cpan.org>'
@@ -52,6 +57,10 @@ x_contributors:
   - 'Oleg Gashev <oleg at gashev.net>'
   - 'David Steinbrunner <dsteinbrunner at pobox.com>'
   - 'opendevnet <grtodd at gmail.com>'
-  - 'Olivier Mengué <dolmen at cpan.org>'
   - 'Tatsuhiko Miyagawa <miyagawa at bulknews.net>'
+  - 'Joenio Costa <joenio at colivre.coop.br>'
+  - 'Tatsuhiko Miyagawa <miyagawa at gmail.com>'
+  - 'Dan Book <grinnz at grinnz.com>'
   - 'Tokuhiro Matsuno <tokuhirom at gmail.com>'
+  - 'Olivier Mengué <dolmen at cpan.org>'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/cpanfile b/cpanfile
index f5c4b8f..6af133f 100644
--- a/cpanfile
+++ b/cpanfile
@@ -1,10 +1,14 @@
 requires 'perl', '5.008001';
 
 requires 'CPAN::DistnameInfo', '0.1';
+requires 'ExtUtils::Installed';
+requires 'File::Temp';
+requires 'Getopt::Long';
+requires 'HTTP::Tiny', '0.012';
 requires 'IO::Zlib';
-requires 'LWP';
 requires 'Module::CoreList';
 requires 'Module::Metadata', '1.000007';
+requires 'Pod::Usage';
 requires 'URI';
 requires 'local::lib', '1.006008';
 requires 'version';
diff --git a/lib/App/cpanoutdated.pm b/lib/App/cpanoutdated.pm
index cdfcca4..a0faf80 100644
--- a/lib/App/cpanoutdated.pm
+++ b/lib/App/cpanoutdated.pm
@@ -1,7 +1,7 @@
 package App::cpanoutdated;
 use strict;
 use warnings;
-our $VERSION = "0.29";
+our $VERSION = "0.31";
 1;
 __END__
 
diff --git a/minil.toml b/minil.toml
new file mode 100644
index 0000000..69c241b
--- /dev/null
+++ b/minil.toml
@@ -0,0 +1 @@
+authority = "cpan:TOKUHIROM"
diff --git a/script/cpan-outdated b/script/cpan-outdated
index 6963999..c27d675 100755
--- a/script/cpan-outdated
+++ b/script/cpan-outdated
@@ -3,31 +3,26 @@ use strict;
 use warnings;
 use ExtUtils::Installed;
 use Getopt::Long;
-use Pod::Usage;
-use File::Temp;
-use File::Spec;
 use Config;
 use version;
 use IO::Zlib;
 use CPAN::DistnameInfo;
-use Module::CoreList ();
 use Module::Metadata;
 use URI;
-use constant WIN32 => $^O eq 'MSWin32';
 
-our $VERSION = "0.29";
+our $VERSION = "0.31";
 
 my $mirror = 'http://www.cpan.org/';
-my $quote = WIN32 ? q/"/ : q/'/;
 my $local_lib;
 my $self_contained = 0;
 my $index_file;
+my $help;
 Getopt::Long::Configure("bundling");
 Getopt::Long::GetOptions(
-    'h|help'          => \my $help,
+    'h|help'          => \$help,
     'verbose'         => \my $verbose,
     'm|mirror=s'      => \$mirror,
-    'index'           => \$index_file,
+    'index=s'         => \$index_file,
     'p|print-package' => \my $print_package,
     'I=s'             => sub { die "this option was deprecated" },
     'l|local-lib=s'   => \$local_lib,
@@ -39,8 +34,11 @@ Getopt::Long::GetOptions(
           . "cpanm cpan-listchanges # install from CPAN\n"
     },
     'exclude-core' => \my $exclude_core,
-) or pod2usage();
-pod2usage() if $help;
+) or $help++;
+if ($help) {
+    require Pod::Usage;
+    Pod::Usage::pod2usage();
+}
 
 $mirror =~ s:/$::;
 my $index_url = "${mirror}/modules/02packages.details.txt.gz";
@@ -50,7 +48,12 @@ if ($index_url->isa('URI::file')) {
     $index_file = $index_url->file
 }
 
-my $core_modules = $Module::CoreList::version{$]};
+my $core_modules;
+if ($exclude_core) {
+    require Module::CoreList;
+    no warnings 'once';
+    $core_modules = $Module::CoreList::version{$]};
+}
 
 unless ($ENV{HARNESS_ACTIVE}) {
     &main;
@@ -59,8 +62,16 @@ unless ($ENV{HARNESS_ACTIVE}) {
 
 sub modules_to_check {
     my @inc = @_;
-    # TODO: if you want to filter the target modules, you can change them here.
-    ExtUtils::Installed->new(skip_cwd => 1, inc_override => \@inc)->modules;
+    my @modules =
+        ExtUtils::Installed->new(skip_cwd => 1, inc_override => \@inc)->modules;
+    # As core modules may not have been listed by EUI because they lack
+    # .packlist, we add them from Module::CoreList
+    if (!$exclude_core || ($local_lib && !$self_contained)) {
+        require Module::CoreList;
+        # This adds duplicates, but they are removed by the caller
+        push @modules, keys %{ $Module::CoreList::version{$]} };
+    }
+    (@modules)
 }
 
 sub installed_version_for {
@@ -102,7 +113,7 @@ sub main {
         # $Mail::SpamAssassin::Conf::VERSION is 'bogus'
         # https://rt.cpan.org/Public/Bug/Display.html?id=73465
         next unless $version =~ /[0-9]/;
-        
+
         # if excluding core modules
         next if $exclude_core && exists $core_modules->{$pkg};
 
@@ -148,48 +159,47 @@ sub permissive_filter {
     $_;
 }
 
-# taken from cpanminus
-sub which {
-    my($name) = @_;
-    my $exe_ext = $Config{_exe};
-    foreach my $dir(File::Spec->path){
-        my $fullpath = File::Spec->catfile($dir, $name);
-        if (-x $fullpath || -x ($fullpath .= $exe_ext)){
-            if ($fullpath =~ /\s/ && $fullpath !~ /^$quote/) {
-                $fullpath = "$quote$fullpath$quote"
-            }
-            return $fullpath;
-        }
-    }
-    return;
-}
 
 # Return the $fname (a generated File::Temp object if not provided)
 sub get_index {
     my ($url, $fname) = @_;
-    require LWP::UserAgent;
-    my $ua = LWP::UserAgent->new(
-        parse_head => 0,
-    );
-    $ua->env_proxy();
-    $fname = File::Temp->new(UNLINK => 1, SUFFIX => '.gz') unless defined $fname;
+    require HTTP::Tiny;
+    my $ua = HTTP::Tiny->new;
     my $response;
-    # If the file is not empty, use it as a local cached copy
-    if (-s "$fname") {
-        $response = $ua->mirror($url, "$fname"); # Explicitely stringify
+    if (defined $fname) {
+        # If the file is not empty, use it as a local cached copy
+        if (-s $fname) {
+            $response = $ua->mirror($url, $fname);
+        } else {
+            # If the file is empty we do not trust its timestamp
+            # so set a custom If-Modified-Since (Perl 5.0 release)
+            $response = $ua->mirror($url, $fname,
+                {
+                    headers => {
+                        'if-modified-since' => 'Wed, 19 Oct 1994 17:18:57 GMT',
+                    },
+                });
+        }
     } else {
-        # If the file is empty we do not trust its timestamp (as it may just
-        # have been created if a temp file) so we can't use $ua->mirror
-        $response = $ua->get($url, ':content_file' => "$fname");
+        require File::Temp;
+        $fname = File::Temp->new(UNLINK => 1, SUFFIX => '.gz');
+        binmode $fname;
+        $response = $ua->request(
+            'GET' => $url,
+            {
+                data_callback => sub { print {$fname} $_[0] },
+            }
+        );
+        close $fname;
     }
-    if (my $died = $response->header('X-Died')) {
-        die "Cannot get_index $url to $fname: $died";
-    # 304 = "Not Modified" (returned if we are mirroring)
-    } elsif (! $response->is_success && $response->code != 304) {
-        die "Cannot get_index $url to $fname: " . $response->status_line;
+    if ($response->{status} == 599) {
+        die "Cannot get_index $url to $fname: $response->{content}";
+    # 304 = "Not Modified" is still a success since we are mirroring
+    } elsif (! $response->{success}) {
+        die "Cannot get_index $url to $fname: $response->{status} $response->{reason}";
     }
-    #print "$fname ", $response->status_line, "\n";
-    # Return the filename
+    #print "$fname $response->{status} $response->{reason}\n";
+    # Return the filename (which might be a File::Temp object)
     $fname
 }
 
@@ -267,11 +277,11 @@ distro format, i.e: C<A/AU/AUTHOR/Distribution-Name-0.10.tar.gz> so
 you can pipe into CPAN installers, but with C<-p> option it can be
 tweaked to print the module's package names.
 
-If you wish to manage a set of modules separately from your system  
-perl installation and not install newer versions of "dual life modules" 
-that are distributed with perl, the C<--exclude-core> option will make 
-cpan-outdated ignore changes to core modules. Used with tools like 
-cpanm and its C<-L --local-lib-contained> and C<--self-contained> options, 
+If you wish to manage a set of modules separately from your system
+perl installation and not install newer versions of "dual life modules"
+that are distributed with perl, the C<--exclude-core> option will make
+cpan-outdated ignore changes to core modules. Used with tools like
+cpanm and its C<-L --local-lib-contained> and C<--self-contained> options,
 this facilitates maintaining updates on standalone sets of modules.
 
 For some tools such as L<cpanm> installing from packages could be a
diff --git a/t/02_permissive_filter.t b/t/02_permissive_filter.t
new file mode 100644
index 0000000..735d105
--- /dev/null
+++ b/t/02_permissive_filter.t
@@ -0,0 +1,13 @@
+use strict;
+use warnings;
+use Test::More tests => 6;
+
+$ENV{HARNESS_ACTIVE} ||= 1;
+
+do 'script/cpan-outdated' or die;
+is permissive_filter('V2.0'), '2.0';
+is permissive_filter('0_02'), '0.02';
+is permissive_filter('0.035-withoutworldwriteables'), '0.035';
+is permissive_filter('0.20b'), '0.201';
+is permissive_filter('1.50.2vs.070506'), '1.50.2.070506';
+is permissive_filter('1..50.2'), '1.50.2';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/cpanoutdated.git



More information about the Pkg-perl-cvs-commits mailing list