0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-08-01 13:20:30 +00:00
Files
termux-packages/packages/openjdk-21/openjdk-21.alternatives
Yaksh Bariya 0648824dad fix(main/openjdk-{17,21}): adopt '.alternatives' system
This fixes a lot of the mess that was created earlier. Now instead of
creating new update-alternative entry for each manpage, binary and the
etc/profile.d/java.sh file, there is a single alternative for java. This
should make the switching of java versions much less painful. Just one
update-alternatives command and everything is updated in one go.

This also fixed the installation of openjdk-{17,21} taking an
exorbitantly long amount of time as makewhatis is run evertime a manpage
is changed. And since there were different update-alternative entries
for each manpage, the manpage database was generated over 25 times!
Making the install very slow. This changes to using slaves so the
manpages are changed only once and the database is generated only once.
25x speed up.

For users updating from older versions of openjdk, a preinst script is
being provided that removes older update-alternatives entry for all the
older stuff. A message is printed to stdout for users so that they know
that the installation is going to take some time if mandoc is installed
due to above mentioned problem.
2025-07-12 22:37:38 +05:30

4.6 KiB