summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-01-16 18:21:42 +0000
committerFrancois Pons <fpons@mandriva.com>2002-01-16 18:21:42 +0000
commit43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68 (patch)
treea83977b31deaaef21f71ce946e6695402c0c60c5 /urpm.pm
parenta9a81651654af34db20a0b4bab4488c7a50cab38 (diff)
downloadurpmi-43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68.tar
urpmi-43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68.tar.gz
urpmi-43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68.tar.bz2
urpmi-43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68.tar.xz
urpmi-43a2e10ca24e7e3aefc448a81d2b5ecb1ad75a68.zip
3.2-1mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm31
1 files changed, 17 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index 073d51a0..b2323f75 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw($VERSION @ISA);
use Fcntl ':flock';
-$VERSION = '3.1';
+$VERSION = '3.2';
=head1 NAME
@@ -554,14 +554,7 @@ sub build_synthesis_hdlist {
my ($urpm, $medium, $use_parsehdlist) = @_;
unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
- if ($use_parsehdlist) {
- #- building synthesis file using parsehdlist output, need 4.0-1mdk or above.
- if (system "parsehdlist --compact --info --provides --requires '$urpm->{statedir}/$medium->{hdlist}' | gzip >'$urpm->{statedir}/synthesis.$medium->{hdlist}'") {
- unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
- $urpm->{error}(_("unable to build synthesis file for medium \"%s\"", $medium->{name}));
- return;
- }
- } else {
+ unless ($use_parsehdlist) {
#- building synthesis file using internal params.
local *F;
open F, "| gzip >'$urpm->{statedir}/synthesis.$medium->{hdlist}'";
@@ -573,7 +566,12 @@ sub build_synthesis_hdlist {
$p->{name}, 'info', "$p->{name}-$p->{version}-$p->{release}.$p->{arch}",
$p->{serial} || 0, $p->{size} || 0, $p->{group}, $p->{file} ? ($p->{file}) : ()). "\n";
}
- unless (close F) {
+ close F or unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
+ }
+ if (-s "$urpm->{statedir}/synthesis.$medium->{hdlist}" <= 32) {
+ #- building synthesis file using parsehdlist output, need 4.0-1mdk or above.
+ $use_parsehdlist or $urpm->{error}(_("unable to build hdlist synthesis, using parsehdlist method"));
+ if (system "parsehdlist --synthesis '$urpm->{statedir}/$medium->{hdlist}' | gzip >'$urpm->{statedir}/synthesis.$medium->{hdlist}'") {
unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}";
$urpm->{error}(_("unable to build synthesis file for medium \"%s\"", $medium->{name}));
return;
@@ -918,16 +916,17 @@ sub update_media {
#- build synthesis files once requires/files have been matched by rpmtools::read_hdlists.
if (my @rebuild_synthesis = grep { $_->{modified_synthesis} && !$_->{modified} } @{$urpm->{media}}) {
#- cleaning whole data structures (params and per media).
+ $urpm->{log}(_("examining whole urpmi database"));
$urpm->clean;
foreach my $medium (@{$urpm->{media} || []}) {
$medium->{ignore} || $medium->{modified} and next;
if ($medium->{synthesis}) {
#- reading the synthesis allow to propagate requires to files, so that if an hdlist can have them...
- $urpm->{log}(_("reading synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
+ $urpm->{log}(_("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$medium->{hdlist}"));
$urpm->parse_synthesis($medium, examine_requires => 1);
} else {
- $urpm->{log}(_("reading hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
+ $urpm->{log}(_("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
$urpm->{params}->read_hdlists("$urpm->{statedir}/$medium->{hdlist}");
}
}
@@ -937,8 +936,12 @@ sub update_media {
foreach my $medium (@{$urpm->{media} || []}) {
$medium->{ignore} || $medium->{modified} and next;
unless ($medium->{synthesis}) {
- $urpm->{log}(_("reading hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
+ $urpm->{log}(_("examining hdlist file [%s]", "$urpm->{statedir}/$medium->{hdlist}"));
my @fullnames = $urpm->{params}->read_hdlists("$urpm->{statedir}/$medium->{hdlist}");
+ while (!@fullnames) {
+ $urpm->{error}(_("problem reading hdlist file, trying again"));
+ @fullnames = $urpm->{params}->read_hdlists("$urpm->{statedir}/$medium->{hdlist}");
+ }
$medium->{depslist} = [];
push @{$medium->{depslist}}, $urpm->{params}{info}{$_} foreach @fullnames;
}
@@ -1237,7 +1240,7 @@ sub search_packages {
foreach my $id (0 .. $#{$urpm->{params}{depslist}}) {
my $info = $urpm->{params}{depslist}[$id];
- rpmtools::compat_arch($info->{arch}) && (!$options{use_active} || $info->{active}) or next;
+ rpmtools::compat_arch($info->{arch}) or next;
my $pack_ra = "$info->{name}-$info->{version}";
my $pack_a = "$pack_ra-$info->{release}";