summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild18
-rwxr-xr-xbusybox.pkg/postinst23
-rwxr-xr-xbusybox.pkg/prerm18
3 files changed, 37 insertions, 22 deletions
diff --git a/build b/build
index c7178fc..80d4b74 100755
--- a/build
+++ b/build
@@ -31,12 +31,18 @@ install:
oh-fixperms
oh-strip
chmod u+s dest/bin/busybox
- mv dest/usr/bin/awk dest/usr/bin/awk.busybox
- mv dest/usr/bin/ar dest/usr/bin/ar.busybox
- mv dest/usr/bin/strings dest/usr/bin/strings.busybox
- mv dest/usr/bin/clear dest/usr/bin/clear.busybox
- mv dest/usr/bin/reset dest/usr/bin/reset.busybox
- mv dest/usr/bin/mkpasswd dest/usr/bin/mkpasswd.busybox
+ set -e; for path in \
+ /usr/bin/awk \
+ /usr/bin/ar \
+ /usr/bin/strings \
+ /usr/bin/clear \
+ /usr/bin/reset \
+ /usr/bin/mkpasswd \
+ ; do \
+ if [ -e "dest/$${path}" ]; then \
+ mv "dest/$${path}" "dest/$${path}.busybox"; \
+ fi; \
+ done
set -e; $(config_enabled); $(install_init_script); \
if config_enabled INIT; then \
install -d -m 0755 dest/etc; \
diff --git a/busybox.pkg/postinst b/busybox.pkg/postinst
index 29c3d31..2120eeb 100755
--- a/busybox.pkg/postinst
+++ b/busybox.pkg/postinst
@@ -1,14 +1,17 @@
#!/bin/sh
if [ "x${1}" = 'xconfigure' ]; then
- update-alternatives --install /usr/bin/awk awk /usr/bin/awk.busybox 10
- update-alternatives --install /usr/bin/ar ar /usr/bin/ar.busybox 10
- update-alternatives --install /usr/bin/strings strings \
- /usr/bin/strings.busybox 10
- update-alternatives --install /usr/bin/clear clear \
- /usr/bin/clear.busybox 10
- update-alternatives --install /usr/bin/reset reset \
- /usr/bin/reset.busybox 10
- update-alternatives --install /usr/bin/mkpasswd mkpasswd \
- /usr/bin/mkpasswd.busybox 10
+ while read link name prio; do
+ if [ -e "${link}.busybox" ]; then
+ update-alternatives --install "${link}" "${name}" \
+ "${link}.busybox" "${prio}"
+ fi
+ done <<-EOF
+ /usr/bin/awk awk 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 10
+ EOF
fi
diff --git a/busybox.pkg/prerm b/busybox.pkg/prerm
index 63b465e..5e7cf79 100755
--- a/busybox.pkg/prerm
+++ b/busybox.pkg/prerm
@@ -1,10 +1,16 @@
#!/bin/sh
if [ "${1}" = remove ]; then
- update-alternatives --remove awk /usr/bin/awk.busybox
- update-alternatives --remove ar /usr/bin/ar.busybox
- update-alternatives --remove strings /usr/bin/strings.busybox
- update-alternatives --remove clear /usr/bin/clear.busybox
- update-alternatives --remove reset /usr/bin/reset.busybox
- update-alternatives --remove mkpasswd /usr/bin/mkpasswd.busybox
+ while read link name prio; do
+ if [ -e "${link}.busybox" ]; then
+ update-alternatives --remove "${name}" "${link}.busybox"
+ fi
+ done <<-EOF
+ /usr/bin/awk awk 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 10
+ EOF
fi