Skip to content

Commit ee57368

Browse files
committed
fix github actions build
1 parent f1ee78a commit ee57368

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Build/Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ RUN dnf -y module enable python39 && \
3030

3131
# Free Pascal 3.0.4
3232
RUN cd /opt && \
33-
curl -L -o fpc-3.0.4-1.x86_64.rpm 'https://sourceforge.net/projects/freepascal/files/Linux/3.0.4/fpc-3.0.4-1.x86_64.rpm/download' && \
33+
curl -L -H "Accept: */*" -H "Accept-Language: en-US,en;q=0.9" \
34+
-H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" \
35+
-o fpc-3.0.4-1.x86_64.rpm \
36+
'https://sourceforge.net/projects/freepascal/files/Linux/3.0.4/fpc-3.0.4-1.x86_64.rpm/download' && \
37+
FILE_SIZE=$(stat -c%s fpc-3.0.4-1.x86_64.rpm 2>/dev/null || echo 0) && \
38+
if [ "$FILE_SIZE" -lt 1000000 ]; then \
39+
echo "Downloaded file too small ($FILE_SIZE bytes), trying alternative URL..."; \
40+
rm -f fpc-3.0.4-1.x86_64.rpm; \
41+
curl -L -f -o fpc-3.0.4-1.x86_64.rpm 'http://downloads.sourceforge.net/project/freepascal/Linux/3.0.4/fpc-3.0.4-1.x86_64.rpm'; \
42+
fi && \
43+
[ $(stat -c%s fpc-3.0.4-1.x86_64.rpm) -gt 1000000 ] && \
3444
rpm -i fpc-3.0.4-1.x86_64.rpm && \
3545
rm -f fpc-3.0.4-1.x86_64.rpm
3646

0 commit comments

Comments
 (0)