text
stringlengths
0
834k
[qw(Name Version Author Title Abstract), @$extra_keys],
[(map { $pkg_des->$_ } qw(name version author title abstract)),
@$extra_vals],
undef, # separator
undef, # left
undef, # indent
undef, # length
1, # wrap (yes, please wrap)
);
# The repository:
if (my $rep = $pkg_des->repository) {
$o->print_pairs(
[""Location""],
[$rep->name],
undef, # separator
undef, # left
undef, # indent
$n, # length
1, # wrap
);
}
# Prerequisites:
my @impls = grep { $_->architecture } $pkg_des->implementations;
my @prereqs = @impls ? $impls[0]->prereqs : ();
$o->inform(""Prerequisites:\n"") if @prereqs;
$o->print_pairs(
[ 1 .. @prereqs ],
[ map { $_->name . ' ' . $_->version} @prereqs ],
'. ', # separator
undef, # left
undef, # indent
$n, # length
0, # wrap (no, please don't wrap)
);
# Implementations:
$o->inform(""Available Platforms:\n"") if @impls;
my @impl_strings;
for (@impls) {
my $arch = $_->architecture;
my $os = $_->os;
my $osver = $_->osversion;
my $str = $arch;
$osver =~ s/\Q(any version)\E//g;
if ($os and $osver) {
$str .= "", $os $osver"";
}
push @impl_strings, $str;
}
@impl_strings = dictsort @impl_strings;
$o->print_pairs(
[ 1 .. @impls ],
[ @impl_strings ],
'. ', undef, undef, $n
);
}
sub remove_pkg {
my $o = shift;
my $package = shift;
my $target = $o->conf('target');
my $force = shift;
my $quell_clear = shift;
my $verbose = $o->conf('remove-verbose');
my $ok = PPM::UI::remove($target, $package, $force, sub { $o->cb_remove(@_) }, $verbose);
unless ($ok->is_success) {
$o->warn($ok->msg);
return 0 unless $ok->ok;
}
else {
$o->warn_profile_change($ok);
}
$o->cache_clear('query') if ($ok->ok and not $quell_clear);
1;
}
sub upgrade_pkg {
push @_, 'upgrade';
goto &install_pkg;
}
sub install_pkg {
my $o = shift;
my $pkg = shift;
my $opts = shift;
my $action = shift;
my $quell_clear = shift;
$action = 'install' unless defined $action;
# Find the package:
while (1) {
# 1. Return if they specified a full filename or URL:
last if PPM::UI::is_pkg($pkg);
# 2. Check if whatever they specified returns 1 search result:
my $search =
PPM::UI::search([$o->reps_on], $o->conf('target'), $pkg,
$o->conf('case-sensitivity'));
unless ($search->is_success) {