From 1badd68f39d7e5d3dfe0dc736d9251e68a72b2fe Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 18 May 2020 12:39:52 +0300 Subject: mkrootfs: change method of package installation This new method speeds up the installation. You can continue installations without rebuilding packages as well. This method, * skips the package if it is already installed. * skips building the package if a prebuilt tarball exists. --- mkrootfs.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/mkrootfs.sh b/mkrootfs.sh index 9fc4556..6b065e7 100755 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -91,10 +91,27 @@ export KISS_PATH="${HOST_REPO_PATH:-/tmp/repo/core}" msg "Starting build from the PKGS variable" -# Word Splitting is intentional here, as we are -# passing package names seperately -# shellcheck disable=SC2086 -KISS_NOPROMPT=1 KISS_ASROOT=1 kiss b $PKGS + +# shellcheck disable=2154 +for pkg in $order; do + # Check if the package is already installed and skip. + kiss l "$pkg" >/dev/null 2>&1 && continue + + # Get the package directory so we can get version + # and release numbers. + pkgdir=$(kiss s "$pkg" | sed 1q) + read -r ver rel < "$pkgdir/version" + + # Check if a prebuild tarball exists, build the package + # if it doesn't exist. + # + # pkg_order should be dealing with packages in a way that + # no prompts are asked, but let's not take any chances + # either. + [ -f "${XDG_CONFIG_HOME:-$HOME/.cache}/kiss/bin/$pkg#$ver-$rel.tar.${KISS_COMPRESS:-gz}" ] || + KISS_NOPROMPT=1 kiss b "$pkg" + KISS_NOPROMPT=1 kiss i "$pkg" +done # You can check out about post-installation # from the configuration file -- cgit v1.2.3