From e4777844b3f2fd2b4c5d11f42bc2433ff3a82e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Sat, 20 Nov 2021 21:56:24 -0500 Subject: [PATCH] Fix bootstrap script dep error during toltec-bootstrap install Following #456, a dependency on coreutils-tsort was added to the toltec-bootstrap package. That dependency is only needed during uninstall and is used to sort the packages in reverse dependency order. The bootstrap script does an initial temporary install of toltec-bootstrap in order to use the toltecctl definitions. It does not expect the package to have dependencies. As a consequence, the script fails to perform installs in its current state. This fix makes the script ignore dependencies for the temporary install. The dependencies do get installed at the end of the install procedure. I also added a warning above the dependency list in toltec-bootstrap to inform future contributors that those dependencies will not be honored in the initial temporary install of toltec-bootstrap. Sorry that I missed this when writing #456! --- README.md | 2 +- package/toltec-bootstrap/package | 2 ++ scripts/bootstrap/bootstrap | 10 ++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 205211e85..bf0c43684 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ To automatically install Opkg, Entware and Toltec, make sure your device is conn ```sh wget http://toltec-dev.org/bootstrap -echo "2d1233271e0cc8232e86827bcb37ab2a44be2c5675cd15f32952614916ae246a bootstrap" | sha256sum -c && bash bootstrap +echo "aa808c87fae9a9ad8c5f264044f8d770f7cd8ac07f96d2c5df648f7a20856d3d bootstrap" | sha256sum -c && bash bootstrap ``` > **Warning:** diff --git a/package/toltec-bootstrap/package b/package/toltec-bootstrap/package index 6cac9a9df..e29adbeab 100644 --- a/package/toltec-bootstrap/package +++ b/package/toltec-bootstrap/package @@ -10,6 +10,8 @@ timestamp=2021-10-06T07:51Z section="utils" maintainer="Eeems " license=MIT +# NOTE: The following dependencies will NOT be honored during bootstrap +# and will only be available after the install is completed installdepends=(coreutils-tsort) source=( diff --git a/scripts/bootstrap/bootstrap b/scripts/bootstrap/bootstrap index 1c14f1a67..1b2512afa 100755 --- a/scripts/bootstrap/bootstrap +++ b/scripts/bootstrap/bootstrap @@ -153,7 +153,8 @@ main() { # Remove those binaries in any case when the script exits trap cleanup EXIT - # Download and install the latest toltec-bootstrap package to load toltecctl + # Download and install the latest toltec-bootstrap package (without + # its dependencies) to use toltecctl definitions local pkg_basename pkg_basename="$( wget --quiet "$toltec_remote/Packages" -O - \ @@ -162,7 +163,8 @@ main() { local pkg_filename="/tmp/$pkg_basename" wget --no-verbose "$toltec_remote/$pkg_basename" -O "$pkg_filename" - opkg install --add-arch rmall:200 --offline-root / "$pkg_filename" + opkg install --add-arch rmall:200 --offline-root / --force-depends \ + "$pkg_filename" > /dev/null 2>&1 rm "$pkg_filename" # shellcheck source=../../package/toltec-bootstrap/toltecctl @@ -235,8 +237,8 @@ main() { opkg install "$@" fi - # Reinstall toltec-bootstrap to mark toltecctl file as managed - # and set the user’s PATH in configure + # Reinstall toltec-bootstrap to mark its files as managed, + # to install its dependencies, and to set the user’s PATH opkg install toltec-bootstrap log "After each system upgrade, run 'toltecctl reenable' to re-enable Toltec" }