[pitivi/sdk: 6/7] build: Handle missing ~/.bashrc when entering sandbox
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/sdk: 6/7] build: Handle missing ~/.bashrc when entering sandbox
- Date: Sat, 16 Nov 2019 21:30:26 +0000 (UTC)
commit f979431125e80c7be266bbbff0d32320738d48e9
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Thu Nov 7 23:32:59 2019 +0100
build: Handle missing ~/.bashrc when entering sandbox
build/flatpak/enter-env | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/build/flatpak/enter-env b/build/flatpak/enter-env
index 07f6006e..19ebbb05 100755
--- a/build/flatpak/enter-env
+++ b/build/flatpak/enter-env
@@ -1,21 +1,27 @@
#!/bin/sh
-PITIVI_DIR=$(realpath $(dirname $0)/../../)
-
-function generate_path_and_completion_calls {
- echo "export PATH=$PITIVI_DIR/bin/:/app/bin/:/usr/bin/:\$PATH"
-}
+PITIVI_DIR=$(realpath "$(dirname $0)"/../../)
RCFILE=$PITIVI_DIR/.bashrc
-cp ~/.bashrc $RCFILE
+(
+ cat ~/.bashrc 2>/dev/null
+
+ echo "export PS1=[ptv]\ \$PS1"
-echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/lib/" >> $RCFILE
-echo "export PS1=[ptv]\ \$PS1" >> $RCFILE
-generate_path_and_completion_calls >> $RCFILE
+ # Override LD_LIBRARY_PATH with the current value
+ # set by flatpak build.
+ echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+ echo "echo LD_LIBRARY_PATH=\$LD_LIBRARY_PATH"
+
+ # Override PATH so our bin/pitivi can be found.
+ echo "export PATH=$PITIVI_DIR/bin/:/app/bin/:/usr/bin/:\$PATH"
+ echo "echo PATH=\$PATH"
+) > $RCFILE
echo "=============================="
-echo "Entering own built environment"
+echo "Launching bash in the sandbox "
echo "=============================="
+# The Gnome SDK only has bash.
bash --rcfile $RCFILE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]