summaryrefslogtreecommitdiffstats
path: root/main/vte
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-10-09 19:10:25 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-10-09 19:10:25 +0000
commita5991f47c6bbb88302246445585bfd6e105bf8ce (patch)
tree5c8b069f7b786f6ee2607262f9eeed92934291ab /main/vte
parenta38a676d2703207a28f91aac8dccfb32fe9d285c (diff)
downloadaports-a5991f47c6bbb88302246445585bfd6e105bf8ce.tar.bz2
aports-a5991f47c6bbb88302246445585bfd6e105bf8ce.tar.xz
main/vte: upstream fix for TERM
Diffstat (limited to 'main/vte')
-rw-r--r--main/vte/APKBUILD18
-rw-r--r--main/vte/term.patch137
2 files changed, 152 insertions, 3 deletions
diff --git a/main/vte/APKBUILD b/main/vte/APKBUILD
index 8748f4f58..2e5fe6132 100644
--- a/main/vte/APKBUILD
+++ b/main/vte/APKBUILD
@@ -1,16 +1,27 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vte
pkgver=0.26.0
-pkgrel=0
+pkgrel=1
pkgdesc="Virtual Terminal Emulator library"
url="http://www.gnome.org"
license="LGPL"
subpackages="$pkgname-dev $pkgname-doc"
depends=
makedepends="pkgconfig gtk+-dev intltool python ncurses-dev"
-source="http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2"
+source="http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2
+ term.patch"
depends_dev="glib-dev pango-dev gtk+-dev"
+prepare() {
+ cd "$srcdir"/$pkgname-$pkgver
+ for i in $source; do
+ case $i in
+ *.patch)
+ patch -p1 -i "$srcdir"/$i || return 1
+ ;;
+ esac
+ done
+}
build() {
cd "$srcdir"/$pkgname-$pkgver
./configure --prefix=/usr \
@@ -26,4 +37,5 @@ package() {
cd "$srcdir"/$pkgname-$pkgver
make DESTDIR="$pkgdir" install || return 1
}
-md5sums="44c57bb20a79d9e3b20c7bf222714528 vte-0.26.0.tar.bz2"
+md5sums="44c57bb20a79d9e3b20c7bf222714528 vte-0.26.0.tar.bz2
+90284e2b76a2b198920ec4956f689de3 term.patch"
diff --git a/main/vte/term.patch b/main/vte/term.patch
new file mode 100644
index 000000000..811385d9f
--- /dev/null
+++ b/main/vte/term.patch
@@ -0,0 +1,137 @@
+From c5d31b87d7a377f5e6fe93fc1efb061f5c7e9db7 Mon Sep 17 00:00:00 2001
+From: Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
+Date: Thu, 07 Oct 2010 10:57:45 +0000
+Subject: Pass the correct TERM value inside envp when spawning
+
+So the codepaths that end up invoking execve still have the correct
+TERM entry. Clarify the effect of vte_pty_set_term().
+
+https://bugzilla.gnome.org/show_bug.cgi?id=631589
+---
+diff --git a/src/pty.c b/src/pty.c
+index e3fb782..11dbe6a 100644
+--- a/src/pty.c
++++ b/src/pty.c
+@@ -394,7 +394,7 @@ __vte_pty_get_argv (const char *command,
+ * Returns: a newly allocated string array. Free using g_strfreev()
+ */
+ static gchar **
+-__vte_pty_merge_environ (char **envp)
++__vte_pty_merge_environ (char **envp, const char *term_value)
+ {
+ GHashTable *table;
+ GHashTableIter iter;
+@@ -425,6 +425,9 @@ __vte_pty_merge_environ (char **envp)
+ }
+ }
+
++ if (term_value != NULL)
++ g_hash_table_replace (table, g_strdup ("TERM"), g_strdup (term_value));
++
+ array = g_ptr_array_sized_new (g_hash_table_size (table) + 1);
+ g_hash_table_iter_init(&iter, table);
+ while (g_hash_table_iter_next(&iter, (gpointer) &name, (gpointer) &value)) {
+@@ -518,7 +521,7 @@ __vte_pty_spawn (VtePty *pty,
+ spawn_flags &= ~G_SPAWN_LEAVE_DESCRIPTORS_OPEN;
+
+ /* add the given environment to the childs */
+- envp2 = __vte_pty_merge_environ (envv);
++ envp2 = __vte_pty_merge_environ (envv, pty->priv->term);
+
+ _VTE_DEBUG_IF (VTE_DEBUG_MISC) {
+ g_printerr ("Spawing command:\n");
+@@ -1679,8 +1682,8 @@ vte_pty_class_init (VtePtyClass *klass)
+ /**
+ * VtePty:term:
+ *
+- * The value to set for the TERM environment variable
+- * in vte_pty_child_setup().
++ * The value to set for the TERM environment variable just after
++ * forking.
+ *
+ * Since: 0.26
+ */
+@@ -1816,13 +1819,7 @@ vte_pty_get_fd (VtePty *pty)
+ * @pty: a #VtePty
+ * @emulation: (allow-none): the name of a terminal description, or %NULL
+ *
+- * Sets what value of the TERM environment variable to set
+- * when using vte_pty_child_setup().
+- *
+- * Note: When using fork() and execve(), or the g_spawn_async() family of
+- * functions with vte_pty_child_setup(),
+- * and the environment passed to them contains the <literal>TERM</literal>
+- * environment variable, that value will override the one set here.
++ * Sets what value of the TERM environment variable to set just after forking.
+ *
+ * Since: 0.26
+ */
+diff --git a/src/vte.c b/src/vte.c
+index 5c2c1aa..72aa1a1 100644
+--- a/src/vte.c
++++ b/src/vte.c
+@@ -3518,32 +3518,6 @@ _vte_terminal_get_argv (const char *command,
+ return argv2;
+ }
+
+-/*
+- * _vte_terminal_filter_envv:
+- * @envv: the environment vector
+- *
+- * Filters out the TERM variable from @envv.
+- *
+- * Returns: (transfer container): the filtered environment vector
+- */
+-static char **
+-_vte_terminal_filter_envv (char **envv)
+-{
+- GPtrArray *array;
+- int i;
+-
+- if (envv == NULL)
+- return NULL;
+-
+- array = g_ptr_array_sized_new (g_strv_length (envv));
+- for (i = 0; envv[i]; ++i)
+- if (!g_str_has_prefix (envv[i], "TERM="))
+- g_ptr_array_add (array, envv[i]);
+- g_ptr_array_add (array, NULL);
+-
+- return (char **) g_ptr_array_free (array, FALSE);
+-}
+-
+ /**
+ * vte_terminal_fork_command:
+ * @terminal: a #VteTerminal
+@@ -3580,7 +3554,7 @@ vte_terminal_fork_command(VteTerminal *terminal,
+ gboolean utmp,
+ gboolean wtmp)
+ {
+- char **real_argv, **real_envv;
++ char **real_argv;
+ GSpawnFlags spawn_flags;
+ GPid child_pid;
+ gboolean ret;
+@@ -3596,19 +3570,17 @@ vte_terminal_fork_command(VteTerminal *terminal,
+ spawn_flags = G_SPAWN_CHILD_INHERITS_STDIN |
+ G_SPAWN_SEARCH_PATH;
+ real_argv = _vte_terminal_get_argv (command, argv, &spawn_flags);
+- real_envv = _vte_terminal_filter_envv (envv);
+
+ ret = vte_terminal_fork_command_full(terminal,
+ __vte_pty_get_pty_flags(lastlog, utmp, wtmp),
+ working_directory,
+ real_argv,
+- real_envv,
++ envv,
+ spawn_flags,
+ NULL, NULL,
+ &child_pid,
+ err);
+ g_strfreev (real_argv);
+- g_free (real_envv);
+
+ #ifdef VTE_DEBUG
+ if (error) {
+--
+cgit v0.8.3.1