From c507db8c9ad77577770134945e762739aab9a9fe Mon Sep 17 00:00:00 2001 From: Daniel Llewellyn Date: Sun, 24 Jan 2021 23:19:37 +0000 Subject: [PATCH] Update sommelier script * Strip everything after a `?` in the `INSTALL_URL` when computing the `INSTALL_EXE` to allow for URLs that include query-string parameters. --- scripts/sommelier | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/sommelier b/scripts/sommelier index 2dab66a..6ad99bd 100755 --- a/scripts/sommelier +++ b/scripts/sommelier @@ -120,6 +120,9 @@ install_app() { # Download installer if requested. if [[ -n "${INSTALL_URL:-}" ]]; then + # If we've been given an installer URL derive the filename + INSTALL_EXE="$(basename "${INSTALL_URL//\?*/}")" + wget "${INSTALL_URL}" -O "${TMPDIR}/${INSTALL_EXE}" 2>&1 | \ perl -p -e '$| = 1; s/^.* +([0-9]+%) +([0-9,.]+[GMKB]) +([0-9hms,.]+).*$/\1\n# Downloading... \2 (\3)/' | \ yad --progress --title="Downloading ${INSTALL_EXE}" --width=400 --center --no-buttons --auto-close --auto-kill --on-top --no-escape @@ -222,11 +225,6 @@ if [[ -z "${WINEDEBUG:-}" ]]; then export WINEDEBUG="-all" fi -# If we've been given and installer URL derive the filename -if [[ -n "${INSTALL_URL:-}" ]]; then - INSTALL_EXE="$(basename "${INSTALL_URL}")" -fi - ########################### # Wine platform selection #