summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-05 10:33:39 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-05 10:33:39 +0000
commita1810a1e46c7395937e3d509b99c9b856fc28d5d (patch)
tree4a3819b6e9141b64bf077ca4271cbc394b8aa27b
parent9912053d069dcd3cf6fb47b7ffe53fda2ca41ec3 (diff)
downloadurpmi-a1810a1e46c7395937e3d509b99c9b856fc28d5d.tar
urpmi-a1810a1e46c7395937e3d509b99c9b856fc28d5d.tar.gz
urpmi-a1810a1e46c7395937e3d509b99c9b856fc28d5d.tar.bz2
urpmi-a1810a1e46c7395937e3d509b99c9b856fc28d5d.tar.xz
urpmi-a1810a1e46c7395937e3d509b99c9b856fc28d5d.zip
More error checking when generating names file
-rw-r--r--urpm.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 9006bdb8..c911eff3 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2023,9 +2023,15 @@ this could happen if you mounted manually the directory when creating the medium
my $fh = $urpm->open_safe(">", "$urpm->{statedir}/names.$_->{name}");
if ($fh) {
foreach ($_->{start} .. $_->{end}) {
- print $fh $urpm->{depslist}[$_]->name . "\n";
+ if (defined $urpm->{depslist}[$_]) {
+ print $fh $urpm->{depslist}[$_]->name . "\n";
+ } else {
+ $urpm->{error}(N("Error generating names file: dependency %d not found", $_));
+ }
}
close $fh;
+ } else {
+ $urpm->{error}(N("Error generating names file: Can't write to file (%s)", $!));
}
}
}