summaryrefslogtreecommitdiffstats
path: root/perl-install/install/any.pm
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
commit9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a (patch)
tree484114c3490cefd1c4c233047ce15cd15ef3c31e /perl-install/install/any.pm
parentb6e145ecd29afd5d59e11b58ad5978760cd81a20 (diff)
downloaddrakx-backup-do-not-use-9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a.tar
drakx-backup-do-not-use-9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a.tar.gz
drakx-backup-do-not-use-9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a.tar.bz2
drakx-backup-do-not-use-9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a.tar.xz
drakx-backup-do-not-use-9c6bdf2fbdabcb4e71ba2d448937f64cee4f5e5a.zip
(media_screen) enable to enable other media
(such as 'nonfree', 'tainted' which are disabled by default)
Diffstat (limited to 'perl-install/install/any.pm')
-rw-r--r--perl-install/install/any.pm58
1 files changed, 58 insertions, 0 deletions
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);