forked from rhinstaller/kickstart-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages-instlangs-3.ks.in
73 lines (61 loc) · 2.03 KB
/
packages-instlangs-3.ks.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#version=DEVEL
url @KSTEST_URL@
install
network --bootproto=dhcp
bootloader --timeout=1
zerombr
clearpart --all --initlabel
autopart
keyboard us
lang en_US.UTF-8
timezone America/New_York --utc
rootpw testcase
shutdown
# Install a short list of languages
# Use ones with translations in blivet to make them easy to find.
%packages --instLangs=es:fr:it
python3-blivet
%end
%post
# Make sure the locales we asked for are installed
if [ ! -f /usr/share/locale/es/LC_MESSAGES/blivet.mo ]; then
echo "*** Spanish translations were not installed" >> /root/RESULT
fi
if [ ! -f /usr/share/locale/fr/LC_MESSAGES/blivet.mo ]; then
echo "*** French translations were not installed" >> /root/RESULT
fi
if [ ! -f /usr/share/locale/it/LC_MESSAGES/blivet.mo ]; then
echo "*** Italian translations were not installed" >> /root/RESULT
fi
# Make sure nothing else got installed
molist="$(find /usr/share/locale \( -name 'fr' -type d -prune \) -o \
\( -name 'es' -type d -prune \) -o \
\( -name 'it' -type d -prune \) -o \
-o \( -name 'blivet.mo' -print \) )"
if [ -n "$molist" ]; then
echo "*** unrequested .mo files were installed" >> /root/RESULT
fi
# Check that the requested locales were installed
localedef --list-archive | grep -a -q '^es_'
if [ $? != 0 ]; then
echo "*** es locales were not installed" >> /root/RESULT
fi
localedef --list-archive | grep -a -q '^fr_'
if [ $? != 0 ]; then
echo "*** fr locales were not installed" >> /root/RESULT
fi
localedef --list-archive | grep -a -q '^it_'
if [ $? != 0 ]; then
echo "*** it locales were not installed" >> /root/RESULT
fi
# Check that only the requested locales were installed
# Use grep -a to force text mode, since sometimes a character will end up in the
# output that makes grep think it's binary
other_locales="$(localedef --list-archive | grep -a -v -E '^(fr_|es_|it_|french|italian|spanish)')"
if [ -n "$other_locales" ]; then
echo "*** unrequested locales were installed" >> /root/RESULT
fi
if [ ! -f /root/RESULT ]; then
echo SUCCESS > /root/RESULT
fi
%end