summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/install.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/urpm/install.pm b/urpm/install.pm
index f8a9ebb6..fbdb7ef1 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -94,6 +94,13 @@ sub install_logger {
}
}
+sub get_README_files {
+ my ($urpm, $pkg) = @_;
+ my $fullname = $pkg->fullname;
+ my $trtype = $pkg->flag_installed ? '(upgrade|update)' : 'install';
+ foreach ($pkg->files) { /\bREADME(\.$trtype)?\.urpmi$/ and $urpm->{readmes}{$_} = $fullname }
+}
+
#- install packages according to each hash (remove, install or upgrade).
#- options:
#- test, excludepath, nodeps, noorder (unused), delta,
@@ -161,10 +168,7 @@ sub install {
$options{callback_close} ||= sub {
my ($urpm, undef, $pkgid) = @_;
return unless defined $pkgid;
- my $pkg = $urpm->{depslist}[$pkgid];
- my $fullname = $pkg->fullname;
- my $trtype = $pkg->flag_installed ? '(upgrade|update)' : 'install';
- foreach ($pkg->files) { /\bREADME(\.$trtype)?\.urpmi$/ and $urpm->{readmes}{$_} = $fullname }
+ get_README_files($urpm, $urpm->{depslist}[$pkgid]);
close $fh if defined $fh;
};
$options{callback_uninst} = sub {
@@ -198,7 +202,7 @@ sub install {
if ($::verbose >= 0) {
foreach (keys %{$urpm->{readmes}}) {
- print "-" x 70, "\n", N("More information on package %s", $readmes{$_}), "\n";
+ print "-" x 70, "\n", N("More information on package %s", $urpm->{readmes}{$_}), "\n";
print cat_(($urpm->{root} || '') . $_);
print "-" x 70, "\n";
}