summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:51:32 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:51:32 +0000
commit74691508a941e4df58820b90ae6fd323653cfe59 (patch)
treecea40261a56c849cfd0987ab803018fee5f7d66c
parentc3a726da8ee2a8705fd15590aae0643c4c770c1a (diff)
downloadurpmi-74691508a941e4df58820b90ae6fd323653cfe59.tar
urpmi-74691508a941e4df58820b90ae6fd323653cfe59.tar.gz
urpmi-74691508a941e4df58820b90ae6fd323653cfe59.tar.bz2
urpmi-74691508a941e4df58820b90ae6fd323653cfe59.tar.xz
urpmi-74691508a941e4df58820b90ae6fd323653cfe59.zip
(_log_installing) split it out of run()
-rw-r--r--urpm/main_loop.pm23
1 files changed, 14 insertions, 9 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index e99b8b54..6fe3d5cf 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -194,6 +194,19 @@ sub _init_common_options {
);
}
+sub _log_installing {
+ my ($urpm, $transaction_sources_install, $transaction_sources) = @_;
+ if (my @packnames = (values $transaction_sources_install, values $transaction_sources)) {
+ (my $common_prefix) = $packnames[0] =~ m!^(.*)/!;
+ if (length($common_prefix) && @packnames == grep { m!^\Q$common_prefix/! } @packnames) {
+ #- there's a common prefix, simplify message
+ $urpm->{print}(N("installing %s from %s", join(' ', map { s!.*/!!; $_ } @packnames), $common_prefix));
+ } else {
+ $urpm->{print}(N("installing %s", join "\n", @packnames));
+ }
+ }
+}
+
# locking is left to callers
sub run {
my ($urpm, $state, $something_was_to_be_done, $ask_unselect, $_requested, $callbacks) = @_;
@@ -301,15 +314,7 @@ sub run {
);
} else {
if ($options{verbose} >= 0) {
- if (my @packnames = (values %transaction_sources_install, values %$transaction_sources)) {
- (my $common_prefix) = $packnames[0] =~ m!^(.*)/!;
- if (length($common_prefix) && @packnames == grep { m!^\Q$common_prefix/! } @packnames) {
- #- there's a common prefix, simplify message
- $urpm->{print}(N("installing %s from %s", join(' ', map { s!.*/!!; $_ } @packnames), $common_prefix));
- } else {
- $urpm->{print}(N("installing %s", join "\n", @packnames));
- }
- }
+ _log_installing($urpm, \%transaction_sources_install, $transaction_sources);
}
my $to_remove = $urpm->{options}{'allow-force'} ? [] : $set->{remove} || [];
bug_log(scalar localtime(), " ", join(' ', values %transaction_sources_install, values %$transaction_sources), "\n");