Skip to content

Commit

Permalink
fix: Remove unsupported curl option
Browse files Browse the repository at this point in the history
Removed `--retry-all-errors` from `build_hprefix.sh`. This option is only supported in very recent versions of `curl`.
  • Loading branch information
trungnt2910 authored Jun 12, 2024
1 parent 210688f commit 6a7ef2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build_hprefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fi

echo "Downloading Haiku packages"
read -ra array <<<"$HAIKU_SYSPACKAGES"
HAIKU_SYSPACKAGES_HREV=$(curl --retry $CURL_RETRY_COUNT --retry-all-errors -Ls $HAIKU_HPKG_BASE_URL | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')
HAIKU_SYSPACKAGES_HREV=$(curl --retry $CURL_RETRY_COUNT -Ls $HAIKU_HPKG_BASE_URL | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')
for package in "${array[@]}"; do
# Check if package already exists
if [ "$HPKG_FORCE" == "0" ] && [ -f "$HPREFIX_PACKAGES/$package-$HAIKU_SYSPACKAGES_HREV-1-$HAIKU_ARCH.hpkg" ]; then
Expand All @@ -137,7 +137,7 @@ for package in "${array[@]}"; do
rm -fv $HPREFIX_PACKAGES/$package-*-$HAIKU_ARCH.hpkg
fi
echo "Downloading $package-$HAIKU_SYSPACKAGES_HREV-1-$HAIKU_ARCH.hpkg"
curl --retry $CURL_RETRY_COUNT --retry-all-errors \
curl --retry $CURL_RETRY_COUNT \
-Lo "$HPREFIX_PACKAGES/$package-$HAIKU_SYSPACKAGES_HREV-1-$HAIKU_ARCH.hpkg" \
"$HAIKU_HPKG_BASE_URL/packages/$package-$HAIKU_SYSPACKAGES_HREV-1-$HAIKU_ARCH.hpkg"
fi
Expand All @@ -146,7 +146,7 @@ read -ra array <<<"$HAIKU_PACKAGES"
for package in "${array[@]}"; do
# API documented here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L60
# The schema here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L598
hpkgDownloadUrl="$(curl --retry $CURL_RETRY_COUNT --retry-all-errors -Ls --request POST \
hpkgDownloadUrl="$(curl --retry $CURL_RETRY_COUNT -Ls --request POST \
--data '{"name":"'"$package"'","repositorySourceCode":"haikuports_'$HAIKU_ARCH'","versionType":"LATEST","naturalLanguageCode":"en"}' \
--header 'Content-Type:application/json' "$HAIKU_DEPOT_BASE_URL" | sed -n 's/^.*hpkgDownloadURL":"\([^"]*\)".*$/\1/p')"
hpkgVersion="$(echo "$hpkgDownloadUrl" | sed -n 's/^.*\/[^\/]*-\([^-]*\-[^-]*\)-[^-]*\.hpkg$/\1/p')"
Expand All @@ -158,7 +158,7 @@ for package in "${array[@]}"; do
rm -fv $HPREFIX_PACKAGES/$package-*-$HAIKU_ARCH.hpkg
fi
echo "Downloading $package-$hpkgVersion-$HAIKU_ARCH.hpkg"
curl --retry $CURL_RETRY_COUNT --retry-all-errors \
curl --retry $CURL_RETRY_COUNT \
-Lo "$HPREFIX_PACKAGES/$package-$hpkgVersion-$HAIKU_ARCH.hpkg" "$hpkgDownloadUrl"
fi
done
Expand Down

0 comments on commit 6a7ef2f

Please sign in to comment.