Skip to content

Loading…

unused Module::Metadata #45

Merged
merged 2 commits into from

2 participants

@masaki

remove Dist::Metadata and Module::Metadata, and some dependencies.
common::sense and FCGI are bundling ok now.

masaki added some commits
@masaki masaki merged "bundle using install.json" branch
    use local install.json and MYMETA.json in bundling

    some modules are ok (e.g. common::sense, FCGI)
30f2112
@masaki masaki remove unused method f21d7fb
@miyagawa miyagawa merged commit d9c90ee into perl-carton:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 12, 2012
  1. @masaki

    merged "bundle using install.json" branch

    masaki committed
        use local install.json and MYMETA.json in bundling
    
        some modules are ok (e.g. common::sense, FCGI)
  2. @masaki

    remove unused method

    masaki committed
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 38 deletions.
  1. +0 −2 cpanfile
  2. +6 −35 lib/Carton.pm
  3. +4 −1 lib/Carton/CLI.pm
View
2 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 {
View
41 lib/Carton.pm
@@ -10,7 +10,6 @@ use Config qw(%Config);
use Carton::Util;
use CPAN::Meta;
use File::Path ();
-use File::Basename ();
use File::Spec ();
use File::Temp ();
use Capture::Tiny 'capture';
@@ -110,6 +109,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 +117,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 +218,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 ||= $];
@@ -345,17 +327,6 @@ sub run_cpanm {
!system "cpanm", "--quiet", "-L", $self->{path}, "--notest", @args;
}
-sub update_mirror_index {
- my($self, $local_mirror) = @_;
-
- my $index = $self->build_mirror_index($local_mirror);
-
- my $file = "$local_mirror/modules/02packages.details.txt.gz";
- File::Path::mkpath(File::Basename::dirname($file));
- $self->build_mirror_file($index, $file)
- or die "Bundling modules failed\n";
-}
-
sub update_lock_file {
my($self, $file) = @_;
View
5 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");
}
Something went wrong with that request. Please try again.