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

wrap: Add PRESSURE_VESSEL_RUNTIME, which can force use of a runtime


Allow --runtime="", to force not using a runtime, ignoring the
environment variable.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 60e64390
No related branches found
No related tags found
No related merge requests found
......@@ -262,9 +262,9 @@ class Gui:
id = self.runtime_combo.get_active_id()
if id is None:
pass
argv.append('--runtime=')
elif id == '/':
pass
argv.append('--runtime=')
else:
argv.append('--runtime')
argv.append(os.path.join(id, 'files'))
......
......@@ -29,12 +29,12 @@
set -e
set -o pipefail
set -u
shopt -s nullglob
me="$(readlink -f "$0")"
here="${me%/*}"
me="${me##*/}"
exec "$here/pressure-vessel-unruntime" --runtime "${here}/../../scout/files" "$@"
export PRESSURE_VESSEL_RUNTIME="${here}/../../scout/files"
exec "$here/pressure-vessel-unruntime" "$@"
# vim:set sw=4 sts=4 et:
......@@ -1641,7 +1641,8 @@ static GOptionEntry options[] =
"MODULE" },
{ "runtime", 0, 0, G_OPTION_ARG_FILENAME, &opt_runtime,
"Mount the given sysroot or merged /usr in the container, and augment "
"it with the host system's graphics stack.",
"it with the host system's graphics stack. The empty string "
"means don't use a runtime. [Default: $PRESSURE_VESSEL_RUNTIME or '']",
"RUNTIME" },
{ "share-home", 0, 0, G_OPTION_ARG_NONE, &opt_share_home,
"Use the real home directory. [Default]", NULL },
......@@ -1742,6 +1743,9 @@ main (int argc,
if (!g_option_context_parse (context, &argc, &argv, error))
goto out;
if (opt_runtime == NULL)
opt_runtime = g_strdup (g_getenv ("PRESSURE_VESSEL_RUNTIME"));
if (opt_version)
{
g_print ("pressure-vessel version %s\n", VERSION);
......@@ -2015,7 +2019,7 @@ main (int argc,
if (!opt_tty)
flatpak_bwrap_add_arg (bwrap, "--new-session");
if (opt_runtime != NULL)
if (opt_runtime != NULL && opt_runtime[0] != '\0')
{
g_debug ("Configuring runtime...");
......@@ -2110,6 +2114,7 @@ main (int argc,
if (g_file_test (preload, G_FILE_TEST_EXISTS))
{
if (opt_runtime != NULL
&& opt_runtime[0] != '\0'
&& (g_str_has_prefix (preload, "/usr/")
|| g_str_has_prefix (preload, "/lib")))
{
......@@ -2178,7 +2183,7 @@ main (int argc,
/* Put Steam Runtime environment variables back, if /usr is mounted
* from the host. */
if (opt_runtime == NULL)
if (opt_runtime == NULL && opt_runtime[0] != '\0')
{
g_debug ("Making Steam Runtime available...");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment