summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-08 09:24:32 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-08 09:24:32 +0000
commit88ca294740bc8a59806b5e58e258c104a9769be5 (patch)
treecbc3b8bcc98bfa06388749623d76a45f14321941
parentf200c935f68847b0997b22a241bd1989efc352e2 (diff)
downloadurpmi-88ca294740bc8a59806b5e58e258c104a9769be5.tar
urpmi-88ca294740bc8a59806b5e58e258c104a9769be5.tar.gz
urpmi-88ca294740bc8a59806b5e58e258c104a9769be5.tar.bz2
urpmi-88ca294740bc8a59806b5e58e258c104a9769be5.tar.xz
urpmi-88ca294740bc8a59806b5e58e258c104a9769be5.zip
Support for README.urpmi in urpmi
-rw-r--r--urpm.pm23
1 files changed, 21 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 3912122e..e31c4545 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2677,6 +2677,7 @@ sub install_logger {
#- install packages according to each hashes (install or upgrade).
sub install {
my ($urpm, $remove, $install, $upgrade, %options) = @_;
+ my @readmes;
#- allow process to be forked now.
my $pid;
@@ -2760,7 +2761,16 @@ sub install {
$urpm->{error}(N("unable to access rpm file [%s]", $install->{$id} || $upgrade->{$id}));
return fileno $fh;
};
- $options{callback_close} ||= sub { close $fh };
+ $options{callback_close} ||= sub {
+ my ($urpm, undef, $pkgid) = @_;
+ return unless defined $pkgid;
+ my $pkg = $urpm->{depslist}[$pkgid];
+ my $fullname = $pkg->fullname();
+ my $trtype = (grep { /$fullname/ } values %$install) ? 'install' : 'upgrade';
+ push @readmes, map { [ $_, $fullname ] } grep {
+ /\bREADME(\.$trtype)?\.urpmi$/
+ } $pkg->files();
+ };
if (keys %$install || keys %$upgrade) {
$options{callback_inst} ||= \&install_logger;
$options{callback_trans} ||= \&install_logger;
@@ -2791,7 +2801,16 @@ sub install {
close ERROR_OUTPUT;
#- keep safe exit now (with destructor call).
exit 0;
- } else {
+ } else { #- parent process
+ if (@readmes) {
+ if ($urpm::args::options{X}) {
+ } else {
+ foreach (@readmes) {
+ print "-" x 70, "\n", N("More information on package %s", $_->[1]), "\n";
+ print cat_($_->[0]), "-" x 70, "\n";
+ }
+ }
+ }
return @l;
}
}