💾 Archived View for tilde.team › ~kiedtl › k1ss › blog › 20200202a.gmi captured on 2022-04-29 at 13:29:02. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2020-11-07)
-=-=-=-=-=-=-
Alternatives!
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.
72be609 falkon: Added optional open-in-mpv extension
f8658f1 pkgconf: Swap to http source for now. Closes #139
6549391 falkon: Remove unneeded sed calls
0e47e11 sqlite: bump to 3.31.1
37177ef openresolv: bump to 3.10.0
85b261c libva-utils: Fix depends
cf5a975 kiss-utils: bump to 1.0.0
6149f07 kiss-utils: bump to 1.0.1
a42e25d ncurses: Allow conflicts
db53c47 kiss-utils: bump to 1.0.2
eee548b kiss-utils: bump to 1.0.3
e30562c kiss-utils: bump to 1.0.4
876afd4 kiss-utils: bump to 1.0.5
ff42d39 kiss-utils: bump to 1.0.6
bcf681b kiss-utils: Fix build with suckless install
2217317 intel-media-driver: Remove sed -i
d8efedb repo: Revert sed changes
877a99e kiss-utils: bump to 1.1.1
a07695a kiss-utils: bump to 1.1.2
b177fc8 kiss-utils: bump to 1.1.3
db27e9e kiss-utils: bump to 1.1.4
f8b28be kiss-utils: bump to 1.1.6
806c863 opendoas: Move to extra
0e275d5 kiss-utils: bump to 1.1.7
5593f35 rust [testing]: Added rust 1.41.0
f6e43e1 cbindgen [testing]: bump to 0.13.0
6549c1e cbindgen: Bump to 0.13.0
1d4b4a8 util-linux: bump to 2.35.1
b3db27b xkeyboard-config: bump to 2.29
b93e8ac binutils: bump to 2.34
f735f0e New Package: sinit 1.1 (#200)
96a061e sinit: revert to 1.0 (#270)
c6029b2 sbase: use official git sources (#271)
88278aa ubase: use official sources (#272)
358a6b1 nawk: update build for alternatives (#288)
57f66e4 patch: update build for alternatives (#286)
6df5604 gnugrep: update build for alternatives (#285)
cf9d490 findutils: update build for alternatives (#283)
66487d0 diffutils: update build for alternatives (#282)
9b4cc92 dash: update build for alternatives (#281)
5cb9a66 gawk: update build for alternatives (#280)
cb3b96f coreutils: remove 'g' prefix from build (#279)
a02560b gtar: update build for alternatives (#287)
766c1cc new package: psproc-ng (#289)
71ab4de fix name: proccps-ng (#291)
7ab9583 procps-ng: bump to latest (#293)
f107694 aerc: Track latest git instead (#266)
6df240b discount: new package at 2.2.6
0d996db 9base: new package at 63916da (#246)
9769c2c discount: fix indentation
b931ae9 groff: new package at 1.22.4 (#245)
badc409 webkit2gtk: fix depends (#297)
f008149 imagemagick: bump to 7.0.9-18
2f9a3a8 imagemagick: bump to 7.0.9-19
185b79e imagemagick: bump to 7.0.9-20
5b41b93 spotifyd: drop package
42bfd0b opendoas: Move to extra
f710b64 psproc-ng: Drop package
f14992e imagemagick: bump to 7.0.9-21
fec9e16 pciutils: new package at 3.6.2. Closes #296
3c335d8 nettle: bump to latest commit to fix gnutls build issues.
5919df8 gnutls: bump to 3.6.12
94b8c8c pciutils: bump to 3.6.4
6ae6436 osh: bump to 0.7.0 (#269)
8c2998f cfm: new package at v0.1.2 (#274)
49c9df5 cfm: update to 0.3.2 (#277)
4a74379 cfm: update to 0.4.1 (#278)