From 9131317c715277c526cd7ace74bc5abdf8e7d7bd Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 15 Jan 2025 10:14:35 +0100 Subject: [PATCH 1/3] Remove obsolete file check on absolute path of wine executable The additional check as to whether the absolute path of wine is a file is superfluous, as the executability is checked beforehand. --- src/winetricks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winetricks b/src/winetricks index 3f3014a1d..2fb8d7f19 100755 --- a/src/winetricks +++ b/src/winetricks @@ -4873,7 +4873,7 @@ winetricks_wine_setup() WINETRICKS_ORIGINAL_WINEPREFIX="${HOME}/.wine" fi _abswine="$(command -v "${WINE}" 2>/dev/null)" - if ! test -x "${_abswine}" || ! test -f "${_abswine}"; then + if ! test -x "${_abswine}"; then w_die "WINE is ${WINE}, which is neither on the path nor an executable file" fi unset _abswine From ab80d859be95eda4f960e37fb7c7cd0167d751c7 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 13 Jan 2025 14:21:06 +0100 Subject: [PATCH 2/3] Setup internal used environment variable WINE with absolute wine path In the error or verbosity case this helps to see the actual wine executable used. Closes: #2319 --- src/winetricks | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/winetricks b/src/winetricks index 2fb8d7f19..b6ee3c692 100755 --- a/src/winetricks +++ b/src/winetricks @@ -4873,7 +4873,10 @@ winetricks_wine_setup() WINETRICKS_ORIGINAL_WINEPREFIX="${HOME}/.wine" fi _abswine="$(command -v "${WINE}" 2>/dev/null)" - if ! test -x "${_abswine}"; then + if test -x "${_abswine}"; then + WINE=${_abswine} + export WINE + else w_die "WINE is ${WINE}, which is neither on the path nor an executable file" fi unset _abswine From d9eb6a05821b8cfcc5105b3286968ae48d05b39f Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 15 Jan 2025 10:14:35 +0100 Subject: [PATCH 3/3] Setup environment variable WINE_BIN as an additional alternative for WINE --- src/winetricks | 9 +++------ src/winetricks.1 | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/winetricks b/src/winetricks index b6ee3c692..c7975c2b6 100755 --- a/src/winetricks +++ b/src/winetricks @@ -4442,10 +4442,7 @@ winetricks_set_wineprefix() w_warn "Unknown file arch of ${WINESERVER_BIN}." fi - if [ -z "${WINE_BIN}" ]; then - WINE_BIN="$(command -v "${WINE}")" - fi - _W_wine_binary_arch="$(winetricks_get_file_arch "${WINE_BIN}")" + _W_wine_binary_arch="$(winetricks_get_file_arch "${WINE}")" if [ -z "${_W_wine_binary_arch}" ]; then # wine might be a script calling a binary in Wine's bindir. if [ -z "${WINE_BINDIR}" ] && [ -x "${WINEBOOT_BIN}" ]; then @@ -4456,7 +4453,7 @@ winetricks_set_wineprefix() fi fi if [ -z "${_W_wine_binary_arch}" ]; then - w_warn "Unknown file arch of ${WINE_BIN}." + w_warn "Unknown file arch of ${WINE}." fi # determine wow64 type (new/old) @@ -4826,7 +4823,7 @@ winetricks_wine_setup() W_DRIVE_C="C:/" ;; *) - WINE="${WINE:-wine}" + WINE=${WINE:-${WINE_BIN:-wine}} # Find wineserver. # Some distributions (Debian before wine 1.8-2) don't have it on the path. for x in \ diff --git a/src/winetricks.1 b/src/winetricks.1 index 7055efe2a..e8864f130 100644 --- a/src/winetricks.1 +++ b/src/winetricks.1 @@ -159,7 +159,7 @@ winetricks 7zip .SH ENVIRONMENT VARIABLES Wine checks several environment variables on startup: .TP -.I WINE +.I WINE, WINE_BIN If set, this specifies which wine binary to use by default .TP .I WINESERVER