From 266238170aeb29c3c2ba2ab60636f2f32980dbf6 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 10 May 2019 14:56:22 +0100
Subject: [PATCH] Use the C version of pressure-vessel-wrap by default

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 build-relocatable-install.py                    |  4 ++--
 meson.build                                     |  4 ++--
 pressure-vessel-test-ui                         | 11 ++++++-----
 pressure-vessel-unruntime                       |  4 ++--
 pressure-vessel-wrap => pressure-vessel-wrap.sh |  0
 t/relocatable-install.py                        |  4 ++--
 t/shellcheck.sh                                 |  2 ++
 7 files changed, 16 insertions(+), 13 deletions(-)
 rename pressure-vessel-wrap => pressure-vessel-wrap.sh (100%)

diff --git a/build-relocatable-install.py b/build-relocatable-install.py
index 67ce9f749..a06f0b050 100755
--- a/build-relocatable-install.py
+++ b/build-relocatable-install.py
@@ -93,10 +93,10 @@ PRIMARY_ARCH_DEPENDENCIES = {
 SCRIPTS = [
     'pressure-vessel-test-ui',
     'pressure-vessel-unruntime',
-    'pressure-vessel-wrap'
+    'pressure-vessel-wrap.sh'
 ]
 EXECUTABLES = [
-    'pressure-vessel-wrap-c'
+    'pressure-vessel-wrap'
 ]
 TOOLS = [
     'capsule-capture-libs',
diff --git a/meson.build b/meson.build
index c3b077f98..70f833b9e 100644
--- a/meson.build
+++ b/meson.build
@@ -39,7 +39,7 @@ if version == 'auto'
 endif
 
 scripts = [
-  'pressure-vessel-wrap',
+  'pressure-vessel-wrap.sh',
   'pressure-vessel-test-ui',
   'pressure-vessel-unruntime',
 ]
@@ -201,7 +201,7 @@ configure_file(
 )
 
 executable(
-  'pressure-vessel-wrap-c',
+  'pressure-vessel-wrap',
   sources : [
     'src/glib-backports.c',
     'src/glib-backports.h',
diff --git a/pressure-vessel-test-ui b/pressure-vessel-test-ui
index f86b4dd04..6d5cf521d 100755
--- a/pressure-vessel-test-ui
+++ b/pressure-vessel-test-ui
@@ -73,10 +73,11 @@ class Gui:
 
         row += 1
 
-        self.native_check = Gtk.CheckButton.new_with_label(
-            'Use native-code version of pressure-vessel-wrap'
+        self.script_check = Gtk.CheckButton.new_with_label(
+            'Use old shell script version of pressure-vessel-wrap'
         )
-        self.grid.attach(self.native_check, 1, row, 1, 1)
+        self.script_check.set_active(False)
+        self.grid.attach(self.script_check, 1, row, 1, 1)
 
         row += 1
 
@@ -114,8 +115,8 @@ class Gui:
 
     def run_cb(self, _ignored=None):
 
-        if self.native_check.get_active():
-            wrap = 'pressure-vessel-wrap-c'
+        if self.script_check.get_active():
+            wrap = 'pressure-vessel-wrap.sh'
         else:
             wrap = 'pressure-vessel-wrap'
 
diff --git a/pressure-vessel-unruntime b/pressure-vessel-unruntime
index 4c3556d45..d8ee9b715 100755
--- a/pressure-vessel-unruntime
+++ b/pressure-vessel-unruntime
@@ -100,8 +100,8 @@ if [ -n "${PRESSURE_VESSEL_WRAP_GUI+set}" ]; then
     exec "${here}/pressure-vessel-test-ui" ${options+"${options[@]}"} "$@"
 fi
 
-if [ -n "${PRESSURE_VESSEL_WRAP_NATIVE+set}" ]; then
-    exec "${here}/pressure-vessel-wrap-c" ${options+"${options[@]}"} "$@"
+if [ -n "${PRESSURE_VESSEL_WRAP_SHELL+set}" ]; then
+    exec "${here}/pressure-vessel-wrap.sh" ${options+"${options[@]}"} "$@"
 fi
 
 exec "$here/pressure-vessel-wrap" ${options+"${options[@]}"} "$@"
diff --git a/pressure-vessel-wrap b/pressure-vessel-wrap.sh
similarity index 100%
rename from pressure-vessel-wrap
rename to pressure-vessel-wrap.sh
diff --git a/t/relocatable-install.py b/t/relocatable-install.py
index 118b13dc5..3f122c31c 100755
--- a/t/relocatable-install.py
+++ b/t/relocatable-install.py
@@ -77,7 +77,7 @@ class TapTest:
 
 
 EXES = [
-    'pressure-vessel-wrap-c',
+    'pressure-vessel-wrap',
 ]
 WRAPPED = [
     'bwrap',
@@ -88,7 +88,7 @@ MULTIARCH = [
 ]
 SCRIPTS = [
     'pressure-vessel-unruntime',
-    'pressure-vessel-wrap',
+    'pressure-vessel-wrap.sh',
 ]
 LD_SO = [
     ('x86_64-linux-gnu', '/lib64/ld-linux-x86-64.so.2'),
diff --git a/t/shellcheck.sh b/t/shellcheck.sh
index f5e72ef97..2c25da90e 100755
--- a/t/shellcheck.sh
+++ b/t/shellcheck.sh
@@ -37,6 +37,8 @@ cd "$G_TEST_SRCDIR"
 n=0
 for shell_script in \
         *.sh \
+        pressure-vessel-unruntime \
+        pressure-vessel-unruntime-test-ui \
         sysroot/*.sh \
         t/*.sh \
         ; do
-- 
GitLab