Hardcode GDB python module directory
authorAngus Lees <gus@debian.org>
Thu, 14 Jul 2022 11:17:39 +0000 (13:17 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Mon, 15 Jan 2024 07:16:35 +0000 (08:16 +0100)
Forwarded: not-needed

Debian package installs python modules into a fixed directory, so
just hardcode path in wrapper script.

Gbp-Pq: Name d-rust-gdb-paths

src/etc/rust-gdbgui

index 913269316bd4c0c671f4ae49b7d096b546adf94b..02ac9ec210f3af0c6c025389b83037f27ba6061c 100755 (executable)
@@ -40,7 +40,7 @@ else
 fi
 
 # Find out where the pretty printer Python module is
-RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
+RUSTC_SYSROOT="$(if type "$RUSTC" >/dev/null 2>&1; then "$RUSTC" --print=sysroot; else echo /usr; fi)"
 GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
 # Get the commit hash for path remapping
 RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"