From fb54370a7e97193067bf146b344661d8a5e2f846 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Mon, 10 Feb 2025 22:41:55 +0100 Subject: [PATCH] Patch which appimagetool --- python_appimage/commands/which.py | 5 ++++- python_appimage/utils/deps.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python_appimage/commands/which.py b/python_appimage/commands/which.py index 6e159e2..a1c189b 100644 --- a/python_appimage/commands/which.py +++ b/python_appimage/commands/which.py @@ -16,6 +16,9 @@ def _unpack_args(args): def execute(binary): '''Print the location of a binary dependency ''' - path = os.path.join(os.path.dirname(deps.PATCHELF), binary) + if binary == 'appimagetool': + path = deps.ensure_appimagetool(dry=True) + else: + path = os.path.join(os.path.dirname(deps.PATCHELF), binary) if os.path.exists(path): print(path) diff --git a/python_appimage/utils/deps.py b/python_appimage/utils/deps.py index e36e9b2..7b01357 100644 --- a/python_appimage/utils/deps.py +++ b/python_appimage/utils/deps.py @@ -31,7 +31,7 @@ EXCLUDELIST = PREFIX + '/data/excludelist' PATCHELF = os.path.expanduser('~/.local/bin/patchelf') '''Location of the PatchELF binary''' -def ensure_appimagetool(): +def ensure_appimagetool(dry=False): '''Fetch appimagetool from the web if not available locally ''' @@ -44,7 +44,7 @@ def ensure_appimagetool(): appdir = os.path.join(APPIMAGETOOL_DIR, appdir_name) apprun = os.path.join(appdir, 'AppRun') - if os.path.exists(apprun): + if dry or os.path.exists(apprun): return apprun appimage = 'appimagetool-{0:}.AppImage'.format(_ARCH)