Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ced-Edition into v4_5_x
  • Loading branch information
c0re100 committed Feb 28, 2023
2 parents 6a591a8 + 18c0e09 commit 76478c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,34 @@ echo -e 'Acquire::https::Verify-Peer "false";\nAcquire::https::Verify-Host "fals
# Since cmake 3.23.0 CMAKE_INSTALL_LIBDIR will force set to lib/<multiarch-tuple> on Debian
echo '/usr/local/lib/x86_64-linux-gnu' >/etc/ld.so.conf.d/x86_64-linux-gnu-local.conf

apt update
apt install -y software-properties-common apt-transport-https
apt-add-repository -yn ppa:savoury1/backports
add-apt-repository -yn ppa:savoury1/display
retry() {
# max retry 5 times
try=5
# sleep 1 min every retry
sleep_time=60
for i in $(seq ${try}); do
echo "executing with retry: $@" >&2
if eval "$@"; then
return 0
else
echo "execute '$@' failed, tries: ${i}" >&2
sleep ${sleep_time}
fi
done
echo "execute '$@' failed" >&2
return 1
}

retry apt update
retry apt install -y software-properties-common apt-transport-https
retry apt-add-repository -yn ppa:savoury1/backports

if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
sed -i 's@http://ppa.launchpad.net@https://launchpad.proxy.ustclug.org@' /etc/apt/sources.list.d/*.list
fi

apt update
apt install -y \
retry apt update
retry apt install -y \
curl \
git \
unzip \
Expand Down Expand Up @@ -99,24 +116,6 @@ export CXXFLAGS='-s'
ldconfig
SELF_DIR="$(dirname "$(readlink -f "${0}")")"

retry() {
# max retry 5 times
try=5
# sleep 3s every retry
sleep_time=3
for i in $(seq ${try}); do
echo "executing with retry: $@" >&2
if eval "$@"; then
return 0
else
echo "execute '$@' failed, tries: ${i}" >&2
sleep ${sleep_time}
fi
done
echo "execute '$@' failed" >&2
return 1
}

# join array to string. E.g join_by ',' "${arr[@]}"
join_by() {
local separator="$1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cross_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ mkdir -p "/usr/src"
retry() {
# max retry 5 times
try=5
# sleep 3s every retry
sleep_time=3
# sleep 1 min every retry
sleep_time=60
for i in $(seq ${try}); do
echo "executing with retry: $@" >&2
if eval "$@"; then
Expand Down

0 comments on commit 76478c4

Please sign in to comment.