Hardcode GDB python module directory
authorAngus Lees <gus@debian.org>
Thu, 14 Jul 2022 11:17:39 +0000 (13:17 +0200)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Fri, 28 Jul 2023 11:44:06 +0000 (12:44 +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-gdb
src/etc/rust-gdbgui

index b950cea79edfeaef99761ae1ab76d5cee09cf974..5ec875258b420c446114193a635665939ce748f4 100755 (executable)
@@ -11,7 +11,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"
 
 # Run GDB with the additional arguments that load the pretty printers
index 9744913b686501d83f864bd1c5b2d8674f9cd913..613737dbefb7d8bb15d0918292efe11cd7137800 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"
 
 # Set the environment variable `RUST_GDB` to overwrite the call to a