summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-02 01:56:51 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-02 01:56:51 +0000
commitc4cf793651840180ae7e892f7a5c304131d0e07a (patch)
treed14fe5644f4d782be52619ff71a453684e98b856 /perl-install
parent0295e0bca446a84676b3b9f4be922f5d356e6730 (diff)
downloaddrakx-c4cf793651840180ae7e892f7a5c304131d0e07a.tar
drakx-c4cf793651840180ae7e892f7a5c304131d0e07a.tar.gz
drakx-c4cf793651840180ae7e892f7a5c304131d0e07a.tar.bz2
drakx-c4cf793651840180ae7e892f7a5c304131d0e07a.tar.xz
drakx-c4cf793651840180ae7e892f7a5c304131d0e07a.zip
Allow to deselect media only if the hdlists file contains a line "askmedia"
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/pkgs.pm7
1 files changed, 5 insertions, 2 deletions
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!