Bug#598281: Needs porting to vte 0.26
Package: cdebconf-terminal
Version: 0.8
Severity: wishlist
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch maverick
Hi there
cdebconf-terminal doesn't build anymore in Ubuntu since vte 0.26; I
wrote the attached patch, but only build-tested it; would love if
someone could try it out.
Thanks!
--
Loïc Minier
diff -Nru cdebconf-terminal-0.8/debian/changelog cdebconf-terminal-0.8ubuntu1dooz1/debian/changelog
--- cdebconf-terminal-0.8/debian/changelog 2010-07-11 10:29:39.000000000 +0200
+++ cdebconf-terminal-0.8ubuntu1dooz1/debian/changelog 2010-09-28 05:01:40.000000000 +0200
@@ -1,3 +1,13 @@
+cdebconf-terminal (0.9) UNRELEASED; urgency=low
+
+ * Port to vte >= 0.26.
+ * Makefile.in: also pass $(VTE_CFLAGS) when building gtk-*.c files.
+ * Bump libvte-dev build-dep to >= 0.16.15 for VTE_CHECK_VERSION().
+ * gtk-plugin-terminal.c: use vte_terminal_fork_command_full() instead of
+ vte_terminal_fork_command() with newer vtes.
+
+ -- Loïc Minier <loic.minier@ubuntu.com> Tue, 28 Sep 2010 01:15:06 +0200
+
cdebconf-terminal (0.8) unstable; urgency=low
[ Otavio Salvador/Christian Perrier ]
diff -Nru cdebconf-terminal-0.8/debian/control cdebconf-terminal-0.8ubuntu1dooz1/debian/control
--- cdebconf-terminal-0.8/debian/control 2010-03-24 06:00:38.000000000 +0100
+++ cdebconf-terminal-0.8ubuntu1dooz1/debian/control 2010-09-28 04:38:37.000000000 +0200
@@ -3,7 +3,7 @@
Section: debian-installer
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Uploaders: Jérémy Bobbio <lunar@debian.org>, Colin Watson <cjwatson@debian.org>, Christian Perrier <bubulle@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), po-debconf (>= 0.5.0), libdebian-installer4-dev, libdebconfclient0-dev (>= 0.146), libnewt-dev, libgtk2.0-dev (>= 2.18.7-2), libvte-dev (>> 0.16.14-1)
+Build-Depends: debhelper (>= 7.0.50~), po-debconf (>= 0.5.0), libdebian-installer4-dev, libdebconfclient0-dev (>= 0.146), libnewt-dev, libgtk2.0-dev (>= 2.18.7-2), libvte-dev (>> 0.16.15)
Vcs-Svn: svn://svn.debian.org/d-i/trunk/packages/cdebconf-terminal
Package: cdebconf-gtk-terminal
diff -Nru cdebconf-terminal-0.8/gtk-plugin-terminal.c cdebconf-terminal-0.8ubuntu1dooz1/gtk-plugin-terminal.c
--- cdebconf-terminal-0.8/gtk-plugin-terminal.c 2009-07-21 07:57:01.000000000 +0200
+++ cdebconf-terminal-0.8ubuntu1dooz1/gtk-plugin-terminal.c 2010-09-28 04:58:16.000000000 +0200
@@ -14,6 +14,11 @@
#include <vte/vte.h>
#include <string.h>
+#if VTE_CHECK_VERSION(0,26,0)
+/* whether vte has vte_terminal_fork_command_full() */
+#define VTE_HAS_NEW_FORK
+#endif
+
extern char ** environ;
#define DEFAULT_COMMAND_LINE "/bin/sh"
@@ -27,16 +32,20 @@
struct frontend * fe;
GtkWidget * goback_button;
VteTerminal * terminal;
+#ifdef VTE_HAS_NEW_FORK
char * command;
+#endif
char ** argv;
char ** environ;
};
static void destroy_terminal(struct terminal * terminal_data)
{
+#ifdef VTE_HAS_NEW_FORK
if (NULL != terminal_data->command) {
g_free(terminal_data->command);
}
+#endif
if (NULL != terminal_data->argv) {
g_strfreev(terminal_data->argv);
}
@@ -94,11 +103,13 @@
g_critical("g_strsplit_set failed.");
return FALSE;
}
+#ifdef VTE_HAS_NEW_FORK
terminal_data->command = g_strdup(terminal_data->argv[0]);
if (NULL == terminal_data->command) {
- g_critical("g_strplit_set failed.");
+ g_critical("g_strdup failed.");
return FALSE;
}
+#endif
return TRUE;
}
@@ -340,10 +351,22 @@
{
pid_t pid;
+#if VTE_CHECK_VERSION(0,26,0)
+ vte_terminal_fork_command_full(
+ terminal_data->terminal,
+ VTE_PTY_NO_LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP,
+ "/",
+ terminal_data->argv, terminal_data->environ,
+ 0, /* no special spawn_flags */
+ NULL, NULL, /* no child_setup function nor child_setup_data */
+ &pid,
+ NULL /* extended error */);
+#else
pid = vte_terminal_fork_command(
terminal_data->terminal, terminal_data->command,
terminal_data->argv, terminal_data->environ, "/",
FALSE /* no lastlog */, FALSE /* no utmp */, FALSE /* no wtmp */);
+#endif
if (0 == pid) {
g_critical("vte_terminal_fork_command failed.");
return FALSE;
diff -Nru cdebconf-terminal-0.8/Makefile.in cdebconf-terminal-0.8ubuntu1dooz1/Makefile.in
--- cdebconf-terminal-0.8/Makefile.in 2009-07-21 07:57:01.000000000 +0200
+++ cdebconf-terminal-0.8ubuntu1dooz1/Makefile.in 2010-09-28 02:26:37.000000000 +0200
@@ -14,6 +14,7 @@
LDFLAGS=@LDFLAGS@
GTK_CFLAGS=@GTK_CFLAGS@
GTK_LIBS=@GTK_LIBS@
+VTE_CFLAGS=@VTE_CFLAGS@
CFLAGS += -funsigned-char -fstrict-aliasing -Wall -W -Werror -Wundef \
-Wwrite-strings -Wsign-compare -Wno-unused-parameter -Winit-self \
@@ -47,7 +48,7 @@
gtk-%.opic: gtk-%.c
@echo "Compiling $< to $@"
- $(CC) $(CFLAGS) $(GTK_CFLAGS) -fPIC -o $@ -c $<
+ $(CC) $(CFLAGS) $(GTK_CFLAGS) $(VTE_CFLAGS) -fPIC -o $@ -c $<
%.opic: %.c
@echo "Compiling $< to $@"
Reply to: