summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-03-10 20:05:41 +0000
committerOlivier Blin <oblin@mandriva.org>2005-03-10 20:05:41 +0000
commitcf7ab7c2192aaa2a11fe251990a0475c150f261e (patch)
tree62ea4c308873495a3a283800e78f667247009c6a /perl-install/install_any.pm
parent54a6d984bd3fa858f66ec6d46171b6728575291d (diff)
downloaddrakx-cf7ab7c2192aaa2a11fe251990a0475c150f261e.tar
drakx-cf7ab7c2192aaa2a11fe251990a0475c150f261e.tar.gz
drakx-cf7ab7c2192aaa2a11fe251990a0475c150f261e.tar.bz2
drakx-cf7ab7c2192aaa2a11fe251990a0475c150f261e.tar.xz
drakx-cf7ab7c2192aaa2a11fe251990a0475c150f261e.zip
setup urpmi media for ISO images
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index c6a17b7eb..e74de756d 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -947,6 +947,23 @@ sub install_urpmi {
#- use list file only if visible password or macro.
my $need_list = $dir =~ m,^(?:[^:]*://[^/:\@]*:[^/:\@]+\@|.*%{),; #- }
+ my $removable_device;
+
+ if ($curmethod eq 'disk-iso') {
+ my $p = find { $_->{real_mntpoint} eq '/tmp/hdimage' } @{$::o->{fstab}} or
+ log::l("unable to find ISO image mountpoint, not adding urpmi media"), next;
+ my $iso_info = find_ISO_image_labelled($_->{descr}) or
+ log::l("unable to find ISO image labelled $name, not adding urpmi media"), next;
+ my ($iso_path) = $iso_info->{file} =~ m,^/tmp/hdimage/+(.*), or
+ log::l("unable to find ISO image file name ($iso_info->{file}), not adding urpmi media"), next;
+ my $dest = "/mnt/inst_iso";
+ $dir = "removable:/$dest";
+ -d "$::prefix/$dest" or mkdir_p($dest);
+ $removable_device = "$p->{mntpoint}/$iso_path";
+ } elsif ($curmethod eq 'cdrom') {
+ $removable_device = '/dev/cdrom';
+ }
+
#- build a list file if needed.
if ($need_list) {
my $mask = umask 077;
@@ -1017,8 +1034,8 @@ sub install_urpmi {
hdlist: hdlist.$name.cz
with_hdlist: $with" . ($need_list ? "
list: list.$name" : "") . (keys(%{$_->{key_ids}}) ? "
- key-ids: " . join(',', keys(%{$_->{key_ids}})) : "") . ($dir =~ /removable:/ && "
- removable: /dev/cdrom") . ($_->{update} ? "
+ key-ids: " . join(',', keys(%{$_->{key_ids}})) : "") . (defined $removable_device && "
+ removable: $removable_device") . ($_->{update} ? "
update" : "") . "
}