Skip to content
Snippets Groups Projects
Commit 6df5c7c3 authored by Simon McVittie's avatar Simon McVittie
Browse files

wrap: Add pressure-vessel's bin directory to PATH


In particular you can place a custom bwrap here for testing.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent b6c4cfb4
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,8 @@ me="$(readlink -f "$0")" ...@@ -35,6 +35,8 @@ me="$(readlink -f "$0")"
here="${me%/*}" here="${me%/*}"
me="${me##*/}" me="${me##*/}"
default_path="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
# Undo any weird environment before we start running external # Undo any weird environment before we start running external
# executables. We put it back before running the actual app/game. # executables. We put it back before running the actual app/game.
...@@ -53,12 +55,11 @@ if { [ -n "${LD_LIBRARY_PATH-}" ] && \ ...@@ -53,12 +55,11 @@ if { [ -n "${LD_LIBRARY_PATH-}" ] && \
fi fi
caller_path="${PATH:-"${default_path}"}" caller_path="${PATH:-"${default_path}"}"
default_path="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
if [ -n "${SYSTEM_PATH-}" ]; then if [ -n "${SYSTEM_PATH-}" ]; then
export PATH="$SYSTEM_PATH" export PATH="$here:$SYSTEM_PATH"
else else
export PATH="$default_path" export PATH="$here:$default_path"
fi fi
if [ -n "$caller_ld_preload" ]; then if [ -n "$caller_ld_preload" ]; then
...@@ -259,6 +260,8 @@ if [ -z "$BWRAP" ] || ! "$BWRAP" --bind / / true; then ...@@ -259,6 +260,8 @@ if [ -z "$BWRAP" ] || ! "$BWRAP" --bind / / true; then
fi fi
if [ -n "$path" ]; then if [ -n "$path" ]; then
export PATH="$path" export PATH="$path"
else
export PATH="$default_path"
fi fi
if [ -n "$ld_library_path" ]; then if [ -n "$ld_library_path" ]; then
export LD_LIBRARY_PATH="$ld_library_path" export LD_LIBRARY_PATH="$ld_library_path"
...@@ -732,6 +735,8 @@ else ...@@ -732,6 +735,8 @@ else
fi fi
if [ -n "$path" ]; then if [ -n "$path" ]; then
bwrap_options+=(--setenv PATH "$path") bwrap_options+=(--setenv PATH "$path")
else
bwrap_options+=(--setenv PATH "$default_path")
fi fi
if "$BWRAP" --help | grep unshare-uts >/dev/null; then if "$BWRAP" --help | grep unshare-uts >/dev/null; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment