From 2a618e97d42b6b48b7661b1554a8b1dbee6a6a71 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 8 Aug 2007 19:15:46 +0000 Subject: - for XFdrake: use update-alternatives command instead doing things by hand (this uses --set, new feature of update-alternatives) (#32362) --- perl-install/NEWS | 2 ++ perl-install/common.pm | 15 +-------------- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'perl-install') diff --git a/perl-install/NEWS b/perl-install/NEWS index 7ab389dae..1b456bf5b 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,5 @@ +- for XFdrake: use update-alternatives command instead doing things by hand + (this uses --set, new feature of update-alternatives) (#32362) - harddrake: o display the PCI domain too diff --git a/perl-install/common.pm b/perl-install/common.pm index 5ad572b5b..af15998b0 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -398,20 +398,7 @@ sub get_alternatives { sub symlinkf_update_alternatives { my ($name, $wanted_file) = @_; - my $conf = get_alternatives($name); - my $chosen = find { $_->{file} eq $wanted_file } @{$conf->{alternatives}} or return; - symlinkf("/etc/alternatives/$name", $::prefix . $conf->{link}); - symlinkf($wanted_file, "$::prefix/etc/alternatives/$name"); - mapn { - my ($slave, $file) = @_; - if ($file) { - symlinkf("/etc/alternatives/$slave->{name}", $::prefix . $slave->{link}); - symlinkf($file, "$::prefix/etc/alternatives/$slave->{name}"); - } else { - unlink $::prefix . $slave->{link}; - unlink "$::prefix/etc/alternatives/$slave->{name}"; - } - } $conf->{slaves}, $chosen->{slave_files}; + run_program::rooted($::prefix, 'update-alternatives', '--set', $name, $wanted_file); } sub update_gnomekderc_no_create { -- cgit v1.2.1