mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
shellcheck fixes
This commit is contained in:
parent
21c9997e1c
commit
60b45b6355
9 changed files with 10 additions and 5 deletions
|
@ -27,11 +27,11 @@ _desktop () {
|
||||||
_dialog --title " Internet Browser " --menu "" 8 40 4 \
|
_dialog --title " Internet Browser " --menu "" 8 40 4 \
|
||||||
"chromium" "Browser From Google" \
|
"chromium" "Browser From Google" \
|
||||||
"firefox" "Browser From Mozilla" 2>${_ANSWER} || return 1
|
"firefox" "Browser From Mozilla" 2>${_ANSWER} || return 1
|
||||||
_BROWSER="$(cat ${_ANSWER})"
|
_BROWSER=$(cat "${_ANSWER}")
|
||||||
sd "STANDARD_BROWSER=.*" "STANDARD_BROWSER=${_BROWSER}" /etc/archboot/defaults
|
sd "STANDARD_BROWSER=.*" "STANDARD_BROWSER=${_BROWSER}" /etc/archboot/defaults
|
||||||
source /etc/locale.conf
|
source /etc/locale.conf
|
||||||
clear
|
clear
|
||||||
update -${_EXIT} || exit 1
|
update -"${_EXIT}" || exit 1
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@ _localize_task() {
|
||||||
echo "LANG=${_LOCALE}.UTF-8" > /.localize
|
echo "LANG=${_LOCALE}.UTF-8" > /.localize
|
||||||
echo LC_COLLATE=C >> /etc/locale.conf
|
echo LC_COLLATE=C >> /etc/locale.conf
|
||||||
localectl set-locale "${_LOCALE}.UTF-8" &>"${_NO_LOG}"
|
localectl set-locale "${_LOCALE}.UTF-8" &>"${_NO_LOG}"
|
||||||
|
#shellcheck disable=SC2016
|
||||||
sd '(^[a-z])' '#$1' /etc/locale.gen
|
sd '(^[a-z])' '#$1' /etc/locale.gen
|
||||||
sd "^#${_LOCALE}.UTF-8" "${_LOCALE}.UTF-8" /etc/locale.gen
|
sd "^#${_LOCALE}.UTF-8" "${_LOCALE}.UTF-8" /etc/locale.gen
|
||||||
locale-gen &>"${_NO_LOG}"
|
locale-gen &>"${_NO_LOG}"
|
||||||
|
|
|
@ -21,6 +21,7 @@ _online_switch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_net_interfaces() {
|
_net_interfaces() {
|
||||||
|
#shellcheck disable=SC2016
|
||||||
fd -E '/lo' . '/sys/class/net' -x rg '(.*)' -r '{/} $1' {}/address | sort -u
|
fd -E '/lo' . '/sys/class/net' -x rg '(.*)' -r '{/} $1' {}/address | sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ rm -r /usr/share/{licenses,locale} /usr/lib/{systemd,tmpfiles.d}
|
||||||
pacman -Sy
|
pacman -Sy
|
||||||
#shellcheck disable=SC2013
|
#shellcheck disable=SC2013
|
||||||
for i in $(pacman -Q | cut -d ' ' -f1); do
|
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
|
#shellcheck disable=SC2086
|
||||||
if pacman -Sdd ${i} --noconfirm >>log.txt; then
|
if pacman -Sdd ${i} --noconfirm >>log.txt; then
|
||||||
echo "${i}" >> not-installed.orig.txt
|
echo "${i}" >> not-installed.orig.txt
|
||||||
|
|
|
@ -64,6 +64,7 @@ _enable_testing() {
|
||||||
_DOTESTING=""
|
_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
|
_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
|
if [[ -n "${_DOTESTING}" ]]; then
|
||||||
|
#shellcheck disable=SC2016
|
||||||
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
|
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -94,6 +94,7 @@ echo -e "Starting none tracked files in \e[1m10\e[m seconds... \e[1;92mCTRL-C\e[
|
||||||
sleep 10
|
sleep 10
|
||||||
_run_test "none tracked files in /usr/lib... this takes a while"
|
_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
|
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
|
pacman -Qo ${i} &>${_NO_LOG} || echo ${i} >> pacman-error.log
|
||||||
done
|
done
|
||||||
_result pacman-error.log
|
_result pacman-error.log
|
||||||
|
|
|
@ -91,7 +91,7 @@ _dialog() {
|
||||||
|
|
||||||
# $1: percentage $2: message
|
# $1: percentage $2: message
|
||||||
_progress() {
|
_progress() {
|
||||||
cat 2>${_NO_LOG} <<EOF
|
cat 2>"${_NO_LOG}" <<EOF
|
||||||
XXX
|
XXX
|
||||||
${1}
|
${1}
|
||||||
${2}
|
${2}
|
||||||
|
|
|
@ -66,7 +66,7 @@ _chroot_mount()
|
||||||
mount sys "${_DESTDIR}/sys" -t sysfs -o nosuid,noexec,nodev,ro
|
mount sys "${_DESTDIR}/sys" -t sysfs -o nosuid,noexec,nodev,ro
|
||||||
# needed for efi bootloader installation routines
|
# needed for efi bootloader installation routines
|
||||||
if mount | rg -qw 'efivarfs'; then
|
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
|
fi
|
||||||
mount udev "${_DESTDIR}/dev" -t devtmpfs -o mode=0755,nosuid
|
mount udev "${_DESTDIR}/dev" -t devtmpfs -o mode=0755,nosuid
|
||||||
mount devpts "${_DESTDIR}/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec
|
mount devpts "${_DESTDIR}/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec
|
||||||
|
|
|
@ -27,6 +27,7 @@ if echo "${_BASENAME}" | rg -qw "${_RUNNING_ARCH}"; then
|
||||||
# enable [*-testing] if enabled in host
|
# enable [*-testing] if enabled in host
|
||||||
if rg -q "^\[core-testing" /etc/pacman.conf; then
|
if rg -q "^\[core-testing" /etc/pacman.conf; then
|
||||||
echo "Enable [core-testing] and [extra-testing] repository in container..."
|
echo "Enable [core-testing] and [extra-testing] repository in container..."
|
||||||
|
#shellcheck disable=SC2016
|
||||||
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
|
sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${1}/etc/pacman.conf"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue