summaryrefslogtreecommitdiffstats
path: root/urpme
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-19 17:10:12 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-19 17:10:12 +0000
commit22d3107b3224f91c04e8825ba8bc812dba63a7ef (patch)
treeee8f28bf683e7634a039909a7503cd3e7e53967f /urpme
parent7f79f78d1a0af648a116cd1e39a073e051502b9c (diff)
downloadurpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar
urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.gz
urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.bz2
urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.xz
urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.zip
Some more cleanup and refactorization.
Diffstat (limited to 'urpme')
-rw-r--r--urpme44
1 files changed, 22 insertions, 22 deletions
diff --git a/urpme b/urpme
index 1d5686d1..5c46339b 100644
--- a/urpme
+++ b/urpme
@@ -71,23 +71,28 @@ $urpm->configure(
);
#- examine packages...
-my @toremove = $urpm->find_packages_to_remove($state, \@l,
- test => $test, matches => $matches, auto => $auto, force => $force,
- callback_notfound => sub {
- my $urpm = shift @_;
- $urpm->{fatal}(1, (@_ > 1 ? N("unknown packages") : N("unknown package")) .
- ': ' . join(', ', @_)); 0 },
- callback_fuzzy => sub {
- my $urpm = shift @_;
- my $match = shift @_;
- $urpm->{fatal}(1, N("The following packages contain %s: %s",
- $match, join(' ', @_))); 0 },
- callback_base => sub {
- my $urpm = shift @_;
- foreach (@_) {
- $urpm->{error}(N("removing package %s will break your system", $_));
- } 0 },
- ) or $urpm->{fatal}(0, N("Nothing to remove"));
+my @toremove = $urpm->find_packages_to_remove(
+ $state,
+ \@l,
+ test => $test,
+ matches => $matches,
+ auto => $auto,
+ force => $force,
+ callback_notfound => sub {
+ my $urpm = shift @_;
+ $urpm->{fatal}(1, (@_ > 1 ? N("unknown packages") : N("unknown package")) .
+ ': ' . join(', ', @_)); 0 },
+ callback_fuzzy => sub {
+ my $urpm = shift @_;
+ my $match = shift @_;
+ $urpm->{fatal}(1, N("The following packages contain %s: %s",
+ $match, join(' ', @_))); 0 },
+ callback_base => sub {
+ my $urpm = shift @_;
+ foreach (@_) {
+ $urpm->{error}(N("removing package %s will break your system", $_));
+ } 0 },
+) or $urpm->{fatal}(0, N("Nothing to remove"));
my $list = join "\n", $urpm->translate_why_removed($state, sort @toremove);
if ($test && $auto) {
@@ -108,8 +113,3 @@ print STDOUT "\n".N("removing %s", join(' ', sort @toremove))."\n";
$urpm->parallel_remove(\@toremove, test => $test, force => $force, translate_message => 1) :
$urpm->install(\@toremove, {}, {}, test => $test, force => $force, translate_message => 1);
@l and $urpm->{fatal}(2, N("Removing failed") . ":\n" . join("\n", map { "\t$_" } @l));
-
-sub toMb {
- my $nb = $_[0] / 1024 / 1024;
- int $nb + 0.5;
-}