summaryrefslogtreecommitdiffstats
path: root/perl-install/install/any.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-21 17:37:47 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-21 17:37:47 +0000
commit0c86441bcee8fe1e307033c562350051cd614baa (patch)
treef85635315d9df90e372f956ea379d91c6297517b /perl-install/install/any.pm
parent9dfa26e81d7c2eaffb34fc066b78f8730794a55c (diff)
downloaddrakx-backup-do-not-use-0c86441bcee8fe1e307033c562350051cd614baa.tar
drakx-backup-do-not-use-0c86441bcee8fe1e307033c562350051cd614baa.tar.gz
drakx-backup-do-not-use-0c86441bcee8fe1e307033c562350051cd614baa.tar.bz2
drakx-backup-do-not-use-0c86441bcee8fe1e307033c562350051cd614baa.tar.xz
drakx-backup-do-not-use-0c86441bcee8fe1e307033c562350051cd614baa.zip
prevent selecting an update medium without its parent medium
Diffstat (limited to 'perl-install/install/any.pm')
-rw-r--r--perl-install/install/any.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index 073163ed6..fe05557f5 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -8,6 +8,7 @@ our @EXPORT_OK = qw(addToBeDone);
#-######################################################################################
#- misc imports
#-######################################################################################
+use feature 'state';
use common;
use run_program;
use fs::type;
@@ -376,7 +377,10 @@ sub media_screen {
val => \$medium->{temp_enabled}, type => 'bool', text => $name,
help => $medium->{update} ? N("This medium provides package updates for medium \"%s\"", $parent) : $descriptions{$name},
# 'Core Release' cannot be unselected:
- disabled => sub { $name =~ /^(?:Core|Main) Release$/ },
+ disabled => sub {
+ state $parent_media = $parent && urpm::media::name2medium($urpm, $parent);
+ $name =~ /^(?:Core|Main) Release$/ || $parent_media ? !$parent_media->{temp_enabled} : 0;
+ },
};
} @{$urpm->{media}},
]);