# HG changeset patch # User Aleksej Bobylev # Date 1483867452 -7200 # Node ID 45d90da42ede5c8031758e0dc832156ed75ed62a # Parent ecbca6dbf6fb58989c9d5f646ae3683835e8c6bc Add module/bb: manage Busybox applets. Remove function definitions that are now in the /lib/libtaz.sh (die, im). diff -r ecbca6dbf6fb -r 45d90da42ede modules/bb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/bb Sun Jan 08 11:24:12 2017 +0200 @@ -0,0 +1,45 @@ +#!/bin/sh +# TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg +# bb - TazPkg module +# Manage Busybox applets + + +# Input: $1 - command: +# restore restore missing Busybox applets +# replaced list of the replaced Busybox applets +# +# Variable $root points to the root of the installation + + +# Connect function libraries +. /lib/libtaz.sh + + + + +[ ! -x "$root/bin/busybox" ] && die 'Busybox is not installed in the %s. Exit.' "$root" + +# Full list but skipping some applets: bbconfig, linuxrc +applets_list=$($root/bin/busybox --list-full | grep -v 'bbconfig\|linuxrc') + +case $1 in + restore) + mkdir -p "$root/sbin" "$root/usr/bin" "$root/usr/sbin" + for applet in $applets_list; do + if [ ! -x "$root/$applet" ]; then + action 'Restoring Busybox applet %s...' "$(basename $applet)" + case $(dirname $applet) in + bin) ln -sf 'busybox' "$root/$applet";; + sbin) ln -sf '../bin/busybox' "$root/$applet";; + usr/*bin) ln -sf '../../bin/busybox' "$root/$applet";; + esac + status + fi + done + ;; + replaced) + ls -l $(echo "$applets_list" | sed "s|^|$root/|") 2>/dev/null | \ + awk -vr="$root" '{if ($0 !~ /busybox$/){sub(r, ""); print $9}}' + ;; +esac + diff -r ecbca6dbf6fb -r 45d90da42ede modules/description --- a/modules/description Sat Jan 07 09:06:14 2017 +0000 +++ b/modules/description Sun Jan 08 11:24:12 2017 +0200 @@ -13,13 +13,6 @@ -# Interactive mode - -im() { tty -s; } - - - - unset desc # 1) Localized description diff -r ecbca6dbf6fb -r 45d90da42ede modules/getenv --- a/modules/getenv Sat Jan 07 09:06:14 2017 +0000 +++ b/modules/getenv Sun Jan 08 11:24:12 2017 +0200 @@ -17,9 +17,6 @@ . /lib/libtaz.sh -# Report error and finish work -die() { longline "$(_ "$@")" >&2; exit 1; } - # Show debug messages debug() { if [ -n "$debug" ]; then diff -r ecbca6dbf6fb -r 45d90da42ede modules/info --- a/modules/info Sat Jan 07 09:06:14 2017 +0000 +++ b/modules/info Sun Jan 08 11:24:12 2017 +0200 @@ -13,11 +13,6 @@ -# Interactive mode - -im() { tty -s; } - - # Unset variables that may absent in the receipt unset EXTRAVERSION TAGS DEPENDS PROVIDE SIZES diff -r ecbca6dbf6fb -r 45d90da42ede modules/list --- a/modules/list Sat Jan 07 09:06:14 2017 +0000 +++ b/modules/list Sun Jan 08 11:24:12 2017 +0200 @@ -30,11 +30,6 @@ -# Interactive mode - -im() { tty -s; } - - # Functions set for translate categories # -------------------------------------- diff -r ecbca6dbf6fb -r 45d90da42ede modules/remove --- a/modules/remove Sat Jan 07 09:06:14 2017 +0000 +++ b/modules/remove Sun Jan 08 11:24:12 2017 +0200 @@ -21,11 +21,6 @@ } -# Interactive mode - -im() { tty -s; } - - # Block of receipt function callers # Why? "Bad" receipt sourcing can redefine some vital TazPkg variables. # Few receipts function should be patched now. @@ -209,6 +204,9 @@ # [3/5] Post-remove commands call_post_remove "$INSTALLED/$PACKAGE/receipt" +# restore Busybox applets +. @@MODULES@@/bb restore + # [4/5] Update system databases fl="$INSTALLED/$PACKAGE/files.list"; upd=0