summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-03 16:32:59 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-03 16:32:59 +0000
commite797765e6d4189f0603a0066742cba64a42c7eef (patch)
tree8407af060994dcfce9555880be5fea08e24b1c55
parentef685055822f73fae5f01b7f8558f1e4d3a5a6cf (diff)
downloadurpmi-e797765e6d4189f0603a0066742cba64a42c7eef.tar
urpmi-e797765e6d4189f0603a0066742cba64a42c7eef.tar.gz
urpmi-e797765e6d4189f0603a0066742cba64a42c7eef.tar.bz2
urpmi-e797765e6d4189f0603a0066742cba64a42c7eef.tar.xz
urpmi-e797765e6d4189f0603a0066742cba64a42c7eef.zip
Less verbose message when displaying the list of packages to install
(factorize common prefix)
-rwxr-xr-xurpmi20
1 files changed, 13 insertions, 7 deletions
diff --git a/urpmi b/urpmi
index fb86942b..2194b27a 100755
--- a/urpmi
+++ b/urpmi
@@ -30,7 +30,7 @@ my $urpm = new urpm;
#- default options.
our $update = 0;
our $media = '';
-our $searchmedia = undef;
+our $searchmedia;
our $excludemedia = '';
our $sortmedia = '';
our $synthesis = '';
@@ -173,7 +173,7 @@ urpm::args::parse_cmdline(urpm => $urpm);
sub untaint {
my @r;
foreach (@_) { /(.*)/, push @r, $1 }
- @r == 1 ? $r[0] : @r
+ @r == 1 ? $r[0] : @r;
}
# Process the rest of the arguments
@@ -393,7 +393,7 @@ sub ask_choice {
(scalar $_->fullname)
. ($_->summary ? ' : ' . $_->summary : '')
. ($_->flag_installed ? ' (to upgrade)' : '')
- . ($_->flag_upgrade ? ' (to install)' : '')
+ . ($_->flag_upgrade ? ' (to install)' : '');
} @$choices;
if (@l > 1 && !$urpm->{options}{auto}) {
@@ -686,7 +686,7 @@ foreach my $set (@{$state->{transaction} || []}) {
}
}
- if (%transaction_sources_install || %transaction_sources) {
+ if (keys(%transaction_sources_install) || keys(%transaction_sources)) {
if ($parallel) {
message(N("distributing %s", join(' ', values %transaction_sources_install, values %transaction_sources)), 'noX');
#- no remove are handle here, automatically done by each distant node.
@@ -695,14 +695,20 @@ foreach my $set (@{$state->{transaction} || []}) {
test => $test,
excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
} else {
- %transaction_sources_install || %transaction_sources and
- message(N("installing %s", join(' ', values %transaction_sources_install, values %transaction_sources)), 'noX');
+ my @packnames = (values %transaction_sources_install, values %transaction_sources);
+ (my $common_prefix) = $packnames[0] =~ /^(.*)\//;
+ if (length($common_prefix) && @packnames == grep { /^\Q$common_prefix\// } @packnames) {
+ #- there's a common prefix, simplify message
+ message(N("installing %s from %s", join(' ', map { s/.*\///; $_ } @packnames), $common_prefix), 'noX');
+ } else {
+ message(N("installing %s", join(' ', @packnames)), 'noX');
+ }
@{!$urpm->{options}{'allow-force'} && $set->{remove} || []} and
message(N("removing %s", join(' ', @{!$urpm->{options}{'allow-force'} && $set->{remove} || []})), 'noX');
log_it(scalar localtime, " ", join(' ', values %transaction_sources_install, values %transaction_sources), "\n");
$urpm->{log}("starting installing packages");
my $progress_nb;
- my $total_nb = grep { m|^/| } values %transaction_sources_install, values %transaction_sources;
+ my $total_nb = scalar grep { m|^/| } values %transaction_sources_install, values %transaction_sources;
my $callback_inst = $urpm::args::options{X} && sub {
my ($urpm, $type, $id, $subtype, $amount, $total) = @_;
my $pkg = defined $id && $urpm->{depslist}[$id];