Skip to content

Commit 1a8f0fa

Browse files
committed
Prevent some operations on unsupported systems
1 parent 2bacfcd commit 1a8f0fa

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

scripts/configure-locale.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ echo 'en_GB.UTF-8 UTF-8' > "${LOCALE_GEN_FILE_PATH}"
2929
echo 'en_US.UTF-8 UTF-8' >> "${LOCALE_GEN_FILE_PATH}"
3030
echo 'ro_RO.UTF-8 UTF-8' >> "${LOCALE_GEN_FILE_PATH}"
3131

32-
for LOCALE in $(awk '{print $1}' "${LOCALE_GEN_FILE_PATH}" | sed -e 's/\([^\.]*\)\.\(.*\)/\1.\L\2/' | sed 's/-//'); do
33-
if [ ! $(locale -a | grep "${LOCALE}") ]; then
34-
echo 'Generating the localisations...'
35-
locale-gen
36-
break
37-
fi
38-
done
32+
if [ -f "${LOCALE_GEN_FILE_PATH}" ] \
33+
&& does_bin_exist 'locale-gen'; then
34+
for LOCALE in $(awk '{print $1}' "${LOCALE_GEN_FILE_PATH}" | sed -e 's/\([^\.]*\)\.\(.*\)/\1.\L\2/' | sed 's/-//'); do
35+
if [ ! $(locale -a | grep "${LOCALE}") ]; then
36+
echo 'Generating the localisations...'
37+
locale-gen
38+
break
39+
fi
40+
done
41+
fi
3942

4043
# Update the X11 keyboard layout definitions
4144
if ${HAS_GUI}; then

scripts/configure-system-time.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ elif [ ! -f "${LOCALTIME_FILE_PATH}" ]; then
2020
ln -sf "${ROOT_USER_SHARE}/zoneinfo/${PREFERRED_TIMEZONE}" "${LOCALTIME_FILE_PATH}"
2121
fi
2222

23-
does_bin_exist 'hwclock' && hwclock --systohc
23+
if [ "${DEVICE_MODEL}" != 'iPhone' ]; then
24+
does_bin_exist 'hwclock' && hwclock --systohc
25+
fi

0 commit comments

Comments
 (0)