From db951502cd2a3c8b56dd75cc9d283958ba088cab Mon Sep 17 00:00:00 2001 From: timoxa0 Date: Sun, 27 Oct 2024 18:36:35 +0500 Subject: [PATCH] common_deb: Fix typos. Use extra debootstrap_args. Shellchecked --- common.d/common.deb.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common.d/common.deb.sh b/common.d/common.deb.sh index 992baea..ccf1bb1 100644 --- a/common.d/common.deb.sh +++ b/common.d/common.deb.sh @@ -2,10 +2,11 @@ source ./common.d/functions.sh source ./common.d/build_functions.sh -require "debootstarp" +require "debootstrap" export DEBIAN_FRONTEND=noninteractive +# shellcheck disable=SC2086 fetch_base_system() { local rootdir="$1" @@ -18,9 +19,9 @@ fetch_base_system() log "Rootdir [$rootdir] does not exists" ierror return 2 } - log "Fetching base system" internal - debootstarp --arch arm64 --components "$components" "$branch" "$rootdir" "$repo" || { + debootstrap --arch arm64 --components="$components" $debootstrap_flags "$branch" "$rootdir" "$repo" || { log "Failed to fetch base system" ierror + return 1 } } @@ -81,7 +82,7 @@ install_nabu_packages() } cp ./packages/*.deb "$rootdir/opt/" - chroot "$rootdir" bash -c "dpkg -i /opt/*.deb" { + chroot "$rootdir" bash -c "dpkg -i /opt/*.deb" || { log "Failed to install packages" ierror return 1 } @@ -94,16 +95,17 @@ install_nabu_packages() } } +# shellcheck disable=SC2086 install_packages() { local rootdir="$1" - local packages="${@:2}" + local packages="${*:2}" [ ! -d "$rootdir" ] && { log "Rootdir [$rootdir] does not exists" ierror return 2 } - chroot "$rootdir" apt install ${packages[*]} -y || { + chroot "$rootdir" apt install $packages -y || { log "Failed to install package(s)" ierror return 1 } @@ -123,7 +125,7 @@ finish_system() return 1 } - log "Updating runtime linked bindings" internal + log "Updating runtime linker bindings" internal chroot "$rootdir" ldconfig || { log "Failed to update runtime linker bindings" ierror return 1