[carton] 43/472: move Carton.pod to lib

Lucas Kanashiro kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:30 UTC 2015


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

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

commit 1958242de2d9554e80c6eec1eaf824c333d42e23
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date:   Sun Jun 26 10:01:20 2011 -0700

    move Carton.pod to lib
---
 MANIFEST                        |  2 +-
 Makefile.PL                     | 24 ++++++++++++++----------
 README                          |  3 +--
 TODO                            |  1 +
 lib/{Carton/Doc => }/Carton.pod |  2 +-
 lib/Carton/CLI.pm               |  2 +-
 6 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/MANIFEST b/MANIFEST
index 8951fa1..29eb23e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -17,8 +17,8 @@ inc/Module/Install/Scripts.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 lib/Carton.pm
+lib/Carton.pod
 lib/Carton/CLI.pm
-lib/Carton/Doc/Carton.pod
 lib/Carton/Doc/FAQ.pod
 lib/Carton/Doc/Install.pod
 lib/Carton/Doc/List.pod
diff --git a/Makefile.PL b/Makefile.PL
index b199f78..5a32f35 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,8 +2,8 @@ use inc::Module::Install;
 name 'carton';
 version_from 'lib/Carton.pm';
 perl_version '5.008001';
-license_from 'lib/Carton/Doc/Carton.pod';
-readme_from('lib/Carton/Doc/Carton.pod');
+license_from 'lib/Carton.pod';
+readme_from('lib/Carton.pod');
 
 requires 'version', 0.77;
 requires 'JSON';
@@ -26,14 +26,15 @@ sub doc_to_pods {
 
     my %pods;
 
-    for my $file (glob "lib/Carton/Doc/*.pod") {
-        my $base = ($file =~ m!Doc/(.*?)\.pod!)[0];
-        my $name = $base eq 'Carton' ? "carton" : ("carton-" . lc($base));
+    for my $file ("lib/Carton.pod", glob "lib/Carton/Doc/*.pod") {
+        my $base = ($file =~ m!lib/(.*?)\.pod!)[0];
+           $base =~ s!/!::!g;
+        my $name = $base eq 'Carton' ? "carton" : ("carton-" . lc( (split /::/, $base)[-1] ));
         my $doc = "doc/$name.pod";
 
         if ($Module::Install::AUTHOR) {
             mkdir "doc", 0777;
-            copy_pod($file, $doc, "Carton::Doc::$base" => $name);
+            copy_pod($file, $doc, $base => $name);
         }
 
         $pods{$doc} = "blib/man1/$name.1"
@@ -49,16 +50,19 @@ sub copy_pod {
 
     warn "Copying $src -> $dest\n";
 
-    open my $in, "<", $src   or die $!;
-    open my $out, ">", $dest or die $!;
+    open my $in, "<", $src    or die "$src: $!";
+    open my $out, ">", $dest  or die "$dest: $!";
 
     my $match;
     while (<$in>) {
-        s/^$pod_name - /$man - / and $match++;
+        unless ($match) {
+            s/^$pod_name - /$man - /
+                and $match++;
+        }
         print $out $_;
     }
 
     unless ($match) {
-        die "Could nto find NAME $pod_name in $src";
+        die "Couldn't find NAME $pod_name in $src";
     }
 }
diff --git a/README b/README
index 57cbaed..3b78f8f 100644
--- a/README
+++ b/README
@@ -1,6 +1,5 @@
 NAME
-    Carton::Doc::Carton - Perl module dependency manager (aka Bundler for
-    Perl)
+    Carton - Perl module dependency manager (aka Bundler for Perl)
 
 SYNOPSIS
       # During the development
diff --git a/TODO b/TODO
index 54e3278..54641e2 100644
--- a/TODO
+++ b/TODO
@@ -9,6 +9,7 @@ exec
 unit tests
 carton bundle
 self-contained cpanm and carton
+support lowest possible perl version (to change CoreList in cpanm dict)
 
 # 1.2
 Support DarkPAN/github etc
diff --git a/lib/Carton/Doc/Carton.pod b/lib/Carton.pod
similarity index 97%
rename from lib/Carton/Doc/Carton.pod
rename to lib/Carton.pod
index 4831063..0af5ea8 100644
--- a/lib/Carton/Doc/Carton.pod
+++ b/lib/Carton.pod
@@ -1,6 +1,6 @@
 =head1 NAME
 
-Carton::Doc::Carton - Perl module dependency manager (aka Bundler for Perl)
+Carton - Perl module dependency manager (aka Bundler for Perl)
 
 =head1 SYNOPSIS
 
diff --git a/lib/Carton/CLI.pm b/lib/Carton/CLI.pm
index 149894f..8dda2ef 100644
--- a/lib/Carton/CLI.pm
+++ b/lib/Carton/CLI.pm
@@ -111,7 +111,7 @@ sub error {
 
 sub cmd_help {
     my $self = shift;
-    my $module = "Carton::Doc::" . ($_[0] ? ucfirst $_[0] : "Carton");
+    my $module = $_[0] ? ("Carton::Doc::" . ucfirst $_[0]) : "Carton";
     system "perldoc", $module;
 }
 

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



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