diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
commit | e2cbffc6422fc59ee624c2c399e79109c21c7cc4 (patch) | |
tree | 8bc16a2c6a23da765f7bd7ca08b5ad5dc676b6c5 /perl-install/pkgs.pm | |
parent | 9266168309a593e84c47cc59edb2a6ccd49e4686 (diff) | |
download | drakx-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar drakx-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.gz drakx-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.bz2 drakx-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.xz drakx-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.zip |
no_comment
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 43dca813c..faba585f5 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -116,12 +116,16 @@ sub packageFile { $pkg->{file} . "." . c::headerGetEntry($pkg->{header}, 'arch') . ".rpm"; } +sub cleanHeaders { + my ($prefix) = @_; + commands::rm("-rf", "$prefix/tmp/headers") if -e "$prefix/tmp/headers"; +} #- get all headers from an hdlist file. sub extractHeaders($$$) { my ($prefix, $pkgs, $medium) = @_; - commands::rm("-rf", "$prefix/tmp/headers") if -e "$prefix/tmp/headers"; + cleanHeaders($prefix); run_program::run("extract_archive", "$prefix/var/lib/urpmi/$medium->{hdlist}", @@ -375,7 +379,7 @@ sub getProvides($) { foreach my $pkg (@{$packages->[1]}) { map { my $provided = $packages->[1][$_] or die "invalid package index $_"; packageFlagBase($provided) or push @{$provided->{provides} ||= []}, $pkg; - } map { split '\|' } packageDepsId($pkg); + } map { split '\|' } grep { !/^NOTFOUND_/ } packageDepsId($pkg); } } @@ -742,7 +746,8 @@ sub install($$$;$$) { my $callbackOpen = sub { my $f = packageFile($packages{$_[0]}); print LOG "$f\n"; - my $fd = install_any::getFile($f) or log::l("ERROR: bad file $f"); + my $fd = install_any::getFile($f) or install_any::rewindGetFile(); + $fd ||= install_any::getFile($f) or log::l("ERROR: bad file $f"); $fd ? fileno $fd : -1; }; my $callbackClose = sub { packageSetFlagInstalled(delete $packages{$_[0]}, 1) }; @@ -811,7 +816,7 @@ sub install($$$;$$) { if (s/(installing package) .* (needs (?:.*) on the (.*) filesystem)/$1 $2/) { $parts{$3} ? 0 : ($parts{$3} = 1); } else { 1; } - } reverse @probs; + } reverse map { s|/mnt||; $_ } @probs; c::rpmdbClose($db); die "installation of rpms failed:\n ", join("\n ", @probs); @@ -821,6 +826,7 @@ sub install($$$;$$) { c::rpmdbClose($db); log::l("rpm database closed"); + cleanHeaders($prefix); install_any::rewindGetFile(); #- make sure to reopen the connection, usefull for ftp. } |