Skip to content

Commit 965bb20

Browse files
authored
Merge pull request #8542 from eder-matheus/bison_mirror
etc: try different mirrors for bison
2 parents 4c9b096 + bd48faa commit 965bb20

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

etc/DependencyInstaller.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,31 @@ _installCommonDev() {
109109
fi
110110
if [ ${bisonInstalledVersion} != ${bisonVersion} ]; then
111111
cd "${baseDir}"
112-
eval wget https://ftp.gnu.org/gnu/bison/bison-${bisonVersion}.tar.gz
112+
113+
mirrors=(
114+
"https://ftp.gnu.org/gnu/bison"
115+
"https://ftpmirror.gnu.org/bison"
116+
"https://mirrors.kernel.org/gnu/bison"
117+
"https://mirrors.dotsrc.org/gnu/bison"
118+
)
119+
120+
success=0
121+
for mirror in "${mirrors[@]}"; do
122+
url="${mirror}/bison-${bisonVersion}.tar.gz"
123+
echo "Trying to download bison from: $url"
124+
if wget "$url"; then
125+
success=1
126+
break
127+
else
128+
echo "Failed to download from $mirror"
129+
fi
130+
done
131+
132+
if [ $success -ne 1 ]; then
133+
echo "Error: could not download bison-${bisonVersion}.tar.gz from any mirror."
134+
exit 1
135+
fi
136+
113137
md5sum -c <(echo "${bisonChecksum} bison-${bisonVersion}.tar.gz") || exit 1
114138
tar xf bison-${bisonVersion}.tar.gz
115139
cd bison-${bisonVersion}

0 commit comments

Comments
 (0)