summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install_any.pm44
-rw-r--r--perl-install/pkgs.pm14
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;