diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 11:27:52 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 11:27:52 +0000 |
commit | 2406a55863680007f753d8ffb5fefd7f4f2e8d29 (patch) | |
tree | 45a4c6025ead1bc7e74adf8ccee65b8113fb4c5c | |
parent | 0d53f9b55b6480cbea443cd217b54f588f5fb84c (diff) | |
download | urpmi-2406a55863680007f753d8ffb5fefd7f4f2e8d29.tar urpmi-2406a55863680007f753d8ffb5fefd7f4f2e8d29.tar.gz urpmi-2406a55863680007f753d8ffb5fefd7f4f2e8d29.tar.bz2 urpmi-2406a55863680007f753d8ffb5fefd7f4f2e8d29.tar.xz urpmi-2406a55863680007f753d8ffb5fefd7f4f2e8d29.zip |
treat iso as non-removable
-rw-r--r-- | urpm/main_loop.pm | 2 | ||||
-rw-r--r-- | urpm/removable.pm | 23 |
2 files changed, 16 insertions, 9 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index b4dbff7c..14edf494 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -51,7 +51,7 @@ unless ($local_sources || $list) { my %sources = %$local_sources; my %error_sources; -urpm::removable::try_mounting_non_removables($urpm, $list); +urpm::removable::try_mounting_non_cdroms($urpm, $list); $callbacks->{pre_removable} and $callbacks->{pre_removable}->(); urpm::removable::copy_packages_of_removable_media($urpm, diff --git a/urpm/removable.pm b/urpm/removable.pm index 411d720d..3b2f0386 100644 --- a/urpm/removable.pm +++ b/urpm/removable.pm @@ -18,6 +18,11 @@ sub is_iso { $removable_dev && $removable_dev =~ /\.iso$/i; } +sub is_cdrom { + my ($removable_dev) = @_; + $removable_dev && !is_iso($removable_dev); +} + #- side-effects: #- + those of try_mounting_ ($urpm->{removable_mounted}, "mount") #- + those of try_mounting_iso ($urpm->{removable_mounted}, "mount") @@ -216,26 +221,28 @@ sub _examine_removable_medium_ { } #- side-effects: -#- + those of try_mounting_non_removable ($urpm->{removable_mounted}, "mount") -sub try_mounting_non_removables { +#- + those of try_mounting_non_cdrom ($urpm->{removable_mounted}, "mount") +sub try_mounting_non_cdroms { my ($urpm, $list) = @_; my @used_media = map { $_->{medium} } _create_blists($urpm->{media}, $list); - foreach my $medium (grep { !$_->{removable} } @used_media) { - try_mounting_non_removable($urpm, $medium); + foreach my $medium (grep { !is_cdrom($_->{removable}) } @used_media) { + try_mounting_non_cdrom($urpm, $medium); } } #- side-effects: #- + those of try_mounting_ ($urpm->{removable_mounted}, "mount") -sub try_mounting_non_removable { +sub try_mounting_non_cdrom { my ($urpm, $medium) = @_; - my $dir = file_from_local_url($medium->{url}) or next; + my $dir = file_from_local_url($medium->{url}) or return; - -e $dir || try_mounting_($urpm, $dir) or - $urpm->{error}(N("unable to access medium \"%s\"", $medium->{name})), next; + -e $dir || try_mounting_($urpm, $dir, $medium->{removable}) or + $urpm->{error}(N("unable to access medium \"%s\"", $medium->{name})), return; + + 1; } #- side-effects: none |