summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-06 16:13:35 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-06 16:13:35 +0000
commit8a96b5ffc12debe55b156127a020fd6cfffdd6a9 (patch)
tree484114c3490cefd1c4c233047ce15cd15ef3c31e
parent018303607f11609fa8c7900a359b0d55c96bb3ab (diff)
downloaddrakx-8a96b5ffc12debe55b156127a020fd6cfffdd6a9.tar
drakx-8a96b5ffc12debe55b156127a020fd6cfffdd6a9.tar.gz
drakx-8a96b5ffc12debe55b156127a020fd6cfffdd6a9.tar.bz2
drakx-8a96b5ffc12debe55b156127a020fd6cfffdd6a9.tar.xz
drakx-8a96b5ffc12debe55b156127a020fd6cfffdd6a9.zip
(media_screen) enable to enable other media
(such as 'nonfree', 'tainted' which are disabled by default)
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/any.pm58
2 files changed, 60 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 5472abb2e..c25d17be4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,4 +1,6 @@
- enable to skip keyboard step with keyboard option
+- enable to enable other media
+ (such as 'nonfree', 'tainted' which are disabled by default)
Version 14.52 - 4 December 2012
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index d73d3ed44..12142ed03 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -309,6 +309,62 @@ sub load_rate_files {
defined $o->{compssUsers} or die "Can't read compssUsers.pl file, aborting installation\n";
}
+sub _core_medium() { N("Core Release") }
+
+sub _tainted_medium() { N("Tainted Release") }
+
+sub _nonfree_medium() { N("Nonfree Release") }
+
+sub media_screen {
+ my ($o) = @_;
+
+ my $urpm = $o->{packages};
+ my %descriptions = (
+ 'Core Release' => N("\"%s\" contains the various pieces of the systems and its applications", _core_medium()),
+ 'Nonfree Release' => N("\"%s\" contains non free software.\n", _nonfree_medium()) .
+ N("It also contains firmwares needed for certain devices to operate (eg: some ATI/AMD graphic cards, some network cards, some RAID cards, ..."),
+ 'Tainted Release' => N("\"%s\" contains software that can not be distributed in every country due to software patents.", _tainted_medium()) .
+ N("It also contains software from \"%s\" rebuild with additional capabilities.", _core_medium()),
+ );
+
+ $o->ask_from_({ messages => join("\n",
+ N("Media Choice"),
+ N("Here you can enable more media if you want."),
+ ),
+ focus_first => sub { 1 } }, [
+ map {
+ my $medium = $_;
+ $medium->{temp_enabled} = !$medium->{ignore};
+ +{
+ val => \$medium->{temp_enabled}, type => 'bool', text => $medium->{name},
+ # 'Core Release' cannot be unselected:
+ disabled => sub { $medium->{name} eq 'Core Release' },
+ format => sub { $descriptions{$_[0]} || translate(%descriptions) },
+ };
+ } @{$urpm->{media}},
+ ]);
+
+
+ # is there some media to enable?
+ my $todo;
+ foreach my $medium (@{$urpm->{media}}) {
+ if ($medium->{temp_enabled} == $medium->{ignore}) {
+ $medium->{ignore} = !$medium->{temp_enabled};
+ if (!$medium->{ignore}) {
+ delete $medium->{ignore};
+ log::l("Medium '$medium->{name}' needs to be updated to be usable");
+ urpm::media::select_media($urpm, $medium->{name});
+ $todo = 1;
+ }
+ }
+ delete $medium->{temp_enabled};
+ }
+ return if !$todo;
+ urpm::media::update_media($urpm, allow_failures => 1, nolock => 1, noclean => 1,
+ callback => \&urpm::download::sync_logger
+ );
+}
+
sub setPackages {
my ($o) = @_;
@@ -335,6 +391,8 @@ sub setPackages {
install::pkgs::popup_errors();
}
+ media_screen($o);
+
# actually read synthesis now we have all the ones we want:
require urpm::media;
urpm::media::configure($urpm);