summaryrefslogtreecommitdiffstats
path: root/mdkapplet-upgrade-helper
diff options
context:
space:
mode:
Diffstat (limited to 'mdkapplet-upgrade-helper')
-rwxr-xr-xmdkapplet-upgrade-helper9
1 files changed, 7 insertions, 2 deletions
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");