summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xmgaapplet-upgrade-helper39
2 files changed, 41 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2d237263..23f4604f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- ensure nonfree/tainted media is kept enabled on distro upgrade
+
Version 2.80 - 4 May 2013, Colin Guthrie
- add support for a 'mageia-prepare-upgrade' package when performing distro
diff --git a/mgaapplet-upgrade-helper b/mgaapplet-upgrade-helper
index 7c4286c9..543ee66d 100755
--- a/mgaapplet-upgrade-helper
+++ b/mgaapplet-upgrade-helper
@@ -234,6 +234,26 @@ packages as well?)."))
);
exit(1);
}
+
+ my $nonfree = 0;
+ my $tainted = 0;
+
+ log::explanations("Checking for enabled Nonfree/Tainted");
+ for my $media (@{$urpm->{media}}) {
+ log::explanations("Checking $media->{name}");
+ if (!defined($media->{ignore})) {
+ log::explanations("Media $media->{name} is not ignored");
+ if ($media->{name} =~ m/^Nonfree/) {
+ $nonfree = 1;
+ log::explanations("Nonfree found to be enabled");
+ }
+ if ($media->{name} =~ m/^Tainted/) {
+ $tainted = 1;
+ log::explanations("Tainted found to be enabled");
+ }
+ }
+ }
+
undef $urpmi_lock;
touch(get_stale_upgrade_filename());
@@ -271,6 +291,20 @@ packages as well?)."))
exit(2);
};
+ if ($nonfree || $tainted) {
+ if ($nonfree) {
+ log::explanations("enabling nonfree as it was there before upgrade");
+ enable_media("Nonfree");
+ }
+
+ if ($tainted) {
+ log::explanations("enabling tainted as it was there before upgrade");
+ enable_media("Tainted");
+ }
+
+ # Media was added, update it and move along...
+ update_media();
+ }
log::explanations("upgrading urpmi and rpmdrake");
log::explanations("upgrading the whole system");
@@ -300,3 +334,8 @@ sub fork_gurpmi {
sub update_media() {
run_program::run('urpmi.update', if_($root, '--urpmi-root', $root), '-a', '--nocheck');
}
+
+sub enable_media {
+ my ($repos) = @_;
+ run_program::run('urpmi.update', if_($root, '--urpmi-root', $root), '--no-ignore', "$repos Release", "$repos Updates");
+}