Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

Commit df381ef

Browse files
author
Erazem Kokot
committed
Revert "Lint configure_locale.sh (#884)"
This reverts commit 147a878.
1 parent 147a878 commit df381ef

1 file changed

Lines changed: 23 additions & 26 deletions

File tree

lib/configure_locale.sh

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
### License: GPL v2.0
1616
###############################################################
1717

18-
# Disable shellcheck warning about variables being referenced but not assigned
19-
# shellcheck disable=2154
20-
2118
set_keys() {
2219

23-
op_title="${key_op_msg}"
20+
op_title="$key_op_msg"
2421
while (true)
2522
do
26-
keyboard=$(dialog --nocancel --ok-button "${ok}" --menu "${keys_msg}" 18 60 10 \
23+
keyboard=$(dialog --nocancel --ok-button "$ok" --menu "$keys_msg" 18 60 10 \
2724
"us" "United States" \
2825
"de" "German" \
2926
"el" "Greek" \
@@ -36,11 +33,11 @@ set_keys() {
3633
"ru" "Russian" \
3734
"sv" "Swedish" \
3835
"uk" "United Kingdom" \
39-
"${other}" "${other}-keymaps" 3>&1 1>&2 2>&3)
40-
source "${lang_file}"
36+
"$other" "$other-keymaps" 3>&1 1>&2 2>&3)
37+
source "$lang_file"
4138

42-
if [ "${keyboard}" = "${other}" ]; then
43-
keyboard=$(dialog --ok-button "${ok}" --cancel-button "${cancel}" --menu "${keys_msg}" 19 60 10 "${key_maps}" 3>&1 1>&2 2>&3)
39+
if [ "$keyboard" = "$other" ]; then
40+
keyboard=$(dialog --ok-button "$ok" --cancel-button "$cancel" --menu "$keys_msg" 19 60 10 $key_maps 3>&1 1>&2 2>&3)
4441
if [ "$?" -eq "0" ]; then
4542
break
4643
fi
@@ -49,17 +46,17 @@ set_keys() {
4946
fi
5047
done
5148

52-
localectl set-keymap "${keyboard}"
53-
echo "$(date -u "+%F %H:%M") : Set keymap to: ${keyboard}" >> "${log}"
49+
localectl set-keymap "$keyboard"
50+
echo "$(date -u "+%F %H:%M") : Set keymap to: $keyboard" >> "$log"
5451

5552
}
5653

5754
set_locale() {
5855

59-
op_title="${locale_op_msg}"
56+
op_title="$locale_op_msg"
6057
while (true)
6158
do
62-
LOCALE=$(dialog --nocancel --ok-button "${ok}" --menu "${locale_msg}" 18 60 11 \
59+
LOCALE=$(dialog --nocancel --ok-button "$ok" --menu "$locale_msg" 18 60 11 \
6360
"en_US.UTF-8" "United States" \
6461
"en_AU.UTF-8" "Australia" \
6562
"pt_BR.UTF-8" "Brazil" \
@@ -78,10 +75,10 @@ set_locale() {
7875
"ru_RU.UTF-8" "Russian" \
7976
"es_ES.UTF-8" "Spanish" \
8077
"sv_SE.UTF-8" "Swedish" \
81-
"${other}" "${other}-locale" 3>&1 1>&2 2>&3)
78+
"$other" "$other-locale" 3>&1 1>&2 2>&3)
8279

83-
if [ "${LOCALE}" = "${other}" ]; then
84-
LOCALE=$(dialog --ok-button "${ok}" --cancel-button "${cancel}" --menu "${locale_msg}" 18 60 11 "${localelist}" 3>&1 1>&2 2>&3)
80+
if [ "$LOCALE" = "$other" ]; then
81+
LOCALE=$(dialog --ok-button "$ok" --cancel-button "$cancel" --menu "$locale_msg" 18 60 11 $localelist 3>&1 1>&2 2>&3)
8582
if [ "$?" -eq "0" ]; then
8683
break
8784
fi
@@ -90,24 +87,24 @@ set_locale() {
9087
fi
9188
done
9289

93-
echo "$(date -u "+%F %H:%M") : Set locale to: ${LOCALE}" >> "${log}"
90+
echo "$(date -u "+%F %H:%M") : Set locale to: $LOCALE" >> "$log"
9491

9592
}
9693

9794

9895
set_zone() {
9996

100-
op_title="${zone_op_msg}"
97+
op_title="$zone_op_msg"
10198
while (true)
10299
do
103-
ZONE=$(dialog --nocancel --ok-button "${ok}" --menu "${zone_msg0}" 18 60 11 "${zonelist}" 3>&1 1>&2 2>&3)
104-
if (find /usr/share/zoneinfo -maxdepth 1 -type d | sed -n -e 's!^.*/!!p' | grep "${ZONE}" &> /dev/null); then
105-
sublist=$(find /usr/share/zoneinfo/"${ZONE}" -maxdepth 1 | sed -n -e 's!^.*/!!p' | sort | sed 's/$/ -/g' | grep -v "${ZONE}")
106-
SUBZONE=$(dialog --ok-button "${ok}" --cancel-button "${back}" --menu "${zone_msg1}" 18 60 11 "${sublist}" 3>&1 1>&2 2>&3)
100+
ZONE=$(dialog --nocancel --ok-button "$ok" --menu "$zone_msg0" 18 60 11 $zonelist 3>&1 1>&2 2>&3)
101+
if (find /usr/share/zoneinfo -maxdepth 1 -type d | sed -n -e 's!^.*/!!p' | grep "$ZONE" &> /dev/null); then
102+
sublist=$(find /usr/share/zoneinfo/"$ZONE" -maxdepth 1 | sed -n -e 's!^.*/!!p' | sort | sed 's/$/ -/g' | grep -v "$ZONE")
103+
SUBZONE=$(dialog --ok-button "$ok" --cancel-button "$back" --menu "$zone_msg1" 18 60 11 $sublist 3>&1 1>&2 2>&3)
107104
if [ "$?" -eq "0" ]; then
108-
if (find /usr/share/zoneinfo/"${ZONE}" -maxdepth 1 -type d | sed -n -e 's!^.*/!!p' | grep "${SUBZONE}" &> /dev/null); then
109-
sublist=$(find /usr/share/zoneinfo/"${ZONE}"/"${SUBZONE}" -maxdepth 1 | sed -n -e 's!^.*/!!p' | sort | sed 's/$/ -/g' | grep -v "${SUBZONE}")
110-
SUB_SUBZONE=$(dialog --ok-button "${ok}" --cancel-button "${back}" --menu "${zone_msg1}" 15 60 7 "${sublist}" 3>&1 1>&2 2>&3)
105+
if (find /usr/share/zoneinfo/"$ZONE" -maxdepth 1 -type d | sed -n -e 's!^.*/!!p' | grep "$SUBZONE" &> /dev/null); then
106+
sublist=$(find /usr/share/zoneinfo/"$ZONE"/"$SUBZONE" -maxdepth 1 | sed -n -e 's!^.*/!!p' | sort | sed 's/$/ -/g' | grep -v "$SUBZONE")
107+
SUB_SUBZONE=$(dialog --ok-button "$ok" --cancel-button "$back" --menu "$zone_msg1" 15 60 7 $sublist 3>&1 1>&2 2>&3)
111108
if [ "$?" -eq "0" ]; then
112109
ZONE="${ZONE}/${SUBZONE}/${SUB_SUBZONE}"
113110
break
@@ -122,7 +119,7 @@ set_zone() {
122119
fi
123120
done
124121

125-
echo "$(date -u "+%F %H:%M") : Set timezone to: ${ZONE}" >> "${log}"
122+
echo "$(date -u "+%F %H:%M") : Set timezone to: $ZONE" >> "$log"
126123

127124
}
128125

0 commit comments

Comments
 (0)