From a4446f72796326e1dd1c9064696b1dedd519be32 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Wed, 6 Sep 2023 11:51:28 +0200 Subject: [PATCH] shellcheck fixes --- usr/bin/archboot-not-installed.sh | 2 +- usr/lib/archboot/container.sh | 8 ++++---- usr/lib/archboot/release.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/bin/archboot-not-installed.sh b/usr/bin/archboot-not-installed.sh index de263575a..56925ed01 100755 --- a/usr/bin/archboot-not-installed.sh +++ b/usr/bin/archboot-not-installed.sh @@ -12,7 +12,7 @@ pacman -Q | cut -d ' ' -f1 >packages.txt for i in $(cat packages.txt); do rm -r "${_PACMAN_LIB}"/local/"${i}"-*-[0-9]* #shellcheck disable=SC2086 - if pacman -Sdd ${i} --noconfirm 2>&1 >>log.txt; then + if pacman -Sdd ${i} --noconfirm >>log.txt; then echo "${i}" >> uninstalled.orig.txt else #shellcheck disable=SC2086 diff --git a/usr/lib/archboot/container.sh b/usr/lib/archboot/container.sh index 70ffe06fc..d3fa3ac07 100644 --- a/usr/lib/archboot/container.sh +++ b/usr/lib/archboot/container.sh @@ -90,7 +90,7 @@ _clean_mkinitcpio() { _prepare_pacman() { # prepare pacman dirs echo "Creating directories in ${1}..." - mkdir -p "${1}/var/lib/pacman" + mkdir -p "${1}"${_PACMAN_LIB}"" mkdir -p "${1}/${_CACHEDIR}" [[ -e "${1}/proc" ]] || mkdir -m 555 "${1}/proc" [[ -e "${1}/sys" ]] || mkdir -m 555 "${1}/sys" @@ -103,7 +103,7 @@ _prepare_pacman() { mount devpts "${1}/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec mount shm "${1}/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev echo "Removing archboot repository sync db..." - rm -f /var/lib/pacman/sync/archboot.db + rm -f "${_PACMAN_LIB}"/sync/archboot.db echo "Updating Arch Linux keyring..." #shellcheck disable=SC2086 pacman -Sy --config ${_PACMAN_CONF} --noconfirm --noprogressbar ${_KEYRING} &>"${_NO_LOG}" @@ -196,7 +196,7 @@ _install_archboot() { if ! [[ "${2}" == "use_binfmt" ]]; then rm -r "${1}"/blankdb echo "Removing archboot repository sync db..." - rm /var/lib/pacman/sync/archboot.db + rm "${_PACMAN_LIB}"/sync/archboot.db fi } @@ -224,7 +224,7 @@ _copy_archboot_defaults() { _reproducibility() { echo "Reproducibility changes..." - sed -i -e '/INSTALLDATE/{n;s/.*/0/}' "${1}"/var/lib/pacman/local/*/desc + sed -i -e '/INSTALLDATE/{n;s/.*/0/}' "${1}""${_PACMAN_LIB}"/local/*/desc rm "${1}"/var/cache/ldconfig/aux-cache rm "${1}"/etc/ssl/certs/java/cacerts } diff --git a/usr/lib/archboot/release.sh b/usr/lib/archboot/release.sh index 650245cee..fd68b085d 100644 --- a/usr/lib/archboot/release.sh +++ b/usr/lib/archboot/release.sh @@ -154,7 +154,7 @@ _create_iso() { echo "Systemd:$(${_NSPAWN} "${_W_DIR}" pacman -Qi systemd | grep Version | cut -d ":" -f2 | sed -e "s/\r//g" -e "s/\x1b\[[0-9;]*m//g")";\ echo "";\ echo "---Complete Package List---";\ - echo "$(${_NSPAWN} "${_W_DIR}" pacman -Q | sed -e "s/\r//g" -e "s/\x1b\[[0-9;]*m//g" -e "s/\x1b\[.*[0-9][h;l]//g")") >>Release.txt + $(${_NSPAWN} "${_W_DIR}" pacman -Q | sed -e "s/\r//g" -e "s/\x1b\[[0-9;]*m//g" -e "s/\x1b\[.*[0-9][h;l]//g")) >>Release.txt # removing container echo "Removing container ${_W_DIR}..." rm -r "${_W_DIR}"