diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-12 09:31:49 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-12 09:31:49 +0000 |
commit | 96383ba7fe1fc97890f5d86e088caca3bcfc73c0 (patch) | |
tree | a649c3f74c185c0963a1d34643b2088299f190cf /perl-install | |
parent | 3c9786002b9179fc49bd22b6b4d8eda0b277c6d1 (diff) | |
download | drakx-96383ba7fe1fc97890f5d86e088caca3bcfc73c0.tar drakx-96383ba7fe1fc97890f5d86e088caca3bcfc73c0.tar.gz drakx-96383ba7fe1fc97890f5d86e088caca3bcfc73c0.tar.bz2 drakx-96383ba7fe1fc97890f5d86e088caca3bcfc73c0.tar.xz drakx-96383ba7fe1fc97890f5d86e088caca3bcfc73c0.zip |
First stab at supporting several hdlists on a supplementary CD
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_any.pm | 44 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 14 |
2 files changed, 32 insertions, 26 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index f6f94cf45..53f7f9419 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -396,26 +396,30 @@ sub setPackages { mountCdrom("/mnt/cdrom", $cdrom); log::l($@) if $@; useMedium($medium_name); - #- TODO probe for an hdlists file, and then look for - #- all hdlists listed herein - my $supplmedium = pkgs::psUsingHdlist( - $o->{prefix}, # /mnt - $suppl_method, - $o->{packages}, - "hdlist$medium_name.cz", - $medium_name, - 'media/main', - "Supplementary CD $medium_name", - 1, # selected - "/mnt/cdrom/media/main/media_info/hdlist$medium_name.cz", - ); - if ($supplmedium) { - log::l("read suppl hdlist on cdrom"); - $supplmedium->{prefix} = "removable://mnt/cdrom"; #- for install_urpmi - $supplmedium->{selected} = 1; - $supplmedium->{method} = 'cdrom'; - } else { - log::l("no suppl hdlist"); + #- probe for an hdlists file and then look for all hdlists listed herein + eval { pkgs::psUsingHdlists($o->{prefix}, $suppl_method, "/mnt/cdrom/media/media_info/hdlists", $o->{packages}) }; + if ($@) { + #- no hdlists found on the suppl. CD + #- Look directly for a file media/main/hdlist1s.cz + my $supplmedium = pkgs::psUsingHdlist( + $o->{prefix}, # /mnt + $suppl_method, + $o->{packages}, + "hdlist$medium_name.cz", + $medium_name, + 'media/main', + "Supplementary CD $medium_name", + 1, # selected + "/mnt/cdrom/media/main/media_info/hdlist$medium_name.cz", + ); + if ($supplmedium) { + log::l("read suppl hdlist on cdrom"); + $supplmedium->{prefix} = "removable://mnt/cdrom"; #- for install_urpmi + $supplmedium->{selected} = 1; + $supplmedium->{method} = 'cdrom'; + } else { + log::l("no suppl hdlist"); + } } } } else { diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 25cdd9237..4bfe1e39f 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -378,13 +378,15 @@ sub psUpdateHdlistsDeps { } sub psUsingHdlists { - my ($prefix, $method) = @_; - my $listf = install_any::getFile('media/media_info/hdlists') or die "no hdlists found"; - my $packages = new URPM; + my ($prefix, $method, $hdlistsfile, $packages) = @_; + my $listf = install_any::getFile($hdlistsfile || 'media/media_info/hdlists') + or die "no hdlists found"; my $suppl_CDs = 0; - - #- add additional fields used by DrakX. - @$packages{qw(count mediums)} = (0, {}); + if (!$packages) { + $packages = new URPM; + #- add additional fields used by DrakX. + @$packages{qw(count mediums)} = (0, {}); + } #- parse hdlists file. my $medium_name = 1; |