diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-08-03 13:10:08 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-08-03 13:10:08 +0000 |
commit | d62b92f1a113aad498b2f3f1ebfaad6008211784 (patch) | |
tree | 8a57e7e85581c61b83d6debe81034039e0f17cfb /urpm | |
parent | 73dea3e1611694cc346137d5d389cca3b9117434 (diff) | |
download | urpmi-d62b92f1a113aad498b2f3f1ebfaad6008211784.tar urpmi-d62b92f1a113aad498b2f3f1ebfaad6008211784.tar.gz urpmi-d62b92f1a113aad498b2f3f1ebfaad6008211784.tar.bz2 urpmi-d62b92f1a113aad498b2f3f1ebfaad6008211784.tar.xz urpmi-d62b92f1a113aad498b2f3f1ebfaad6008211784.zip |
- fix typo in previous commit
- export code in its own function: get_README_files()
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/install.pm | 14 |
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"; } |