diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-01 16:13:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-01 16:13:40 +0000 |
commit | 73e9459062f85bca8adef6976df8d4a6f2dbbbe0 (patch) | |
tree | eabc1b7087d327714d1837a563fdaa75a137387a | |
parent | f9b8c020f93d96f52c734eba139e06b59d6a820f (diff) | |
download | drakx-73e9459062f85bca8adef6976df8d4a6f2dbbbe0.tar drakx-73e9459062f85bca8adef6976df8d4a6f2dbbbe0.tar.gz drakx-73e9459062f85bca8adef6976df8d4a6f2dbbbe0.tar.bz2 drakx-73e9459062f85bca8adef6976df8d4a6f2dbbbe0.tar.xz drakx-73e9459062f85bca8adef6976df8d4a6f2dbbbe0.zip |
- keep in $o->{previous_release} the info about upgraded /etc/release,
and pass "reason" and version to urpmi.addmedia
- we also parse {version} field out of /etc/release
-rw-r--r-- | perl-install/any.pm | 9 | ||||
-rw-r--r-- | perl-install/common.pm | 4 | ||||
-rw-r--r-- | perl-install/install/NEWS | 2 | ||||
-rw-r--r-- | perl-install/install/steps.pm | 1 | ||||
-rw-r--r-- | perl-install/install/steps_interactive.pm | 3 |
5 files changed, 16 insertions, 3 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index ee5322d79..e5d62371f 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -841,7 +841,7 @@ sub sessions_with_order() { } sub urpmi_add_all_media { - my ($in) = @_; + my ($in, $o_previous_release) = @_; my $binary = find { whereis_binary($_, $::prefix) } 'gurpmi.addmedia', 'urpmi.addmedia' or return; @@ -855,6 +855,13 @@ sub urpmi_add_all_media { mygtk2::destroy_previous_popped_and_reuse_window(); mygtk2::flush(); } + + my $reason = join(',', $o_previous_release ? + ('reason=upgrade', 'upgrade_by=drakx', "upgrade_from=$o_previous_release->{version}") : + 'reason=install'); + log::l("URPMI_ADDMEDIA_REASON $reason"); + local $ENV{URPMI_ADDMEDIA_REASON} = $reason; + run_program::rooted($::prefix, $binary, '--distrib', '--mirrorlist', '$MIRRORLIST'); } diff --git a/perl-install/common.pm b/perl-install/common.pm index 2234c0e91..32854daed 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -312,9 +312,11 @@ sub is_running { sub parse_release_file { my ($prefix, $f, $part) = @_; chomp(my $s = cat_("$prefix$f")); + my $version = $s =~ s/\s+release\s+(\S+)// && $1; my $arch = $s =~ s/\s+for\s+(\S+)// && $1; log::l("find_root_parts found $part->{device}: $s for $arch" . ($f !~ m!/etc/! ? " in special release file $f" : '')); - { release => $s, release_file => $f, part => $part, arch => $arch }; + { release => $s, version => $version, + release_file => $f, part => $part, arch => $arch }; } sub release_file { diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 550fd6016..d518dfa85 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,5 @@ +- keep in $o->{previous_release} the info about upgraded /etc/release, + and pass "reason" and version to urpmi.addmedia - 2009.0 RC 1 logo - hack /tmp/.X11-unix to allow accessing X in chroot - if network access, configure urpmi with --mirrorlist --distrib, diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm index e669a3790..518ef8d18 100644 --- a/perl-install/install/steps.pm +++ b/perl-install/install/steps.pm @@ -175,6 +175,7 @@ sub selectInstallClass { # either one root is defined (and all is ok), or we take the first one we find my $p = fs::get::root_($o->{fstab}) || (first(install::any::find_root_parts($o->{fstab}, $::prefix)) || die)->{part}; $o->{migrate_device_names} = install::any::use_root_part($o->{all_hds}, $p); + $o->{previous_release} = $p if $o->{isUpgrade}; } } diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm index 231c3960a..84fc58889 100644 --- a/perl-install/install/steps_interactive.pm +++ b/perl-install/install/steps_interactive.pm @@ -171,6 +171,7 @@ sub selectInstallClass { hidden => 1, val => \$_->{encrypt_key} } ]); } + $o->{previous_release} = $p; $o->{isUpgrade} = (find { $p->{release_file} =~ /$_/ } 'mandriva', 'mandrake', 'conectiva', 'redhat') || 'unknown'; $o->{upgrade_by_removing_pkgs_matching} ||= { conectiva => 'cl', @@ -761,7 +762,7 @@ Do you want to install the updates?")), #- bring all interface up for installing updates packages. install::interactive::upNetwork($o); - if (any::urpmi_add_all_media($o)) { + if (any::urpmi_add_all_media($o, $o->{previous_release})) { my $binary = find { whereis_binary($_, $::prefix) } 'gurpmi2', 'urpmi' or return; run_program::rooted($::prefix, $binary, '--auto-select', '--update'); } |