diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 11:43:49 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-27 11:43:49 +0000 |
commit | f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e (patch) | |
tree | e73ce2cc59f3cd0274631395ede73b970cc18fcc /urpm/removable.pm | |
parent | 8999ef7540f417af02aa0da49ca27a7e4ea487bc (diff) | |
download | urpmi-f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e.tar urpmi-f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e.tar.gz urpmi-f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e.tar.bz2 urpmi-f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e.tar.xz urpmi-f969d3d1e11f5fed1acc8e5e35b14dea60b06a0e.zip |
internally use {iso} instead of {removable} for iso files
(to make things more clear)
Diffstat (limited to 'urpm/removable.pm')
-rw-r--r-- | urpm/removable.pm | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/urpm/removable.pm b/urpm/removable.pm index bddd8e1d..77fb5300 100644 --- a/urpm/removable.pm +++ b/urpm/removable.pm @@ -18,18 +18,13 @@ 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") sub try_mounting { - my ($urpm, $dir, $o_removable) = @_; + my ($urpm, $dir, $o_iso) = @_; - is_iso($o_removable) ? try_mounting_iso($urpm, $dir, $o_removable) : try_mounting_($urpm, $dir); + $o_iso ? try_mounting_iso($urpm, $dir, $o_iso) : try_mounting_($urpm, $dir); } #- side-effects: $urpm->{removable_mounted}, "mount" @@ -223,7 +218,7 @@ sub try_mounting_non_cdroms { my @used_media = map { $_->{medium} } _create_blists($urpm->{media}, $list); - foreach my $medium (grep { !is_cdrom($_->{removable}) } @used_media) { + foreach my $medium (grep { !$_->{removable} } @used_media) { try_mounting_non_cdrom($urpm, $medium); } } @@ -235,7 +230,7 @@ sub try_mounting_non_cdrom { my $dir = file_from_local_url($medium->{url}) or return; - -e $dir || try_mounting($urpm, $dir, $medium->{removable}) or + -e $dir || try_mounting($urpm, $dir, $medium->{iso}) or $urpm->{error}(N("unable to access medium \"%s\"", $medium->{name})), return; 1; @@ -250,7 +245,7 @@ sub _get_cdroms { foreach (@$blists) { #- examine non removable device but that may be mounted. if (my $device = $_->{medium}{removable}) { - next if is_iso($device) || $device =~ m![^a-zA-Z0-9_./-]!; #- bad path + next if $device =~ m![^a-zA-Z0-9_./-]!; #- bad path push @{$removables{$device} ||= []}, $_; } } |