Skip to content

Commit

Permalink
build-aria2: exit only on cd fail
Browse files Browse the repository at this point in the history
Having no idea why ci fails.
  • Loading branch information
myfreeer committed Dec 13, 2020
1 parent bd62a3d commit 25c33a5
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions build-aria2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!bash
set -e
case $MSYSTEM in
MINGW32)
export MINGW_PACKAGE_PREFIX=mingw-w64-i686
Expand All @@ -21,10 +20,8 @@ if [[ "${GIT_USER_EMAIL}" = "" ]]; then
git config --global user.email "[email protected]"
fi

set +e
pacman -S --noconfirm --needed $MINGW_PACKAGE_PREFIX-gcc \
$MINGW_PACKAGE_PREFIX-winpthreads
set -e

PREFIX=/usr/local/$HOST
CPUCOUNT=$(grep -c ^processor /proc/cpuinfo)
Expand Down Expand Up @@ -54,14 +51,12 @@ get_last_version() {
}

# expat
set +e
expat_ver="$(clean_html_index https://sourceforge.net/projects/expat/files/expat/ 'expat/[0-9]+\.[0-9]+\.[0-9]+')"
expat_ver="$(get_last_version "${expat_ver}" expat '2\.\d+\.\d+')"
expat_ver="${expat_ver:-2.2.10}"
set -e
wget -c --no-check-certificate "https://downloads.sourceforge.net/project/expat/expat/${expat_ver}/expat-${expat_ver}.tar.bz2"
tar xf "expat-${expat_ver}.tar.bz2"
cd "expat-${expat_ver}"
cd "expat-${expat_ver}" || exit 1
./configure \
--disable-shared \
--enable-static \
Expand All @@ -72,16 +67,14 @@ cd ..
rm -rf "expat-${expat_ver}"

# sqlite
set +e
sqlite_ver=$(clean_html_index_sqlite "https://www.sqlite.org/download.html")
[[ ! "$sqlite_ver" ]] && sqlite_ver="2020/sqlite-autoconf-3340000.tar.gz"
sqlite_file=$(echo ${sqlite_ver} | grep -ioP "(sqlite-autoconf-\d+\.tar\.gz)")
wget -c --no-check-certificate "https://www.sqlite.org/${sqlite_ver}"
set -e
tar xf "${sqlite_file}"
echo ${sqlite_ver}
sqlite_name=$(echo ${sqlite_ver} | grep -ioP "(sqlite-autoconf-\d+)")
cd "${sqlite_name}"
cd "${sqlite_name}" || exit 1
./configure \
--disable-shared \
--enable-static \
Expand All @@ -92,16 +85,14 @@ cd ..
rm -rf "${sqlite_name}"

# c-ares: Async DNS support
set +e
[[ ! "$cares_ver" ]] &&
cares_ver="$(clean_html_index https://c-ares.haxx.se/)" &&
cares_ver="$(get_last_version "$cares_ver" c-ares "1\.\d+\.\d")"
cares_ver="${cares_ver:-1.17.1}"
set -e
echo "c-ares-${cares_ver}"
wget -c --no-check-certificate "https://c-ares.haxx.se/download/c-ares-${cares_ver}.tar.gz"
tar xf "c-ares-${cares_ver}.tar.gz"
cd "c-ares-${cares_ver}"
cd "c-ares-${cares_ver}" || exit 1
# https://github.com/c-ares/c-ares/issues/384
# https://github.com/c-ares/c-ares/commit/c35f8ff50710cd38776e9560389504dbd96307fa
if [ "${cares_ver}" = "1.17.1" ]; then
Expand All @@ -120,12 +111,10 @@ cd ..
rm -rf "c-ares-${cares_ver}"

# libssh2
set +e
[[ ! "$ssh_ver" ]] &&
ssh_ver="$(clean_html_index https://libssh2.org/download/)" &&
ssh_ver="$(get_last_version "$ssh_ver" tar.gz "1\.\d+\.\d")"
ssh_ver="${ssh_ver:-1.9.0}"
set -e
echo "${ssh_ver}"
wget -c --no-check-certificate "https://libssh2.org/download/libssh2-${ssh_ver}.tar.gz"
tar xf "libssh2-${ssh_ver}.tar.gz"
Expand All @@ -146,16 +135,14 @@ make install -j$CPUCOUNT
cd ..
rm -rf "libssh2-${ssh_ver}"

set +e

if [[ -d aria2 ]]; then
cd aria2
git checkout master || git checkout HEAD
git reset --hard origin || git reset --hard
git pull
else
git clone https://github.com/aria2/aria2 --depth=1 --config http.sslVerify=false
cd aria2
cd aria2 || exit 1
fi
git checkout -b patch
git am -3 ../aria2-*.patch
Expand Down

0 comments on commit 25c33a5

Please sign in to comment.