Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
DuckPAN: make reinstall do reinstall.
Browse files Browse the repository at this point in the history
force is much more dangerous, ignoring test results and the whole
ordeal.  This should reinstall if it's possible.
  • Loading branch information
mwmiller committed Nov 7, 2014
1 parent 4895b6d commit a38a01c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist.ini
Expand Up @@ -35,7 +35,7 @@ push_to = origin master

[Prereqs]
autodie = 2.25
App::cpanminus = 1.5007
App::cpanminus = 1.7014
Class::Load = 0.18
Config::INI = 0.019
CPAN::Repository = 0.007
Expand Down
2 changes: 1 addition & 1 deletion lib/App/DuckPAN.pm
Expand Up @@ -249,7 +249,7 @@ sub execute {
$self->empty_cache();
push @modules, 'App::DuckPAN';
push @modules, 'DDG' if $_ =~ /^(?:upgrade|reinstall)$/i;
unshift @modules, 'force' if lc($_) eq 'reinstall';
unshift @modules, 'reinstall' if lc($_) eq 'reinstall';
} else {
push @left_args, $_;
}
Expand Down
12 changes: 6 additions & 6 deletions lib/App/DuckPAN/Perl.pm
Expand Up @@ -73,10 +73,10 @@ sub cpanminus_install_error {
sub duckpan_install {
my ($self, @modules) = @_;
my $mirror = $self->app->duckpan;
my $force_install;
if ($modules[0] eq 'force') {
# We sent in a signal to force installation
$force_install = 1;
my $reinstall;
if ($modules[0] eq 'reinstall') {
# We sent in a signal to force reinstallation
$reinstall = 1;
shift @modules;
}
my $modules_string = join(' ', @modules);
Expand All @@ -98,7 +98,7 @@ sub duckpan_install {
my $duckpan_module_url = $self->app->duckpan . 'authors/id/' . $module->distribution->pathname;

my $install_it;
if ($force_install) {
if ($reinstall) {
$install_it = 1;
} elsif ($pin_version && $localver) {
print "$_: $localver installed, $pin_version pin, $duckpan_module_version latest\n";
Expand All @@ -119,7 +119,7 @@ sub duckpan_install {
}
}
return 0 unless @to_install;
unshift @to_install, '-f' if ($force_install); # cpanm will do the actual forcing.
unshift @to_install, '--reinstall' if ($reinstall); # cpanm will do the actual forcing.
return system("cpanm " . join(" ", @to_install));
}

Expand Down

0 comments on commit a38a01c

Please sign in to comment.