From 014d505329b9fbefa04efe4cc2d46dd544eb206a Mon Sep 17 00:00:00 2001 From: Brenton Horne Date: Thu, 26 Jul 2018 22:52:39 +1000 Subject: [PATCH] Add wget support to Linux fetch and build scripts. --- fetch-engine.sh | 8 ++++++-- packaging/linux/buildpackage.sh | 12 ++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fetch-engine.sh b/fetch-engine.sh index c7ae4f3..e49866b 100755 --- a/fetch-engine.sh +++ b/fetch-engine.sh @@ -2,7 +2,7 @@ # Helper script used to check and update engine dependencies # This should not be called manually -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } require_variables() { @@ -52,7 +52,11 @@ if [ "${AUTOMATIC_ENGINE_MANAGEMENT}" = "True" ]; then fi echo "Downloading engine..." - curl -s -L -o "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" -O "${AUTOMATIC_ENGINE_SOURCE}" || exit 3 + if command -v curl > /dev/null 2>&1; then + curl -s -L -o "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" -O "${AUTOMATIC_ENGINE_SOURCE}" || exit 3 + else + wget -cq "${AUTOMATIC_ENGINE_SOURCE}" -O "${AUTOMATIC_ENGINE_TEMP_ARCHIVE_NAME}" || exit 3 + fi # Github zipballs package code with a top level directory named based on the refspec # Extract to a temporary directory and then move the subdir to our target location diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 593d516..c2290bb 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -5,7 +5,7 @@ set -e command -v make >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires make."; exit 1; } command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } command -v tar >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires tar."; exit 1; } -command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } +command -v curl >/dev/null 2>&1 || command -v wget > /dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl or wget."; exit 1; } require_variables() { missing="" @@ -90,10 +90,14 @@ popd > /dev/null # Add native libraries echo "Downloading dependencies" -curl -s -L -o "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" || exit 3 +if command -v curl >/dev/null 2>&1; then + curl -s -L -o "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" || exit 3 + curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 +else + wget -cq "${PACKAGING_APPIMAGE_DEPENDENCIES_SOURCE}" -O "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" || exit 3 + wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 +fi tar xf "${PACKAGING_APPIMAGE_DEPENDENCIES_TEMP_ARCHIVE_NAME}" - -curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage chmod a+x appimagetool-x86_64.AppImage echo "Building AppImage"