Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

alternatives: will fail when the package is not still configured #95

Open
Icenowy opened this issue Aug 2, 2016 · 3 comments
Open

alternatives: will fail when the package is not still configured #95

Icenowy opened this issue Aug 2, 2016 · 3 comments

Comments

@Icenowy
Copy link
Contributor

Icenowy commented Aug 2, 2016

**  Generating initrd (Initialization RAM Disk) for kernel version 4.1.5-aosc-main ...
/usr/bin/plymouth-set-default-theme: line 65: awk: command not found
/usr/bin/plymouth-set-default-theme: line 65: awk: command not found

As when deconfiguring the old version of gawk, the alternative is deleted.
So, before the new version is configured, the alternative won't exist.

So some postinsts will fail.

@MingcongBai
Copy link
Contributor

This is a packaging issue, please move over to aosc-os-abbs.

@Icenowy
Copy link
Contributor Author

Icenowy commented Aug 2, 2016

not packaging issue.
The code dealing with alternatives are in ab3.
And it have another aspect: the alternative is unstable after upgrading.
I installed elvis and vim. I upgraded, and vi became elvis (used to be vim).
2016年8月2日 21:34于 Mingcong Bai [email protected]写道:This is a packaging issue, please move over to aosc-os-abbs.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

@Icenowy Icenowy reopened this Aug 2, 2016
@Artoria2e5
Copy link
Contributor

Artoria2e5 commented Nov 9, 2016

note: vim-nox and elvis have the same prio (50) for /usr/bin/vi symlink. update-alternatives(8) states that higher prio takes the position if no manual ones are selected, but does not say anything about same-prio cases.this refers to an alternative impl

update-alternatives.c:alternative_get_best() from dpkg (the impl we are using) goes all the way to the end of the linked list (fileset) in an alternative structure, and chooses the first (>) highest-prio match. (Hell yeah, ordered set.)

The fileset is ordered by the following rule:

  • alternative_load()alternative_parse_fileset(): database order, add by alternative_add_choice()
    • alternative_add_choice(): modify existing, else append.
  • alternative_add_choice(): manually called for --install input.

... which seems to bias toward an existing one (expected behavior). Weird.

Do we have something like a broken db though?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants