diff options
Diffstat (limited to 'scripts/update-alternatives.pl')
-rwxr-xr-x | scripts/update-alternatives.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index 09e7c8422..df753d7c9 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -291,8 +291,13 @@ if ($alternative->has_current_link()) { my $new_choice; if ($action eq 'set') { + if ($alternative->has_choice($path)) { + $new_choice = $path; + } else { + error(_g("alternative %s for %s not registered, not setting."), + $path, $alternative->name()); + } $alternative->set_status('manual'); - $new_choice = $path; } elsif ($action eq 'auto') { $alternative->set_status('auto'); $new_choice = $alternative->best(); |