From cf7ab7c2192aaa2a11fe251990a0475c150f261e Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 10 Mar 2005 20:05:41 +0000 Subject: setup urpmi media for ISO images --- perl-install/install_any.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'perl-install/install_any.pm') 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" : "") . " } -- cgit v1.2.1