diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-10-04 01:22:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-10-04 01:22:45 +0000 |
commit | a00d3f1c44736ead44c338d6a4597fadcc6a6b4f (patch) | |
tree | 823e2b995c40dee9f57051d8024847d9254d83de /urpm.pm | |
parent | 2046f1e2016f0b94107810b77fb46a7dd4dd93f1 (diff) | |
download | urpmi-a00d3f1c44736ead44c338d6a4597fadcc6a6b4f.tar urpmi-a00d3f1c44736ead44c338d6a4597fadcc6a6b4f.tar.gz urpmi-a00d3f1c44736ead44c338d6a4597fadcc6a6b4f.tar.bz2 urpmi-a00d3f1c44736ead44c338d6a4597fadcc6a6b4f.tar.xz urpmi-a00d3f1c44736ead44c338d6a4597fadcc6a6b4f.zip |
Don't panic when one can't build a synthesis file from a local directory
containing rpms.
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -1808,11 +1808,17 @@ this could happen if you mounted manually the directory when creating the medium hdlist => "$urpm->{statedir}/$medium->{hdlist}", ); #- synthesis needs to be created, since the medium has been built from rpm files. - $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 ($@) { + $urpm->{error}(N("Unable to build hdlist and synthesis files for medium \"%s\"."), $medium->{name}); + unlink "$urpm->{statedir}/$medium->{hdlist}", "$urpm->{statedir}/synthesis.$medium->{hdlist}"; + } else { + $urpm->{log}(N("built hdlist synthesis file for medium \"%s\"", $medium->{name})); + } #- keep in mind we have a modified database, sure at this point. $urpm->{modified} = 1; } elsif ($medium->{synthesis}) { @@ -1843,8 +1849,7 @@ this could happen if you mounted manually the directory when creating the medium 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}); + $urpm->{error}(N("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})); |