text
stringlengths
0
834k
}
# No Args -- installs default package
unless (@args) {
my @search_results = $o->cache_sets('search');
my $search_result_current = $o->cache_set_current('search');
unless (@search_results and
bounded(0, $search_result_current, $#search_results)) {
$o->warn(""No search results to install -- "" .
""use 'search' to find a package.\n"");
return;
}
else {
my @results = $o->cache_set('search');
my $npkgs = @results;
my $pkg;
if ($o->cache_entry('search')) {
my $n = $o->cache_set_index('search') + 1;
$o->inform(""Package $n:\n"");
$pkg = $o->cache_entry('search');
}
else {
$o->inform(""Package 1:\n"");
$pkg = $o->cache_entry('search', 0);
}
return $o->install_pkg($pkg, \%opts);
}
}
# Args provided
else {
# Install a particular number:
if (my @r = parse_range(@args)) {
my @search_results = $o->cache_sets('search');
my $search_result_current = $o->cache_set_current('search');
unless (@search_results and
bounded(0, $search_result_current, $#search_results)) {
$o->warn(""No search results to install -- "" .
""use 'search' to find a package.\n"");
return;
}
else {
my $ok = 0;
for my $n (@r) {
my $sr = $o->cache_set('search');
if (bounded(1, $n, scalar @$sr)) {
$o->inform(""Package $n:\n"");
my $pkg = $sr->[$n-1];
$ok++ if $o->install_pkg($pkg, \%opts);
}
else {
$o->inform(""No such package $n in result set.\n"");
}
}
return unless $ok;
}
}
# Install a particular package
else {
unless ($o->reps_all) {
$o->warn(""Can't install: no repositories defined.\n"");
}
else {
return $o->install_pkg($args[0], \%opts);
}
return;
}
}
1;
}
#============================================================================
# Target:
# t # displays a list of backend targets
# t [set] <\d+> # sets numbered target as default backend target
# t des [<\d+>] # describes the given (or default) target
#============================================================================
sub smry_targets { ""views or sets target installer backends"" }
sub help_targets { <<'END' }
targets -- View Target Installer Backends
Synopsis
target Displays a list of backend targets
target <number> Sets <number> as default backend target
target [select] <name or num>
Sets <name or num> as default backend target
target describe [name or num]
Describes the given (or default) target
target set <key> <val> Sets the target's <key> to <val>
target rename <name or num> <name>
Renames the given target to <name>
Description
The target is the destination location of the install routine, such as
the directory where the packages are installed when they're downloaded
from the repository. For example:
target