From 7faf9cf935f4f4f2650f6d8b2198e530076e7c3f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 08 Dec 2020 13:09:49 -0500 Subject: opkg_install_all(): Don't run cut in the root --- diff --git a/NEWS b/NEWS index 81c1b9f..9346655 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,10 @@ Error handling and bug fixes: * An incompatibility with GNU Bash, Z shell, KornShell, MirBSD Korn Shell, and possibly others (except Almquist shell derivatives DASH and BusyBox ash) present since prokit version 2.0.0 has been fixed. + * Installation commands no longer assume that the "cut" utility is + usable within the root being installed. ProteanOS's busybox + 1.32.0-1 manages "cut" and almost all other utility links using + update-alternatives, so they aren't usable until after installation. ProteanOS Development Kit version 2.0.1 --------------------------------------- diff --git a/src/opkg.sh b/src/opkg.sh index d801309..39b91ef 100644 --- a/src/opkg.sh +++ b/src/opkg.sh @@ -23,12 +23,15 @@ opkg_install_all() local root="${1}" shift 1 local es= + local pkgs= session_begin "${root}" . true es=0 - session_exec /bin/sh -c \ - 'opkg install $(opkg list-installed | cut -d " " -f 1)' || \ + if ! pkgs="$(session_exec opkg list-installed | cut -d " " -f 1)"; then es=${?} + session_end + fi + session_exec opkg install ${pkgs} || es=${?} session_end return ${es} -- cgit v0.9.1