Hardcode GDB python module directory
authorAngus Lees <gus@debian.org>
Fri, 19 Nov 2021 21:58:46 +0000 (21:58 +0000)
committerRoberto C. Sánchez <roberto@debian.org>
Fri, 19 Nov 2021 21:58:46 +0000 (21:58 +0000)
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..5c0908d7a926b376a2b096f8d1363bc8c552577f 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" 2>/dev/null; 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..daaa21802fcda3c51b48e8823a69b5ef4de53267 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" 2>/dev/null; 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