text stringlengths 0 834k |
|---|
} |
else { |
my @res = $o->cache_set('search'); |
my $npkgs = @res; |
$o->inform(""$SEP\n""); |
if ($o->cache_entry('search')) { |
my $n = $o->cache_set_index('search') + 1; |
$o->inform(""Package $n:\n""); |
$o->$displayer($o->cache_entry('search')); |
} |
elsif (defined $o->cache_entry('search', 0)) { |
$o->inform(""Package 1:\n""); |
$o->$displayer($o->cache_entry('search', 0)); |
$o->cache_set_index('search', 0); |
} |
else { |
$o->warn(""Search Results are empty -- use 'search' again.\n""); |
} |
$o->inform(""$SEP\n""); |
} |
} |
# Args provided |
else { |
# Describe 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 (bounded(0, $search_result_current, $#search_results)) { |
$o->warn(""No search results to describe -- "" . |
""use 'search' to find a package.\n""); |
return; |
} |
else { |
for my $n (@r) { |
my $sr = $o->cache_set('search'); |
$o->inform(""$SEP\n""); |
if (bounded(1, $n, scalar @$sr)) { |
$o->inform(""Package $n:\n""); |
$o->$displayer($o->cache_entry('search', $n-1)); |
} |
else { |
$o->inform(""No such package $n in result set.\n""); |
} |
$o->cache_set_index('search', $n - 1); |
} |
$o->inform(""$SEP\n""); |
} |
} |
# Describe a particular package |
else { |
return unless $o->assert( |
scalar $o->reps_on, |
""No repositories -- use 'rep add' to add a repository.\n"" |
); |
my ($set, $index) = $o->cache_find('search', $args[0]); |
my ($ok, $pkg); |
if ($index >= 0) { |
$o->cache_set_current('search', $set); |
$o->cache_set_index('search', $index); |
$pkg = $o->cache_entry('search'); |
} |
else { |
$ok = PPM::UI::describe([$o->reps_on], |
$o->conf('target'), $args[0]); |
unless ($ok->is_success) { |
$o->inform($ok->msg); |
return unless $ok->ok; |
} |
$pkg = $ok->result; |
$o->cache_set_add('search', $args[0], [$pkg]); |
my $last = $o->cache_sets('search') - 1; |
$o->cache_set_current('search', $last); |
$o->cache_set_index('search', 0); |
} |
$o->inform(""$SEP\n""); |
$o->$displayer($pkg); |
$o->inform(""$SEP\n""); |
} |
} |
1; |
} |
#============================================================================ |
# Install: |
# i # installs default or current package |
# i <\d+> # installs numbered package in current search set |
# i <pkg> # installs named package |
# i <url> # installs the package at <url> |
#============================================================================ |
sub smry_install { ""installs packages"" } |
sub help_install { <<'END' } |
install -- Install Packages |
Synopsis |
install Installs default package |
install <number> Installs packages by a specific <number> |
install <range> Installs packages in the given numeric <range> |
install <name> Installs named package |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.