summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Weber2020-10-29 22:59:10 +0100
committerPeter Weber2020-10-29 22:59:10 +0100
commit2561647d55a566b460fbc9a19270b555b136ed10 (patch)
treebda372d05f573bce7f4a35a071fb3f770c88e944
parentfbec43431c2b8c1e7bb37be8bf70b9218e1de5f4 (diff)
downloadaur-gnome-terminal-transparency.tar.gz
environment fixes
-rw-r--r--.SRCINFO8
-rw-r--r--0001-screen-Manually-handle-env-inheritance.patch66
-rw-r--r--0002-screen-Move-env-sanitization-from-client.patch107
-rw-r--r--0003-screen-Ignore-some-more-environment-variables.patch26
-rw-r--r--PKGBUILD17
-rw-r--r--package.changelog4
6 files changed, 224 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 15f047d3780..c11438e4bbd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = gnome-terminal-transparency
pkgdesc = The GNOME Terminal Emulator with background transparency
pkgver = 3.38.1
- pkgrel = 1
+ pkgrel = 2
url = https://wiki.gnome.org/Apps/Terminal
changelog = package.changelog
arch = x86_64
@@ -20,8 +20,14 @@ pkgbase = gnome-terminal-transparency
conflicts = gnome-terminal
source = https://download.gnome.org/sources/gnome-terminal/3.38/gnome-terminal-3.38.1.tar.xz
source = transparency.patch
+ source = 0001-screen-Manually-handle-env-inheritance.patch
+ source = 0002-screen-Move-env-sanitization-from-client.patch
+ source = 0003-screen-Ignore-some-more-environment-variables.patch
sha256sums = d998d4824f38847fdd74bad6b5f09cc8e11b9de8e2a284a439af290714ddf3d1
sha256sums = 106d36537c621d1b0d4a9a541ee307ace593e005c322fd3622fc64c2f54f70ba
+ sha256sums = 9517a7be3c8debdd7c57390e3c62eb8395daf9b9949614023e385cc8cd91b1e4
+ sha256sums = c48fe6060b852e136fee7b94b42fce5c8b9ac201720083d0b3edfc22cacdd285
+ sha256sums = dc80adeee3d1106d6e814c2799a58e1bf4900c967aa7b3ca603f393b5abfcde7
pkgname = gnome-terminal-transparency
diff --git a/0001-screen-Manually-handle-env-inheritance.patch b/0001-screen-Manually-handle-env-inheritance.patch
new file mode 100644
index 00000000000..2443571f5aa
--- /dev/null
+++ b/0001-screen-Manually-handle-env-inheritance.patch
@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Tue, 27 Oct 2020 19:50:30 +0000
+Subject: [PATCH] screen: Manually handle env inheritance
+
+Don't let VTE handle merging the environment; build the merged block
+ourselves. This avoids confusion when we reuse the exec data.
+
+https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/303
+---
+ src/terminal-screen.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/terminal-screen.c b/src/terminal-screen.c
+index 844b563c..2442a49d 100644
+--- a/src/terminal-screen.c
++++ b/src/terminal-screen.c
+@@ -942,9 +942,7 @@ terminal_screen_exec (TerminalScreen *screen,
+ &shell);
+
+ gboolean preserve_cwd = FALSE;
+- GSpawnFlags spawn_flags = G_SPAWN_SEARCH_PATH_FROM_ENVP;
+- if (initial_envv)
+- spawn_flags |= VTE_SPAWN_NO_PARENT_ENVV;
++ GSpawnFlags spawn_flags = G_SPAWN_SEARCH_PATH_FROM_ENVP | VTE_SPAWN_NO_PARENT_ENVV;
+ gs_strfreev char **exec_argv = NULL;
+ if (!terminal_screen_get_child_command (screen,
+ argv,
+@@ -1431,25 +1429,27 @@ terminal_screen_get_child_environment (TerminalScreen *screen,
+ {
+ TerminalApp *app = terminal_app_get ();
+ char **env;
++ gs_strfreev **current_environ = NULL;
+ char *e, *v;
+ GHashTable *env_table;
+ GHashTableIter iter;
+ GPtrArray *retval;
+ guint i;
+
+ env_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+- env = initial_envv;
+- if (env)
++ if (initial_envv)
++ env = initial_envv;
++ else
++ env = current_environ = g_get_environ ();
++
++ for (i = 0; env[i]; ++i)
+ {
+- for (i = 0; env[i]; ++i)
+- {
+- v = strchr (env[i], '=');
+- if (v)
+- g_hash_table_replace (env_table, g_strndup (env[i], v - env[i]), g_strdup (v + 1));
+- else
+- g_hash_table_replace (env_table, g_strdup (env[i]), NULL);
+- }
++ v = strchr (env[i], '=');
++ if (v)
++ g_hash_table_replace (env_table, g_strndup (env[i], v - env[i]), g_strdup (v + 1));
++ else
++ g_hash_table_replace (env_table, g_strdup (env[i]), NULL);
+ }
+
+ g_hash_table_remove (env_table, "COLUMNS");
diff --git a/0002-screen-Move-env-sanitization-from-client.patch b/0002-screen-Move-env-sanitization-from-client.patch
new file mode 100644
index 00000000000..778b4c71a0e
--- /dev/null
+++ b/0002-screen-Move-env-sanitization-from-client.patch
@@ -0,0 +1,107 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Tue, 27 Oct 2020 19:44:58 +0000
+Subject: [PATCH] screen: Move env sanitization from client
+
+We always want to sanitize the environment, even when we start with the
+server's environment instead of the client's one.
+
+https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/303
+---
+ src/terminal-client-utils.c | 31 -------------------------------
+ src/terminal-screen.c | 30 ++++++++++++++++++++++++++----
+ 2 files changed, 26 insertions(+), 35 deletions(-)
+
+diff --git a/src/terminal-client-utils.c b/src/terminal-client-utils.c
+index f7fb6a81..774e5f50 100644
+--- a/src/terminal-client-utils.c
++++ b/src/terminal-client-utils.c
+@@ -119,37 +119,6 @@ terminal_client_append_exec_options (GVariantBuilder *builder,
+ gs_strfreev char **envv;
+
+ envv = g_get_environ ();
+- envv = g_environ_unsetenv (envv, "COLORTERM");
+- envv = g_environ_unsetenv (envv, "COLUMNS");
+- envv = g_environ_unsetenv (envv, "DESKTOP_STARTUP_ID");
+- envv = g_environ_unsetenv (envv, "EXIT_CODE");
+- envv = g_environ_unsetenv (envv, "EXIT_STATUS");
+- envv = g_environ_unsetenv (envv, "GIO_LAUNCHED_DESKTOP_FILE");
+- envv = g_environ_unsetenv (envv, "GIO_LAUNCHED_DESKTOP_FILE_PID");
+- envv = g_environ_unsetenv (envv, "GNOME_DESKTOP_ICON");
+- envv = g_environ_unsetenv (envv, "INVOCATION_ID");
+- envv = g_environ_unsetenv (envv, "JOURNAL_STREAM");
+- envv = g_environ_unsetenv (envv, "LINES");
+- envv = g_environ_unsetenv (envv, "LISTEN_FDNAMES");
+- envv = g_environ_unsetenv (envv, "LISTEN_FDS");
+- envv = g_environ_unsetenv (envv, "LISTEN_PID");
+- envv = g_environ_unsetenv (envv, "MAINPID");
+- envv = g_environ_unsetenv (envv, "MANAGERPID");
+- envv = g_environ_unsetenv (envv, "NOTIFY_SOCKET");
+- envv = g_environ_unsetenv (envv, "NOTIFY_SOCKET");
+- envv = g_environ_unsetenv (envv, "PIDFILE");
+- envv = g_environ_unsetenv (envv, "PWD");
+- envv = g_environ_unsetenv (envv, "REMOTE_ADDR");
+- envv = g_environ_unsetenv (envv, "REMOTE_PORT");
+- envv = g_environ_unsetenv (envv, "SERVICE_RESULT");
+- envv = g_environ_unsetenv (envv, "TERM");
+- envv = g_environ_unsetenv (envv, "VTE_VERSION");
+- envv = g_environ_unsetenv (envv, "WATCHDOG_PID");
+- envv = g_environ_unsetenv (envv, "WATCHDOG_USEC");
+- envv = g_environ_unsetenv (envv, "WINDOWID");
+-
+- envv = g_environ_unsetenv (envv, TERMINAL_ENV_SERVICE_NAME);
+- envv = g_environ_unsetenv (envv, TERMINAL_ENV_SCREEN);
+
+ g_variant_builder_add (builder, "{sv}",
+ "environ",
+diff --git a/src/terminal-screen.c b/src/terminal-screen.c
+index 2442a49d..8abc59fd 100644
+--- a/src/terminal-screen.c
++++ b/src/terminal-screen.c
+@@ -959,10 +959,8 @@ terminal_screen_exec (TerminalScreen *screen,
+ return FALSE;
+ }
+
+- if (!preserve_cwd) {
++ if (!preserve_cwd)
+ cwd = g_get_home_dir ();
+- envv = g_environ_unsetenv (envv, "PWD");
+- }
+
+ data->fd_list = fd_list ? g_object_ref(fd_list) : NULL;
+
+@@ -1452,9 +1450,33 @@ terminal_screen_get_child_environment (TerminalScreen *screen,
+ g_hash_table_replace (env_table, g_strdup (env[i]), NULL);
+ }
+
++ g_hash_table_remove (env_table, "COLORTERM");
+ g_hash_table_remove (env_table, "COLUMNS");
+- g_hash_table_remove (env_table, "LINES");
++ g_hash_table_remove (env_table, "DESKTOP_STARTUP_ID");
++ g_hash_table_remove (env_table, "EXIT_CODE");
++ g_hash_table_remove (env_table, "EXIT_STATUS");
++ g_hash_table_remove (env_table, "GIO_LAUNCHED_DESKTOP_FILE");
++ g_hash_table_remove (env_table, "GIO_LAUNCHED_DESKTOP_FILE_PID");
+ g_hash_table_remove (env_table, "GNOME_DESKTOP_ICON");
++ g_hash_table_remove (env_table, "INVOCATION_ID");
++ g_hash_table_remove (env_table, "JOURNAL_STREAM");
++ g_hash_table_remove (env_table, "LINES");
++ g_hash_table_remove (env_table, "LISTEN_FDNAMES");
++ g_hash_table_remove (env_table, "LISTEN_FDS");
++ g_hash_table_remove (env_table, "LISTEN_PID");
++ g_hash_table_remove (env_table, "MAINPID");
++ g_hash_table_remove (env_table, "MANAGERPID");
++ g_hash_table_remove (env_table, "NOTIFY_SOCKET");
++ g_hash_table_remove (env_table, "NOTIFY_SOCKET");
++ g_hash_table_remove (env_table, "PIDFILE");
++ g_hash_table_remove (env_table, "PWD");
++ g_hash_table_remove (env_table, "REMOTE_ADDR");
++ g_hash_table_remove (env_table, "REMOTE_PORT");
++ g_hash_table_remove (env_table, "SERVICE_RESULT");
++ g_hash_table_remove (env_table, "TERM");
++ g_hash_table_remove (env_table, "VTE_VERSION");
++ g_hash_table_remove (env_table, "WATCHDOG_PID");
++ g_hash_table_remove (env_table, "WATCHDOG_USEC");
+
+ /* WINDOWID does not work correctly ever since we don't use a native
+ * GdkWindow anymore, and it also becomes incorrect if the screen is
diff --git a/0003-screen-Ignore-some-more-environment-variables.patch b/0003-screen-Ignore-some-more-environment-variables.patch
new file mode 100644
index 00000000000..8b0deabebfc
--- /dev/null
+++ b/0003-screen-Ignore-some-more-environment-variables.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Tue, 27 Oct 2020 20:16:39 +0000
+Subject: [PATCH] screen: Ignore some more environment variables
+
+- `GJS_DEBUG_OUTPUT` and `GJS_DEBUG_TOPICS` are set by GNOME Shell.
+- `G_ENABLE_DIAGNOSTIC` is set by GNOME Terminal itself.
+---
+ src/terminal-screen.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/terminal-screen.c b/src/terminal-screen.c
+index 8abc59fd..6e8c590d 100644
+--- a/src/terminal-screen.c
++++ b/src/terminal-screen.c
+@@ -1457,7 +1457,10 @@ terminal_screen_get_child_environment (TerminalScreen *screen,
+ g_hash_table_remove (env_table, "EXIT_STATUS");
+ g_hash_table_remove (env_table, "GIO_LAUNCHED_DESKTOP_FILE");
+ g_hash_table_remove (env_table, "GIO_LAUNCHED_DESKTOP_FILE_PID");
++ g_hash_table_remove (env_table, "GJS_DEBUG_OUTPUT");
++ g_hash_table_remove (env_table, "GJS_DEBUG_TOPICS");
+ g_hash_table_remove (env_table, "GNOME_DESKTOP_ICON");
++ g_hash_table_remove (env_table, "G_ENABLE_DIAGNOSTIC");
+ g_hash_table_remove (env_table, "INVOCATION_ID");
+ g_hash_table_remove (env_table, "JOURNAL_STREAM");
+ g_hash_table_remove (env_table, "LINES");
diff --git a/PKGBUILD b/PKGBUILD
index 5bd026906d7..5a561a4de4c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,7 +10,7 @@
pkgname=gnome-terminal-transparency
_pkgname=gnome-terminal
pkgver=3.38.1
-pkgrel=1
+pkgrel=2
pkgdesc="The GNOME Terminal Emulator with background transparency"
url="https://wiki.gnome.org/Apps/Terminal"
arch=(x86_64)
@@ -23,13 +23,24 @@ conflicts=("$_pkgname")
groups=(gnome)
changelog=package.changelog
source=(https://download.gnome.org/sources/$_pkgname/${pkgver:0:4}/$_pkgname-$pkgver.tar.xz
- transparency.patch)
+ transparency.patch
+ 0001-screen-Manually-handle-env-inheritance.patch
+ 0002-screen-Move-env-sanitization-from-client.patch
+ 0003-screen-Ignore-some-more-environment-variables.patch)
sha256sums=('d998d4824f38847fdd74bad6b5f09cc8e11b9de8e2a284a439af290714ddf3d1'
- '106d36537c621d1b0d4a9a541ee307ace593e005c322fd3622fc64c2f54f70ba')
+ '106d36537c621d1b0d4a9a541ee307ace593e005c322fd3622fc64c2f54f70ba'
+ '9517a7be3c8debdd7c57390e3c62eb8395daf9b9949614023e385cc8cd91b1e4'
+ 'c48fe6060b852e136fee7b94b42fce5c8b9ac201720083d0b3edfc22cacdd285'
+ 'dc80adeee3d1106d6e814c2799a58e1bf4900c967aa7b3ca603f393b5abfcde7')
prepare() {
cd $_pkgname-$pkgver
patch -Np1 -i ../transparency.patch
+ # https://bugs.archlinux.org/task/68318
+ # https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/303
+ patch -Np1 -i ../0001-screen-Manually-handle-env-inheritance.patch
+ patch -Np1 -i ../0002-screen-Move-env-sanitization-from-client.patch
+ patch -Np1 -i ../0003-screen-Ignore-some-more-environment-variables.patch
# autogen.sh not in tarball
autoreconf -fiv
}
diff --git a/package.changelog b/package.changelog
index 38767eaaef7..7a2a0a26f69 100644
--- a/package.changelog
+++ b/package.changelog
@@ -1,3 +1,7 @@
+2020-10-29
+ add patches "environment fixes"
+ change description
+
2020-10-10
upstream upgrade: 3.36.2 -> 3.38.1
requires vte3 >= 0.62.1