diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-05-04 14:47:19 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-05-04 14:47:19 +0000 |
commit | ab0cfb7370c3c3cef0cdb8d8290937274679bcad (patch) | |
tree | ad5852b0b4ec132bdb2d404147a1fc395464126c /urpm.pm | |
parent | 42695e87b3daf98dc387a80e0e61eb839046e63d (diff) | |
download | urpmi-ab0cfb7370c3c3cef0cdb8d8290937274679bcad.tar urpmi-ab0cfb7370c3c3cef0cdb8d8290937274679bcad.tar.gz urpmi-ab0cfb7370c3c3cef0cdb8d8290937274679bcad.tar.bz2 urpmi-ab0cfb7370c3c3cef0cdb8d8290937274679bcad.tar.xz urpmi-ab0cfb7370c3c3cef0cdb8d8290937274679bcad.zip |
- in urpmi.addmedia, if a "with" argument was provided on the command-line,
don't probe for synthesis or hdlist files in other directories
- check return value from system("cp"...) and log errors
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 38 |
1 files changed, 24 insertions, 14 deletions
@@ -664,7 +664,7 @@ sub add_distrib_media { # (Olivier Thauvin): Is this a workaround ? $urpm->{media} or $urpm->read_config; - #- try to copy/retrive Mandrake/basehdlists file. + #- try to copy/retrieve Mandrake/basehdlists file. if (my ($dir) = $url =~ m!^(?:removable[^:]*|file):/(.*)!) { $hdlists_file = reduce_pathname("$dir/Mandrake/base/hdlists"); @@ -1151,7 +1151,10 @@ this could happen if you mounted manually the directory when creating the medium my $local_list = $medium->{with_hdlist} =~ /hd(list.*)\.cz2?$/ ? $1 : 'list'; my $path_list = reduce_pathname("$with_hdlist_dir/../$local_list"); -e $path_list or $path_list = "$dir/list"; - -e $path_list and system("cp", "-p", "-R", $path_list, "$urpm->{cachedir}/partial/list"); + if (-e $path_list) { + system("cp", "-p", "-R", $path_list, "$urpm->{cachedir}/partial/list") + and $urpm->{log}(N("...copying failed")); + } } } else { #- try to find rpm files, use recursive method, added additional @@ -1205,7 +1208,9 @@ this could happen if you mounted manually the directory when creating the medium my $local_pubkey = $medium->{with_hdlist} =~ /hdlist(.*)\.cz2?$/ ? "pubkey$1" : 'pubkey'; my $path_pubkey = reduce_pathname("$with_hdlist_dir/../$local_pubkey"); -e $path_pubkey or $path_pubkey = "$dir/pubkey"; - -e $path_pubkey and system("cp", "-p", "-R", $path_pubkey, "$urpm->{cachedir}/partial/pubkey"); + -e $path_pubkey + and system("cp", "-p", "-R", $path_pubkey, "$urpm->{cachedir}/partial/pubkey") + and $urpm->{log}(N("...copying failed")); } } else { my $basename; @@ -1326,11 +1331,12 @@ this could happen if you mounted manually the directory when creating the medium $options{callback} && $options{callback}('retrieve', $medium->{name}); if ($options{probe_with}) { my ($suffix) = $dir =~ m|RPMS([^/]*)/*$|; - - foreach my $with_hdlist ( - $medium->{with_hdlist}, - _probe_with_try_list($suffix, $options{probe_with}) - ) { + my @probe_list = ( + $medium->{with_hdlist} + ? $medium->{with_hdlist} + : _probe_with_try_list($suffix, $options{probe_with}) + ); + foreach my $with_hdlist (@probe_list) { $basename = basename($with_hdlist) or next; $options{force} and unlink "$urpm->{cachedir}/partial/$basename"; @@ -1355,13 +1361,17 @@ this could happen if you mounted manually the directory when creating the medium $options{force} and unlink "$urpm->{cachedir}/partial/$basename"; unless ($options{force}) { if ($medium->{synthesis}) { - -e "$urpm->{statedir}/synthesis.$medium->{hdlist}" and - system("cp", "-p", "-R", - "$urpm->{statedir}/synthesis.$medium->{hdlist}", "$urpm->{cachedir}/partial/$basename"); + -e "$urpm->{statedir}/synthesis.$medium->{hdlist}" + and system("cp", "-p", "-R", + "$urpm->{statedir}/synthesis.$medium->{hdlist}", + "$urpm->{cachedir}/partial/$basename") + and $urpm->{log}(N("...copying failed")); } else { - -e "$urpm->{statedir}/$medium->{hdlist}" and - system("cp", "-p", "-R", - "$urpm->{statedir}/$medium->{hdlist}", "$urpm->{cachedir}/partial/$basename"); + -e "$urpm->{statedir}/$medium->{hdlist}" + and system("cp", "-p", "-R", + "$urpm->{statedir}/$medium->{hdlist}", + "$urpm->{cachedir}/partial/$basename") + and $urpm->{log}(N("...copying failed")); } } eval { |