diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-11-15 10:24:20 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-11-15 10:24:20 +0000 |
commit | 9b4d2a055a190d5f110acb9233d503b4c9498c81 (patch) | |
tree | 85424665fa3d35d3654209b471b4963fda4a6998 | |
parent | 5d6d890b544246a36caa4d13a8a4b1e8c1287ac9 (diff) | |
download | urpmi-9b4d2a055a190d5f110acb9233d503b4c9498c81.tar urpmi-9b4d2a055a190d5f110acb9233d503b4c9498c81.tar.gz urpmi-9b4d2a055a190d5f110acb9233d503b4c9498c81.tar.bz2 urpmi-9b4d2a055a190d5f110acb9233d503b4c9498c81.tar.xz urpmi-9b4d2a055a190d5f110acb9233d503b4c9498c81.zip |
Display a README.urpmi only once. It could be displayed twice if the end of
installation callback was called twice, which happens when a package has both
post and posttrans hooks.
-rw-r--r-- | urpm.pm | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -2925,7 +2925,7 @@ sub install_logger { #- install packages according to each hash (remove, install or upgrade). sub install { my ($urpm, $remove, $install, $upgrade, %options) = @_; - my @readmes; + my %readmes; #- allow process to be forked now. my $pid; @@ -3022,9 +3022,7 @@ sub install { my $pkg = $urpm->{depslist}[$pkgid]; my $fullname = $pkg->fullname; my $trtype = (grep { /$fullname/ } values %$install) ? 'install' : '(upgrade|update)'; - push @readmes, map { [ $_, $fullname ] } grep { - /\bREADME(\.$trtype)?\.urpmi$/; - } $pkg->files; + for ($pkg->files) { /\bREADME(\.$trtype)?\.urpmi$/ and $readmes{$_} = $fullname } close $fh if defined $fh; }; if (scalar keys %$install || scalar keys %$upgrade) { @@ -3059,10 +3057,10 @@ sub install { #- keep safe exit now (with destructor call). exit 0; } else { #- parent process - if (@readmes) { - foreach (@readmes) { - print "-" x 70, "\n", N("More information on package %s", $_->[1]), "\n"; - my $fh; open $fh, '<', $_->[0] and do { + if (keys %readmes) { + foreach (keys %readmes) { + print "-" x 70, "\n", N("More information on package %s", $readmes{$_}), "\n"; + my $fh; open $fh, '<', $_ and do { print while <$fh>; close $fh; }; |