From b08dab6f1a6775ebe077bf0e135bd12811cacd36 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 2 Dec 2003 15:22:35 +0000 Subject: create fix_broken_alternatives() --- perl-install/any.pm | 11 +++++++++++ perl-install/install_steps.pm | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'perl-install') diff --git a/perl-install/any.pm b/perl-install/any.pm index baf5b6e65..84685dd83 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -861,6 +861,17 @@ UNREGISTER ^$devfs_if\$ EXECUTE /etc/dynamic/scripts/rawdevice.script del /dev/$ "); } +sub fix_broken_alternatives() { + #- fix bad update-alternatives that may occurs after upgrade (and sometimes for install too). + -d "$::prefix/etc/alternatives" or return; + + foreach (all("$::prefix/etc/alternatives")) { + next if run_program::rooted($::prefix, 'test', '-e', "/etc/alternatives/$_"); + log::l("fixing broken alternative $_"); + run_program::rooted($::prefix, 'update-alternatives', '--auto', $_); + } +} + sub fileshare_config { my ($in, $type) = @_; #- $type is 'nfs', 'smb' or '' diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index eb64f1b68..dc158e591 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -514,14 +514,7 @@ GridHeight=70 } } - #- fix bad update-alternatives that may occurs after upgrade (but let them for install too). - if (-d "$o->{prefix}/etc/alternatives") { - foreach (all("$o->{prefix}/etc/alternatives")) { - next if run_program::rooted($o->{prefix}, 'test', '-e', "/etc/alternatives/$_"); - log::l("fixing broken alternative $_"); - run_program::rooted($o->{prefix}, "update-alternatives", "--auto", $_); - } - } + fix_broken_alternatives(); #- update theme directly from a package (simplest). if (-s "$o->{prefix}/usr/share/oem-theme.rpm") { -- cgit v1.2.1