From 1558d05c62ed90f7d93a14533541c33896b7b733 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 04 Nov 2020 04:00:34 -0500 Subject: update-alternatives all the things --- diff --git a/alternatives b/alternatives deleted file mode 100644 index 3631669..0000000 --- a/alternatives +++ /dev/null @@ -1,18 +0,0 @@ -/usr/bin/awk awk 10 -/usr/bin/dc dc 10 -/usr/bin/bzip2 bzip2 10 -/usr/bin/bunzip2 bunzip2 10 -/usr/bin/bzcat bzcat 10 -/usr/bin/xz xz 10 -/usr/bin/unxz unxz 10 -/usr/bin/xzcat xzcat 10 -/usr/bin/lzma lzma 10 -/usr/bin/unlzma unlzma 10 -/usr/bin/lzcat lzcat 10 -/usr/bin/ar ar 10 -/usr/bin/strings strings 10 -/usr/bin/clear clear 10 -/usr/bin/reset reset 10 -/usr/bin/mkpasswd mkpasswd 20 -/usr/bin/patch patch 10 -/usr/bin/lspci lspci 10 diff --git a/build b/build index a41ce87..ffa7a20 100755 --- a/build +++ b/build @@ -35,13 +35,10 @@ install: build chmod u+s dest/bin/busybox mkdir -p dest/usr/share/busybox set -e; exec 3>dest/usr/share/busybox/alternatives; \ - while read link name prio; do \ - if [ -e "dest/$${link}" ]; then \ - mv "dest/$${link}" "dest/$${link}.busybox"; \ - printf '%s %s %s\n' "$${link}" "$${name}" "$${prio}" \ - >&3; \ - fi; \ - done <../alternatives; \ + for f in dest/bin/* dest/sbin/* dest/usr/bin/* dest/usr/sbin/*; do \ + mv "$${f}" "$${f}.busybox"; \ + printf '%s\n' "$${f#dest}" >&3; \ + done; \ exec 3>&- set -e; $(config_enabled); $(install_init_script); \ if config_enabled INIT; then \ diff --git a/busybox.pkg/postinst b/busybox.pkg/postinst index 9f23a39..ae66306 100755 --- a/busybox.pkg/postinst +++ b/busybox.pkg/postinst @@ -1,9 +1,13 @@ #!/bin/sh if [ "x${1}" = 'xconfigure' ]; then - while read link name prio; do - update-alternatives --install "${link}" "${name}" \ - "${link}.busybox" "${prio}" + while read link; do + # 15 is a (temporary?) middle ground: alternatives that should + # override busybox's have priority 20 (which should maybe be + # increased to 30), and expect-doc provides a /usr/bin/mkpasswd + # alternative with priority 10. + update-alternatives --install "${link}" "${link##*/}" \ + "${link}.busybox" 15 done Wed, 04 Nov 2020 03:58:13 -0500 -- cgit v0.9.1