diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-28 07:28:28 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-28 07:28:28 +0000 |
commit | d594077fc061527d36a603e58c8867a3df6b45eb (patch) | |
tree | add9cd0c8b37e82f0b6bb5662c943cb262eed755 | |
parent | 56223939813d5de0d9142488d1727547b9b40d2e (diff) | |
download | urpmi-d594077fc061527d36a603e58c8867a3df6b45eb.tar urpmi-d594077fc061527d36a603e58c8867a3df6b45eb.tar.gz urpmi-d594077fc061527d36a603e58c8867a3df6b45eb.tar.bz2 urpmi-d594077fc061527d36a603e58c8867a3df6b45eb.tar.xz urpmi-d594077fc061527d36a603e58c8867a3df6b45eb.zip |
Better error message when updating a media fails because the hdlist
is corrupted.
-rw-r--r-- | urpm.pm | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1836,11 +1836,18 @@ this could happen if you mounted manually the directory when creating the medium #- check if the synthesis file can be built. if (($second_pass || $medium->{modified_synthesis}) && !$medium->{modified}) { unless ($medium->{virtual}) { - $urpm->build_synthesis(start => $medium->{start}, - end => $medium->{end}, - synthesis => "$urpm->{statedir}/synthesis.$medium->{hdlist}", - ); - $urpm->{log}(N("built hdlist synthesis file for medium \"%s\"", $medium->{name})); + eval { $urpm->build_synthesis( + start => $medium->{start}, + end => $medium->{end}, + synthesis => "$urpm->{statedir}/synthesis.$medium->{hdlist}", + ) }; + if ($@) { + #- TODO translate this + $urpm->{error}("Unable to build synthesis file for medium \"%s\". Your hdlist file may be corrupted.", $medium->{name}); + unlink "$urpm->{statedir}/synthesis.$medium->{hdlist}"; + } else { + $urpm->{log}(N("built hdlist synthesis file for medium \"%s\"", $medium->{name})); + } } #- keep in mind we have modified database, sure at this point. $urpm->{modified} = 1; |