forked from jfx2006/thunderbird-braindump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ck_bouncer_tb_nightly.sh
executable file
·97 lines (80 loc) · 2.08 KB
/
ck_bouncer_tb_nightly.sh
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
source_libjfxbash="source $(dirname $0)/libjfxbash"
${source_libjfxbash}
EXPECTED="107.0a1"
ALL_PRODUCT=("Thunderbird-nightly-latest"
"Thunderbird-nightly-latest-SSL"
"Thunderbird-nightly-latest-l10n"
"Thunderbird-nightly-latest-l10n-ssl")
WIN_PRODUCT=("Thunderbird-nightly-msi-latest-SSL"
"Thunderbird-nightly-msi-latest-l10n-SSL")
OSX_PRODUCT=("Thunderbird-nightly-pkg-latest-SSL"
"Thunderbird-nightly-pkg-latest-l10n-SSL")
PLAT_LINUX=("linux" "linux64")
PLAT_WIN=("win" "win64")
PLAT_OSX=("osx")
build_url() {
_product="$1"
_platform="$2"
_lang="en-US"
_url="https://download.mozilla.org/?product=${_product}&os=${_platform}&lang=${_lang}"
echo $_url
}
get_version() {
sed -e 's/.*thunderbird-//' -e 's/\.en-US..*$//'
}
ck_version() {
_expected="$1"
_url="$2"
_version=$(curl -s "${_url}" | get_version)
if [[ "${_version}" != "${_expected}" ]]; then
echo "${_version}"
return 1
fi
return 0
}
ck_exists() {
_url="$1"
if ! curl -s -I -L -f "${_url}"; then
print_RED "FAIL! ${_url}"
fi
}
for p in ${ALL_PRODUCT[*]}; do
for o in ${PLAT_LINUX[*]} ${PLAT_WIN[*]} ${PLAT_OSX[*]}; do
_p_url=$(build_url $p $o)
echo "Checking ${p} ${o}..."
ck_exists "${_p_url}"
# if ! v=$(ck_version "${EXPECTED}" "${_p_url}"); then
# print_RED "FAIL: ${p}-${o} ${v} is not ${EXPECTED}"
# else
# print_GREEN "OK!"
# fi
echo ""
done
done
for p in ${WIN_PRODUCT[*]}; do
for o in ${PLAT_WIN[*]}; do
_p_url=$(build_url $p $o)
echo "Checking ${p} ${o}..."
ck_exists "${_p_url}"
# if ! v=$(ck_version "${EXPECTED}" "${_p_url}"); then
# print_RED "FAIL: ${p}-${o} is not ${EXPECTED}"
# else
# print_GREEN "OK!"
# fi
echo ""
done
done
for p in ${OSX_PRODUCT[*]}; do
for o in ${PLAT_OSX[*]}; do
_p_url=$(build_url $p $o)
echo "Checking ${p} ${o}..."
ck_exists "${_p_url}"
# if ! v=$(ck_version "${EXPECTED}" "${_p_url}"); then
# print_RED "FAIL: ${p}-${o} is not ${EXPECTED}"
# else
# print_GREEN "OK!"
# fi
# echo ""
done
done