summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rwxr-xr-xmdkapplet-upgrade-helper9
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index da89b61e..e63f4957 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
o log gurpmi STDERR too
o make all gurpmi passes using --replacefiles instead of just the
first one
+ o restore urpmi media if adding new distribution media failed
Version 2.58 - 14 October 2008
diff --git a/mdkapplet-upgrade-helper b/mdkapplet-upgrade-helper
index ee533c50..b0f4e5b3 100755
--- a/mdkapplet-upgrade-helper
+++ b/mdkapplet-upgrade-helper
@@ -134,8 +134,13 @@ sub upgrade() {
my $product_type = lc($product_id->{type}); $product_type =~ s/\s//g;
my $mirror_list = "http://api.mandriva.com/mirrors/$product_type.$new_distro_version.$product_id->{arch}.list?" .
join(',', 'reason=upgrade', 'upgrade_by=mdkapplet', "upgrade_from=$product_id->{version}");
- system('gurpmi.addmedia', '--silent-success', if_($root, "--urpmi-root=$root"), '--distrib', '--mirrorlist', $mirror_list)
- and return;
+ system('gurpmi.addmedia', '--silent-success', if_($root, "--urpmi-root=$root"), '--distrib', '--mirrorlist', $mirror_list) and do {
+ log::explanations("adding media for new distribution failed");
+ log::explanations("restoringing urpmi configuration from $file");
+ cp_af($file, "$root/etc/urpmi/urpmi.cfg");
+ run_program::run('urpmi.update', if_($root, '--urpmi-root', $root), '-a', '--nocheck');
+ return;
+ };
log::explanations("upgrading urpmi and rpmdrake");
log::explanations("upgrading the whole system");