[carton] 159/472: drop uninstall command

Lucas Kanashiro kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:43 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 76204ccce01dab0ad307d67beeda9bf3357bbfde
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date:   Thu Apr 12 21:40:03 2012 +0900

    drop uninstall command
---
 lib/Carton/CLI.pm            | 58 -------------------------------------------
 lib/Carton/Doc/Uninstall.pod | 25 -------------------
 xt/cli/uninstall.t           | 20 ---------------
 xt/cli/uninstall_dep.t       | 59 --------------------------------------------
 4 files changed, 162 deletions(-)

diff --git a/lib/Carton/CLI.pm b/lib/Carton/CLI.pm
index b673478..90a1b78 100644
--- a/lib/Carton/CLI.pm
+++ b/lib/Carton/CLI.pm
@@ -187,64 +187,6 @@ sub cmd_install {
     $self->printf("Complete! Modules were installed into %s\n", $self->carton->{path}, SUCCESS);
 }
 
-sub cmd_uninstall {
-    my($self, @args) = @_;
-
-    $self->parse_options(\@args, "p|path=s", sub { $self->carton->{path} = $_[1] });
-
-    my $lock = $self->find_lock
-        or $self->error("Can't find carton.lock: Run `carton install`");
-
-    my $index = $self->carton->build_index($lock->{modules});
-
-    my @meta;
-    for my $module (@args) {
-        if (exists $index->{$module}) {
-            push @meta, $index->{$module}{meta};
-        } else {
-            $self->print("Can't locate module $module\n", WARN);
-        }
-    }
-
-    my %root;
-    if ($self->has_cpanfile) {
-        for my $dep ($self->carton->list_dependencies) {
-            my($mod, $ver) = split /~/, $dep;
-            if (exists $index->{$mod}) {
-                $root{ $index->{$mod}{meta}{name} } = 1;
-            }
-        }
-    }
-
-    # only can uninstall root dependencies
-    my $tree = $self->carton->build_tree($lock->{modules}, \%root);
-    for my $root ($tree->children) {
-        if (grep $_->{name} eq $root->key, @meta) {
-            $tree->remove_child($root);
-        }
-    }
-
-    my @missing = grep !$tree->find_child($_), keys %{$lock->{modules}};
-    for my $module (@missing) {
-        my $meta = $lock->{modules}{$module};
-        $self->print("Uninstalling $meta->{dist}\n");
-        $self->carton->uninstall($lock, $module);
-    }
-
-    for my $meta (@meta) {
-        unless (grep $meta->{name} eq $_, @missing) {
-            $self->print("$meta->{name} is dependent by some other modules. Can't uninstall it.\n", WARN);
-        }
-    }
-
-    $self->carton->update_lock_file($self->lock_file);
-
-    if (@missing) {
-        $self->printf("Complete! Modules and its dependencies were uninstalled from %s\n",
-                      $self->carton->{path}, SUCCESS);
-    }
-}
-
 sub mirror_file {
     my $self = shift;
     return $self->work_file("02packages.details.txt");
diff --git a/lib/Carton/Doc/Uninstall.pod b/lib/Carton/Doc/Uninstall.pod
deleted file mode 100644
index e09002d..0000000
--- a/lib/Carton/Doc/Uninstall.pod
+++ /dev/null
@@ -1,25 +0,0 @@
-=head1 NAME
-
-Carton::Doc::Uninstall - uninstall modules from your local environment
-
-=head1 SYNOPSIS
-
-  carton uninstall Module
-
-=head1 DESCRIPTION
-
-This command allows you to uninstall modules and its dependencies from
-your local environment.
-
-You're only allowed to uninstall modules that are not dependent by
-other modules. So if you have a dependency tree like:
-
-  Dancer-2.1
-    URI-1.5
-  HTTP-Body-1.3
-    LWP-1.2
-      URI-1.4
-
-you can uninstall either I<HTTP::Body> or I<Dancer>, but when you
-uninstall I<Dancer>, because I<URI> is referenced by I<LWP>, it will
-uninstall only I<Dancer>.
diff --git a/xt/cli/uninstall.t b/xt/cli/uninstall.t
deleted file mode 100644
index f3d3ca1..0000000
--- a/xt/cli/uninstall.t
+++ /dev/null
@@ -1,20 +0,0 @@
-use strict;
-use Test::More;
-use xt::CLI;
-
-{
-    my $app = cli();
-
-    $app->run("install", "Try::Tiny");
-    $app->run("list");
-    like $app->output, qr/Try-Tiny-/;
-
-    $app->run("uninstall", "Try::Tiny");
-    like $app->output, qr/Uninstalling Try-Tiny-/;
-
-    $app->run("list");
-    like $app->output, qr/^\s*$/s;
-}
-
-done_testing;
-
diff --git a/xt/cli/uninstall_dep.t b/xt/cli/uninstall_dep.t
deleted file mode 100644
index 684961c..0000000
--- a/xt/cli/uninstall_dep.t
+++ /dev/null
@@ -1,59 +0,0 @@
-use strict;
-use Test::More;
-use xt::CLI;
-use Cwd;
-
-{
-    my $app = cli();
-
-    $app->dir->touch("Makefile.PL", <<EOF);
-use ExtUtils::MakeMaker;
-WriteMakefile(
-  NAME => 'foo',
-  VERSION => '0.1',
-  PREREQ_PM => {
-    CGI  => 3.50,
-    FCGI => 0.72,
-  },
-);
-EOF
-
-    $app->run("install");
-    $app->run("uninstall", "CGI");
-
-    like $app->output, qr/Uninstalling CGI/;
-    unlike $app->output, qr/Uninstalling FCGI/;
-
-    $app->run("list");
-    unlike $app->output, qr/^CGI-/m;
-    like $app->output, qr/FCGI-/;
-
-    $app->run("uninstall", "FCGI");
-    like $app->output, qr/Uninstalling FCGI/;
-}
-
-{
-    my $app = cli();
-
-    $app->dir->touch("Makefile.PL", <<EOF);
-use ExtUtils::MakeMaker;
-WriteMakefile(
-  NAME => 'foo',
-  VERSION => '0.1',
-  PREREQ_PM => {
-    'JSON::PP' => 0,
-    'CPAN::Meta' => 0,
-  },
-);
-EOF
-
-    $app->run("install");
-    $app->run("uninstall", "JSON::PP");
-
-    like $app->output, qr/JSON::PP is dependent by/;
-}
-
-done_testing;
-
-
-

-- 
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