shellcheck fixes

This commit is contained in:
Tobias Powalowski 2024-07-10 21:40:20 +02:00
parent 21c9997e1c
commit 60b45b6355
9 changed files with 10 additions and 5 deletions

View file

@ -27,11 +27,11 @@ _desktop () {
_dialog --title " Internet Browser " --menu "" 8 40 4 \
"chromium" "Browser From Google" \
"firefox" "Browser From Mozilla" 2>${_ANSWER} || return 1
_BROWSER="$(cat ${_ANSWER})"
_BROWSER=$(cat "${_ANSWER}")
sd "STANDARD_BROWSER=.*" "STANDARD_BROWSER=${_BROWSER}" /etc/archboot/defaults
source /etc/locale.conf
clear
update -${_EXIT} || exit 1
update -"${_EXIT}" || exit 1
exit 0
}

View file

@ -66,6 +66,7 @@ _localize_task() {
echo "LANG=${_LOCALE}.UTF-8" > /.localize
echo LC_COLLATE=C >> /etc/locale.conf
localectl set-locale "${_LOCALE}.UTF-8" &>"${_NO_LOG}"
#shellcheck disable=SC2016
sd '(^[a-z])' '#$1' /etc/locale.gen
sd "^#${_LOCALE}.UTF-8" "${_LOCALE}.UTF-8" /etc/locale.gen
locale-gen &>"${_NO_LOG}"

View file

@ -21,6 +21,7 @@ _online_switch() {
}
_net_interfaces() {
#shellcheck disable=SC2016
fd -E '/lo' . '/sys/class/net' -x rg '(.*)' -r '{/} $1' {}/address | sort -u
}

View file

@ -10,7 +10,7 @@ rm -r /usr/share/{licenses,locale} /usr/lib/{systemd,tmpfiles.d}
pacman -Sy
#shellcheck disable=SC2013
for i in $(pacman -Q | cut -d ' ' -f1); do
rm -r "${_PACMAN_LIB}"/local/$(pacman -Q ${i} | sd ' ' '-')
rm -r "${_PACMAN_LIB}"/local/"$(pacman -Q ${i} | sd ' ' '-')"
#shellcheck disable=SC2086
if pacman -Sdd ${i} --noconfirm >>log.txt; then
echo "${i}" >> not-installed.orig.txt

View file

@ -64,6 +64,7 @@ _enable_testing() {
_DOTESTING=""
_dialog --title " Testing Repositories " --defaultno --yesno "Do you want to enable testing repositories?\n\nOnly enable this if you need latest\navailable packages for testing purposes!" 8 50 && _DOTESTING=1
if [[ -n "${_DOTESTING}" ]]; then
#shellcheck disable=SC2016
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
fi
else

View file

@ -94,6 +94,7 @@ echo -e "Starting none tracked files in \e[1m10\e[m seconds... \e[1;92mCTRL-C\e[
sleep 10
_run_test "none tracked files in /usr/lib... this takes a while"
for i in $(fd -u -E '/modules/' -E '/udev/' -E 'gconv-modules.cache' -E '/locale-archive' . /usr/lib); do
#shellcheck disable=SC2086
pacman -Qo ${i} &>${_NO_LOG} || echo ${i} >> pacman-error.log
done
_result pacman-error.log

View file

@ -91,7 +91,7 @@ _dialog() {
# $1: percentage $2: message
_progress() {
cat 2>${_NO_LOG} <<EOF
cat 2>"${_NO_LOG}" <<EOF
XXX
${1}
${2}

View file

@ -66,7 +66,7 @@ _chroot_mount()
mount sys "${_DESTDIR}/sys" -t sysfs -o nosuid,noexec,nodev,ro
# needed for efi bootloader installation routines
if mount | rg -qw 'efivarfs'; then
mount efivarfs ${_DESTDIR}/sys/firmware/efi/efivars -t efivarfs -o nosuid,noexec,nodev
mount efivarfs "${_DESTDIR}"/sys/firmware/efi/efivars -t efivarfs -o nosuid,noexec,nodev
fi
mount udev "${_DESTDIR}/dev" -t devtmpfs -o mode=0755,nosuid
mount devpts "${_DESTDIR}/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec

View file

@ -27,6 +27,7 @@ if echo "${_BASENAME}" | rg -qw "${_RUNNING_ARCH}"; then
# enable [*-testing] if enabled in host
if rg -q "^\[core-testing" /etc/pacman.conf; then
echo "Enable [core-testing] and [extra-testing] repository in container..."
#shellcheck disable=SC2016
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
fi
fi