1 |
Bug: https://bugs.gentoo.org/886247 |
2 |
Bug: https://bugs.gentoo.org/886017 |
3 |
Signed-off-by: Sam James <sam@g.o> |
4 |
--- |
5 |
...022-12-24-alternatives-introduction.en.txt | 92 +++++++++++++++++++ |
6 |
1 file changed, 92 insertions(+) |
7 |
create mode 100644 2022-12-24-alternatives-introduction/2022-12-24-alternatives-introduction.en.txt |
8 |
|
9 |
diff --git a/2022-12-24-alternatives-introduction/2022-12-24-alternatives-introduction.en.txt b/2022-12-24-alternatives-introduction/2022-12-24-alternatives-introduction.en.txt |
10 |
new file mode 100644 |
11 |
index 0000000..841e07a |
12 |
--- /dev/null |
13 |
+++ b/2022-12-24-alternatives-introduction/2022-12-24-alternatives-introduction.en.txt |
14 |
@@ -0,0 +1,92 @@ |
15 |
+Title: Introduction of app-alternatives ebuilds |
16 |
+Author: Sam James <sam@g.o> |
17 |
+Posted: 2022-12-24 |
18 |
+Revision: 1 |
19 |
+News-Item-Format: 2.0 |
20 |
+ |
21 |
+Gentoo is introducing a new category of ebuilds called 'app-alternatives' |
22 |
+to handle cases where a symlink for a common binary may want to be switched |
23 |
+between different packages by a user. |
24 |
+ |
25 |
+Traditionally, eselect was used for this, and while eselect still has its |
26 |
+place, it's unsuitable for cases like /bin/awk and /bin/sh because it |
27 |
+prevents immutable system directories and (more importantly |
28 |
+from a package management perspective) relies on orphaned symlinks which |
29 |
+means no package owns /bin/awk, /bin/sh, etc. This is not reliable and |
30 |
+can lead to dead symlinks (or no symlink at all) in some edge cases [0]. |
31 |
+ |
32 |
+Systems will be more robust and desired system configuration |
33 |
+can be achieved using the package manager rather than manual steps outside of it. |
34 |
+ |
35 |
+The initial list of packages which support alternatives is as follows: |
36 |
+- app-alternatives/awk |
37 |
+- app-alternatives/bzip2 |
38 |
+- app-alternatives/bc |
39 |
+- app-alternatives/cpio |
40 |
+- app-alternatives/gzip |
41 |
+- app-alternatives/lex |
42 |
+- app-alternatives/sh |
43 |
+- app-alternatives/tar |
44 |
+- app-alternatives/yacc |
45 |
+ |
46 |
+The stabilization of these new ebuilds and packages depending |
47 |
+on them is ongoing in bug 886017 [1]. |
48 |
+ |
49 |
+## Per-upgrade requirements |
50 |
+ |
51 |
+The default configuration on Gentoo systems is FEATURES="protect-owned" |
52 |
+which works similarly to FEATURES="collision-protect" but it allows |
53 |
+collisions between orphaned files. In this case, a one-off collision |
54 |
+occurs as the app-alternatives/ ebuilds begin to claim once-orphaned |
55 |
+symlinks. |
56 |
+ |
57 |
+A similar issue occurred during the libxcrypt migration where users |
58 |
+had upgrades interrupted by using the older, more aggressive |
59 |
+FEATURES="collision-protect". |
60 |
+ |
61 |
+It is recommended that users alter their configuration to |
62 |
+remove references to 'collision-protect' in FEATURES and instead either |
63 |
+explicitly enable 'protect-owned' in FEATURES or rely on the default |
64 |
+(equivalent). It is also acceptable to simply disable collision-protect |
65 |
+temporarily for the purposes of this news item. |
66 |
+ |
67 |
+WARNING: Users with collision-protect enabled must disable FEATURES="collision-protect" |
68 |
+in /etc/portage/make.conf by removing it or setting FEATURES="-collision-protect" |
69 |
+if they have enabled it. collision-protect detects collisions between files including |
70 |
+orphaned files where no package owns the file. |
71 |
+ |
72 |
+## Migrating |
73 |
+ |
74 |
+To migrate your system, a standard world upgrade will suffice: |
75 |
+1. # emerge --sync |
76 |
+2. # emerge -a -uvDU @world (or other similar standard world upgrade command) |
77 |
+ |
78 |
+## Configuration |
79 |
+ |
80 |
+Users who are not interested in using different implementations for |
81 |
+various tools listed above can ignore this section. |
82 |
+ |
83 |
+No configuration should be required by default, but users may wish |
84 |
+to configure the new app-alternatives/ ebuilds to their tastes as they |
85 |
+used to do via e.g. eselect-sh and eselect-awk. |
86 |
+ |
87 |
+Going forward, /etc/portage/package.use will be used for this purpose. |
88 |
+ |
89 |
+Users should review the USE flags available for the various app-alternatives |
90 |
+ebuilds like app-alternatives/sh and adjust their configuration as desired. |
91 |
+ |
92 |
+For example, to have /usr/bin/gzip be provided by app-arch/pigz for automatic |
93 |
+parallelization of 'gzip', one would have the following in /etc/portage/package.use: |
94 |
+``` |
95 |
+# https://wiki.gentoo.org/wiki/Gzip#Parallelization |
96 |
+# Make /usr/bin/gzip be a symlink to pigz for a speedup in compression |
97 |
+app-alternatives/gzip -reference pigz |
98 |
+``` |
99 |
+ |
100 |
+## Further reading |
101 |
+ |
102 |
+For more details, please see the technical documentation on the wiki [2]. |
103 |
+ |
104 |
+[0] https://wiki.gentoo.org/wiki/Project:Base/Alternatives#Why.3F |
105 |
+[1] https://bugs.gentoo.org/886017 |
106 |
+[2] https://wiki.gentoo.org/wiki/Project:Base/Alternatives |
107 |
-- |
108 |
2.39.0 |