From c4cf793651840180ae7e892f7a5c304131d0e07a Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 2 Sep 2004 01:56:51 +0000 Subject: Allow to deselect media only if the hdlists file contains a line "askmedia" --- perl-install/pkgs.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 175fa9dc7..b86df87a3 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -382,7 +382,7 @@ sub psUsingHdlists { my $prefix = $o->{prefix}; my $listf = install_any::getFile($o_hdlistsfile || 'media/media_info/hdlists') or die "no hdlists found"; - my $suppl_CDs = 0; + my ($suppl_CDs, $deselectionAllowed) = (0, 0); if (!$o_packages) { $o_packages = new URPM; #- add additional fields used by DrakX. @@ -399,6 +399,9 @@ sub psUsingHdlists { #- we'll ask afterwards for supplementary CDs, if the hdlists file contains #- a line that begins with "suppl" if (/^suppl/) { $suppl_CDs = 1; next } + #- if the hdlists contains a line "askmedia", delection of media found + #- in this hdlist is allowed + if (/^askmedia/) { $deselectionAllowed = 1; next } my $cdsuppl = index($medium_name, 's') >= 0; m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die qq(invalid hdlist description "$_" in hdlists file); push @hdlists, [ $2, $medium_name, $3, $4, !$1, @@ -407,7 +410,7 @@ sub psUsingHdlists { ]; $cdsuppl ? ($medium_name = ($medium_name + 1) . 's') : ++$medium_name; } - @hdlists = $o->deselectFoundMedia(\@hdlists) unless defined $o_initialmedium; + @hdlists = $o->deselectFoundMedia(\@hdlists) if $deselectionAllowed && !defined $o_initialmedium; foreach my $h (@hdlists) { #- make sure the first medium is always selected! -- cgit v1.2.1