changeset 1185:6ac8b545df56

vanilla: use busybox add-shell/remove-shell for post scripts
author David Demelier <markand@malikania.fr>
date Mon, 28 Oct 2019 20:05:00 +0100
parents 02911b528211
children 2fafcd07edb0
files core/busybox/busybox-post.sh gnu/bash/bash-post.sh shells/dash/dash-post.sh shells/tcsh/tcsh-post.sh shells/zsh/zsh-post.sh
diffstat 5 files changed, 12 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/core/busybox/busybox-post.sh	Fri Oct 25 20:10:00 2019 +0200
+++ b/core/busybox/busybox-post.sh	Mon Oct 28 20:05:00 2019 +0100
@@ -15,6 +15,9 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
-if [ "$1" = "install" ]; then
+if [ "$1" = "post-install" ]; then
 	/bin/busybox --install -s
+	/bin/busybox add-shell /bin/sh
+elif [ "$1" = "post-uninstall" ]; then
+	/bin/busybox remove-shell /bin/sh
 fi
--- a/gnu/bash/bash-post.sh	Fri Oct 25 20:10:00 2019 +0200
+++ b/gnu/bash/bash-post.sh	Mon Oct 28 20:05:00 2019 +0100
@@ -16,9 +16,7 @@
 #
 
 if [ "$1" = "post-install" ]; then
-	if ! grep -q "/bin/bash" $DESTDIR/etc/shells >/dev/null 2>&1; then
-		echo "/bin/bash" >> $DESTDIR/etc/shells
-	fi
+	/bin/busybox add-shell /bin/bash
 elif [ "$1" = "post-uninstall" ]; then
-	sed -i -e '/\/\/bin\/bash/d' $DESTDIR/etc/shells
+	/bin/busybox remove-shell /bin/bash
 fi
--- a/shells/dash/dash-post.sh	Fri Oct 25 20:10:00 2019 +0200
+++ b/shells/dash/dash-post.sh	Mon Oct 28 20:05:00 2019 +0100
@@ -16,9 +16,7 @@
 #
 
 if [ "$1" = "post-install" ]; then
-	if ! grep -q "/bin/dash" $DESTDIR/etc/shells >/dev/null 2>&1; then
-		echo "/bin/dash" >> $DESTDIR/etc/shells
-	fi
+	/bin/busybox add-shell /bin/dash
 elif [ "$1" = "post-uninstall" ]; then
-	sed -i -e '/\/\/bin\/dash/d' $DESTDIR/etc/shells
+	/bin/busybox remove-shell /bin/dash
 fi
--- a/shells/tcsh/tcsh-post.sh	Fri Oct 25 20:10:00 2019 +0200
+++ b/shells/tcsh/tcsh-post.sh	Mon Oct 28 20:05:00 2019 +0100
@@ -16,9 +16,7 @@
 #
 
 if [ "$1" = "post-install" ]; then
-	if ! grep -q "/bin/tcsh" /etc/shells >/dev/null 2>&1; then
-		echo "/bin/tcsh" >> /etc/shells
-	fi
+	/bin/busybox add-shell /bin/tcsh
 elif [ "$1" = "post-uninstall" ]; then
-	sed -i -e '/\/bin\/tcsh/d' /etc/shells
+	/bin/busybox remove-shell /bin/tcsh
 fi
--- a/shells/zsh/zsh-post.sh	Fri Oct 25 20:10:00 2019 +0200
+++ b/shells/zsh/zsh-post.sh	Mon Oct 28 20:05:00 2019 +0100
@@ -16,9 +16,7 @@
 #
 
 if [ "$1" = "post-install" ]; then
-	if ! grep -q "/bin/zsh" $DESTDIR/etc/shells >/dev/null 2>&1; then
-		echo "/bin/zsh" >> $DESTDIR/etc/shells
-	fi
+	/bin/busybox add-shell /bin/zsh
 elif [ "$1" = "post-uninstall" ]; then
-	sed -i -e '/\/\/bin\/zsh/d' $DESTDIR/etc/shells
+	/bin/busybox remove-shell /bin/zsh
 fi