diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-12-21 17:37:47 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-12-21 17:37:47 +0000 |
commit | 3dea187456e97810484f7ae788be7e23ffd1dad8 (patch) | |
tree | f85635315d9df90e372f956ea379d91c6297517b /perl-install | |
parent | f92acc32dbc993fc14e14ce922b584f12d584c43 (diff) | |
download | drakx-3dea187456e97810484f7ae788be7e23ffd1dad8.tar drakx-3dea187456e97810484f7ae788be7e23ffd1dad8.tar.gz drakx-3dea187456e97810484f7ae788be7e23ffd1dad8.tar.bz2 drakx-3dea187456e97810484f7ae788be7e23ffd1dad8.tar.xz drakx-3dea187456e97810484f7ae788be7e23ffd1dad8.zip |
prevent selecting an update medium without its parent medium
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/install/any.pm | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index d99304511..c561ea099 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,6 @@ +- media step: + o prevent selecting an update medium without its parent medium + Version 15.14 - 17 December 2012 - ugtk2: use new exceptions management 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}}, ]); |