From 3dea187456e97810484f7ae788be7e23ffd1dad8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 21 Dec 2012 17:37:47 +0000 Subject: prevent selecting an update medium without its parent medium --- perl-install/install/any.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'perl-install/install/any.pm') 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}}, ]); -- cgit v1.2.1