02/02/2020: This week in KISS (#9)
Alternatives!
Index
Alternatives system
The package manager now includes an "alternatives system". This feature allows you to change the provider of a specific file or set of files.
For example, a user can now swap from busybox to the GNU coreutils by running a simple command.
This works in an entirely dynamic way and required zero changes to the package format or the repository files themselves! [1]
When a conflict is detected between another package during installation, the conflicting files become "choices" in the alternatives system.
Running kiss a or kiss alternatives will list all available choices
that can be made.
-> kiss a
-> Alternatives:
ncurses /usr/bin/clear
ncurses /usr/bin/reset
The above command tells me that I have two available choices from the
ncurses package. To find out which package owns the current
"choice", the kiss-owns utility from kiss-utils can be used (a
simple grep in your installed db also works).
-> kiss a ncurses /usr/bin/clear
-> Swapping '/usr/bin/clear' from 'busybox' to 'ncurses'
My system now uses /usr/bin/clear from the ncurses package. Running
kiss a again will now show the following output.
-> kiss a
-> Alternatives:
busybox /usr/bin/clear
ncurses /usr/bin/reset
Here's a more complex example showing the swap between a large bulk of choices.
-> kiss a
-> Alternatives:
busybox /usr/bin/clear
coreutils /usr/bin/[
coreutils /usr/bin/base64
coreutils /usr/bin/basename
coreutils /usr/bin/cat
coreutils /usr/bin/chgrp
coreutils /usr/bin/chmod
# Lots of 'coreutils *' lines here.
coreutils /usr/bin/whoami
coreutils /usr/bin/yes
ncurses /usr/bin/reset
The output of kiss a can be directly used as input to kiss a. Each
line is a valid set of arguments! Here's how you'd swap to GNU
coreutils in a single command.
# The package manager will read each line from stdin.
kiss a | grep ^coreutils | kiss a -
# Running 'kiss a' will show the inverse of the above listing,
# a long output of 'busybox *'.
My system is now using the GNU coreutils!
This system works for any files across the entire filesystem and as it is entirely dynamic (requiring no changes to the repositories or the package format [1]) it is backwards compatible.
The feature allows the user to swap their /bin/sh, coreutils and
really anything they desire. Very complex setups are now easily possible
when this is paired with the repository system.
The package manager, init scripts and package files are written in POSIX
shell allowing any POSIX compatible shell or coreutils to be used in
place of the defaults (one exception is made for sed -i which is too
useful to let go of [2]).
With this change, the user now has the choice between, init, device manager, coreutils, shell and anything they desire!
[1]: Some minor changes were made to where some packages install their files. coreutils was installed to /usr/local/bin due to the absence of this alternatives feature. This was still not a change to the format of the package system itself though!
[2]: Utilities like tar which have no standard command-line
interface may be incompatible when swapped out. There's nothing that
can really be done about this.
Official Repositories
- Dylan Araps:
72be609falkon: Added optional open-in-mpv extension15f1d9bsowm: bump to 1.28a25531mpv: bump to 0.32.0f8658f1pkgconf: Swap to http source for now. Closes #139154f4a3qt5-*: bump to 5.14.16549391falkon: Remove unneeded sed calls6043ae3falkon: fix version0e47e11sqlite: bump to 3.31.1f961652dhcpcd: bump to 8.1.637177efopenresolv: bump to 3.10.085b261clibva-utils: Fix depends209bea7mesa: bump to 19.3.3f1aa593kiss: bump to 1.0.0cf5a975kiss-utils: bump to 1.0.0796550ekiss: bump to 1.0.16149f07kiss-utils: bump to 1.0.1a42e25dncurses: Allow conflictse949836baseinit: bump to 0.38004986kiss: bump to 1.0.2db53c47kiss-utils: bump to 1.0.22b52c35kiss: bump to 1.0.3eee548bkiss-utils: bump to 1.0.3587f8cakiss: bump to 1.0.4e30562ckiss-utils: bump to 1.0.4c28cb6fkiss: bump to 1.0.5876afd4kiss-utils: bump to 1.0.5fa42f5ekiss: bump to 1.0.6ff42d39kiss-utils: bump to 1.0.6bcf681bkiss-utils: Fix build with suckless install8a6f5cexinit: remove sed -id3ae5d1st: Remove sed -ib314878mesa: remove sed -idf36110libxcb: Remove sed -i2217317intel-media-driver: Remove sed -id8efedbrepo: Revert sed changes3dcf2e3mtdev: bump to 1.1.633d6106kiss: bump to 1.1.1877a99ekiss-utils: bump to 1.1.1a8262d4kiss: bump to 1.1.2a07695akiss-utils: bump to 1.1.26c693fdkiss: bump to 1.1.3b177fc8kiss-utils: bump to 1.1.3e2f5025kiss: bump to 1.1.4db27e9ekiss-utils: bump to 1.1.404571c5kiss: bump to 1.1.6f8b28bekiss-utils: bump to 1.1.6806c863opendoas: Move to extraaeaa1b3docs: update2dd7b91kiss: bump to 1.1.70e275d5kiss-utils: bump to 1.1.75593f35rust [testing]: Added rust 1.41.00f3103fsudo: bump to 1.8.31f6e43e1cbindgen [testing]: bump to 0.13.024a5463rust: Use xz6549c1ecbindgen: Bump to 0.13.0ebbb23brust: bump to 1.41.01d4b4a8util-linux: bump to 2.35.1b3db27bxkeyboard-config: bump to 2.29b93e8acbinutils: bump to 2.34
Community
- Adam Schaefers:
f735f0eNew Package: sinit 1.1 (#200)96a061esinit: revert to 1.0 (#270)c6029b2sbase: use official git sources (#271)88278aaubase: use official sources (#272)358a6b1nawk: update build for alternatives (#288)57f66e4patch: update build for alternatives (#286)6df5604gnugrep: update build for alternatives (#285)cf9d490findutils: update build for alternatives (#283)66487d0diffutils: update build for alternatives (#282)9b4cc92dash: update build for alternatives (#281)5cb9a66gawk: update build for alternatives (#280)cb3b96fcoreutils: remove 'g' prefix from build (#279)a02560bgtar: update build for alternatives (#287)766c1ccnew package: psproc-ng (#289)71ab4defix name: proccps-ng (#291)7ab9583procps-ng: bump to latest (#293)
- Anirudh:
f107694aerc: Track latest git instead (#266)
- Cem Keylan:
- Dylan Araps:
f008149imagemagick: bump to 7.0.9-182f9a3a8imagemagick: bump to 7.0.9-1985b1197go: bump to 1.13.7185b79eimagemagick: bump to 7.0.9-205b41b93spotifyd: drop package96f8dbaubase: Drop su8af78efsbase: Drop tarc32880fsbase: Use unlinkabc34fbubase: Use unlink383d6d9sbase: Remove sed42bfd0bopendoas: Move to extraf1d59d0mc: bump to 4.8.24f710b64psproc-ng: Drop packagef14992eimagemagick: bump to 7.0.9-21fec9e16pciutils: new package at 3.6.2. Closes #2963c335d8nettle: bump to latest commit to fix gnutls build issues.5919df8gnutls: bump to 3.6.1294b8c8cpciutils: bump to 3.6.4
- Jonathan Dahan:
6ae6436osh: bump to 0.7.0 (#269)
- Will Eccles:
- dzove855:
a55704b* Add xtrlock build (#268)
Legal stuff
The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a worldwide basis.
© Dylan Araps 2019-2020