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

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

commit 30f2112d18b40c6c21e454df85aaa3314c1355e5
Author: ikasam_a <masaki.nakag...@gmail.com>
Date:   Thu Apr 12 21:07:40 2012 +0900

    merged "bundle using install.json" branch
    
        use local install.json and MYMETA.json in bundling
    
        some modules are ok (e.g. common::sense, FCGI)
---
 cpanfile          |  2 --
 lib/Carton.pm     | 29 ++++++-----------------------
 lib/Carton/CLI.pm |  5 ++++-
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/cpanfile b/cpanfile
index f845280..00f5af7 100644
--- a/cpanfile
+++ b/cpanfile
@@ -19,8 +19,6 @@ requires 'CPAN::Meta', 2.120921;
 requires 'CPAN::Meta::Requirements', 2.121;
 
 # bundle DarkPAN support
-requires 'File::chdir';
-requires 'Dist::Metadata';
 requires 'IO::Compress::Gzip';
 
 on 'develop' => sub {
diff --git a/lib/Carton.pm b/lib/Carton.pm
index 681e248..7b651d4 100644
--- a/lib/Carton.pm
+++ b/lib/Carton.pm
@@ -110,6 +110,7 @@ sub download_conservative {
     my $mirror = $self->{mirror} || $DefaultMirror;
 
     local $self->{path} = File::Temp::tempdir(CLEANUP => 1); # ignore installed
+
     $self->run_cpanm(
         "--mirror", $mirror,
         "--mirror", "http://backpan.perl.org/";, # fallback
@@ -117,10 +118,14 @@ sub download_conservative {
         ( $mirror ne $DefaultMirror ? "--mirror-only" : () ),
         ( $cascade ? "--cascade-search" : () ),
         "--scandeps",
-        "--format", "dists",
         "--save-dists", $dir,
         @$modules,
     );
+
+    # write 02packages using local installations
+    my %installs = $self->find_installs;
+    my $index = $self->build_index(\%installs);
+    $self->build_mirror_file($index, $self->{mirror_file});
 }
 
 sub install_conservative {
@@ -214,28 +219,6 @@ sub build_index {
     return $index;
 }
 
-sub build_mirror_index {
-    my($self, $local_mirror) = @_;
-
-    require File::chdir;
-    require Dist::Metadata;
-
-    my $index = {};
-
-    local $File::chdir::CWD = "$local_mirror/authors/id";
-
-    for my $file (<*/*/*/*>) { # D/DU/DUMMY/Foo-Bar-0.01.tar.gz
-        my $dist = Dist::Metadata->new(file => $file);
-
-        my $provides = $dist->package_versions;
-        while (my($package, $version) = each %$provides) {
-            $index->{$package} = { version => $version, meta => { pathname => 
$file } };
-        }
-    };
-
-    return $index;
-}
-
 sub is_core {
     my($self, $module, $want_ver, $perl_version) = @_;
     $perl_version ||= $];
diff --git a/lib/Carton/CLI.pm b/lib/Carton/CLI.pm
index 184fcf7..6653f83 100644
--- a/lib/Carton/CLI.pm
+++ b/lib/Carton/CLI.pm
@@ -138,10 +138,13 @@ sub cmd_bundle {
 
     my $local_mirror = $self->carton->local_mirror;
 
+    $self->carton->configure(
+        mirror_file => $self->mirror_file, # $lock object?
+    );
+
     if (my $cpanfile = $self->has_cpanfile) {
         $self->print("Bundling modules using $cpanfile\n");
         $self->carton->download_from_cpanfile($cpanfile, $local_mirror);
-        $self->carton->update_mirror_index($local_mirror);
     } else {
         $self->error("Can't locate build file\n");
     }

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

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to