summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain Perier <mrpouet@gentoo.org>2009-08-28 16:27:47 +0000
committerRomain Perier <mrpouet@gentoo.org>2009-08-28 16:27:47 +0000
commit5bc95cefc984b79c376faaf89193b238be2132f0 (patch)
tree5eafd4fcf229f05ad796ae5774c3ec84c788a20e /x11-terms/gnome-terminal
parentStable on alpha, bug #280266 (diff)
downloadhistorical-5bc95cefc984b79c376faaf89193b238be2132f0.tar.gz
historical-5bc95cefc984b79c376faaf89193b238be2132f0.tar.bz2
historical-5bc95cefc984b79c376faaf89193b238be2132f0.zip
Fix bug #269318, if we are logged in root on the first tab and if we try to open a new tab, do not open it in user on /, patch import from upstream bug #565328. Drop old revision
Package-Manager: portage-2.2_rc40/cvs/Linux x86_64
Diffstat (limited to 'x11-terms/gnome-terminal')
-rw-r--r--x11-terms/gnome-terminal/ChangeLog11
-rw-r--r--x11-terms/gnome-terminal/Manifest15
-rw-r--r--x11-terms/gnome-terminal/files/gnome-terminal-2.26.3.1-cwd-on-new-tab.patch220
-rw-r--r--x11-terms/gnome-terminal/gnome-terminal-2.26.3.1-r1.ebuild (renamed from x11-terms/gnome-terminal/gnome-terminal-2.26.3.1.ebuild)6
4 files changed, 238 insertions, 14 deletions
diff --git a/x11-terms/gnome-terminal/ChangeLog b/x11-terms/gnome-terminal/ChangeLog
index 6ed5bdfae247..cafd93ed7163 100644
--- a/x11-terms/gnome-terminal/ChangeLog
+++ b/x11-terms/gnome-terminal/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for x11-terms/gnome-terminal
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-terms/gnome-terminal/ChangeLog,v 1.198 2009/07/09 22:46:37 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-terms/gnome-terminal/ChangeLog,v 1.199 2009/08/28 16:27:47 mrpouet Exp $
+
+*gnome-terminal-2.26.3.1-r1 (28 Aug 2009)
+
+ 28 Aug 2009; Romain Perier <mrpouet@gentoo.org>
+ -gnome-terminal-2.26.3.1.ebuild, +gnome-terminal-2.26.3.1-r1.ebuild,
+ +files/gnome-terminal-2.26.3.1-cwd-on-new-tab.patch:
+ Fix bug #269318, if we are logged in root on the first tab and if we try
+ to open a new tab, do not open it in user on /, patch import from upstream
+ bug #565328. Drop old revision.
*gnome-terminal-2.26.3.1 (09 Jul 2009)
diff --git a/x11-terms/gnome-terminal/Manifest b/x11-terms/gnome-terminal/Manifest
index 859cb20c696e..a46a6d987be5 100644
--- a/x11-terms/gnome-terminal/Manifest
+++ b/x11-terms/gnome-terminal/Manifest
@@ -1,9 +1,7 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX gnome-terminal-2.13.90-TERM-gnome.patch 413 RMD160 d2dd09acd8ac4b185316a09727cc5e3ebee100c3 SHA1 b83a85153e2c29fd287f97e873d1a851e57aac9a SHA256 812ffb7e6966b6ba813223af276c95d3a6efddceddc24b5637b085d4695dcd62
AUX gnome-terminal-2.22.0-default_shell.patch 491 RMD160 211ce1834251f5e4c80ba7511a2cacf8c4c43424 SHA1 47b5cad036c28fc0e750684c42582b9c13609d26 SHA256 efcd9d5074cb4653a3725008290d6b6ae5e8835cfbcbc25f3dfcaf3e7aad2892
AUX gnome-terminal-2.24.2-restore-switch-to-tab.patch 15041 RMD160 5860f46b1379dd40cd8ca9c9e23b30be5ef3e7cb SHA1 3ab937c566c401ad1ee82313cc6989338209fc47 SHA256 7edf095b8e037bcb2d41807eb3d26a6d4c9413088e1c9b58e4ef5eebf4c3a36e
+AUX gnome-terminal-2.26.3.1-cwd-on-new-tab.patch 7074 RMD160 36deb7b2808fe5db59fa3f3ae75c141d02d8c511 SHA1 64ac74d3eecff49416f93f02dc957b7fc00a91ce SHA256 7603ff478f8882816cc26f401f5dceca160bdab99878aa615eee34259efb93dd
DIST gnome-terminal-2.24.2-restore-switch-to-tab-i18n.patch.bz2 30429 RMD160 ebed0cc9f9519586495a1bb44fd7dd6b9a0c76a3 SHA1 72ce23ede1e27661aab0762ab2e77fa69dfcbcbc SHA256 106a5eb8de80ebc4a398e4b5964e1de2df33263b92f0cdc579fde2a078af4972
DIST gnome-terminal-2.24.2.tar.bz2 1854226 RMD160 c496f736b012b3324e8168a7fa5356ca6223ef8d SHA1 f6900ee932fd7c3b86a11a598a0a7381fd2fd839 SHA256 849597d79f2dd6eb8d4079bc0b59c0f806a691ac2af360099ef0fa1f6b91e82a
DIST gnome-terminal-2.26.1.tar.bz2 2027751 RMD160 693c5ad11da3e68f4cfff198ef59fd13b25a39e1 SHA1 6cb6ce4916ccf7cb7be0467944665a79c38fd7c4 SHA256 e102f4a602699851dd37d7d58fea698a024cf1d680262ab3f0df612a809a3971
@@ -12,13 +10,6 @@ DIST gnome-terminal-2.26.3.1.tar.bz2 2176049 RMD160 db6b5ba601c3c74e3424e8811950
EBUILD gnome-terminal-2.24.2-r1.ebuild 1529 RMD160 a701aadb6231473755a459db718d86b8461517f4 SHA1 3c41b5fecc2613850df472b9c02e320a91eb62d6 SHA256 b81a70961138843343de63befe908af7db952d11b69a7e0caf744800e5687806
EBUILD gnome-terminal-2.26.1.ebuild 1230 RMD160 0748f153df3fab7dabdc6163731e02c249d391c1 SHA1 ef5bf3ea6240342bd1994100ea066c4c2da64bdb SHA256 a63d3ea8bd5c0db97f250bf3d2b7f27b61e975d4e0479d8134dbdded06942c77
EBUILD gnome-terminal-2.26.2.ebuild 1230 RMD160 fbd602ea0701e106bc51e0302f48b7db7751032c SHA1 18ce7b6af64db95f3ec0dd1b2bcceef304e36389 SHA256 a15786c8264cd114a66bcba7a37322455648eafc384a51311d0908e92a4e1e6b
-EBUILD gnome-terminal-2.26.3.1.ebuild 1232 RMD160 b3b4b9fffe9bb08eba5a86c9a06aa6220bd86aad SHA1 f1b0d88363498f72a34b16818e7c796896692c9d SHA256 695f055fe2f4980ace7bad62059592e1353e003e8070f669cf90ba6e16e74e1a
-MISC ChangeLog 27033 RMD160 0a36740b329c7fd2bec11daaecb5afee65739f74 SHA1 48875974fe14443122d23ef7b4a5aec8c798a4b5 SHA256 84930d829f780204a35a5d06a0212824520133c8462f6eb1633cd467da85d9da
+EBUILD gnome-terminal-2.26.3.1-r1.ebuild 1422 RMD160 e1ff8ef4b7456bb5ae837231ca22bbcbc2e5e2fb SHA1 5c830fda17c6074af0cf102d19d61a16858db479 SHA256 4e5f7594ca55992658c91d2c826b3355dd60a2a0690f1a70b807b803284c094a
+MISC ChangeLog 27443 RMD160 913e0e7bf9984dbef28669aec1ea75e73d8018d5 SHA1 9670a3880441000f5cb30caeab85004184f626cd SHA256 96aecb94634f659120ca743f885d43fd3251337106e72c807b25b6b49781ff84
MISC metadata.xml 158 RMD160 c0e2bae8e91bb6be8922bac5e4f597302e06587e SHA1 38f78e9790bcd4382b4a49aa226aa6dda1d3a3d7 SHA256 3a7dbca0fdc557de69783e0663e2d76ddab129ea8a19b2d0ef6d3e5d1b947ce1
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.11 (GNU/Linux)
-
-iEYEARECAAYFAkpWc1MACgkQ1fmVwcYIWAZ5fwCgr1pZIQZS2ATQQmv2yKl50u9L
-g7UAnjR6jSUGqPpxhdUnDf8occFOI6Du
-=uEri
------END PGP SIGNATURE-----
diff --git a/x11-terms/gnome-terminal/files/gnome-terminal-2.26.3.1-cwd-on-new-tab.patch b/x11-terms/gnome-terminal/files/gnome-terminal-2.26.3.1-cwd-on-new-tab.patch
new file mode 100644
index 000000000000..d532dc0db088
--- /dev/null
+++ b/x11-terms/gnome-terminal/files/gnome-terminal-2.26.3.1-cwd-on-new-tab.patch
@@ -0,0 +1,220 @@
+Author: Christian Persch
+Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=565328
+Date: 2009-04-22 18:33
+
+---
+
+diff --git a/src/terminal-screen.c b/src/terminal-screen.c
+index e6dd61e..10deb3f 100644
+--- a/src/terminal-screen.c
++++ b/src/terminal-screen.c
+@@ -183,6 +183,59 @@ static guint n_skey_regexes;
+
+ G_DEFINE_TYPE (TerminalScreen, terminal_screen, VTE_TYPE_TERMINAL)
+
++static char *
++cwd_of_pid (int pid)
++{
++ static const char patterns[][18] = {
++ "/proc/%d/cwd", /* Linux */
++ "/proc/%d/path/cwd", /* Solaris >= 10 */
++ };
++ guint i;
++
++ if (pid == -1)
++ return NULL;
++
++ /* Try to get the working directory using various OS-specific mechanisms */
++ for (i = 0; i < G_N_ELEMENTS (patterns); ++i)
++ {
++ char cwd_file[64];
++ char buf[PATH_MAX + 1];
++ int len;
++
++ g_snprintf (cwd_file, sizeof (cwd_file), patterns[i], pid);
++ len = readlink (cwd_file, buf, sizeof (buf) - 1);
++
++ if (len > 0 && buf[0] == '/')
++ return g_strndup (buf, len);
++
++ /* If that didn't do it, try this hack */
++ if (len <= 0)
++ {
++ char *cwd, *working_dir = NULL;
++
++ cwd = g_get_current_dir ();
++ if (cwd != NULL)
++ {
++ /* On Solaris, readlink returns an empty string, but the
++ * link can be used as a directory, including as a target
++ * of chdir().
++ */
++ if (chdir (cwd_file) == 0)
++ {
++ working_dir = g_get_current_dir ();
++ chdir (cwd);
++ }
++ g_free (cwd);
++ }
++
++ if (working_dir)
++ return working_dir;
++ }
++ }
++
++ return NULL;
++}
++
+ static void
+ free_tag_data (TagData *tagdata)
+ {
+@@ -1738,75 +1791,57 @@ terminal_screen_get_dynamic_icon_title (TerminalScreen *screen)
+ * terminal_screen_get_current_dir:
+ * @screen:
+ *
+- * Returns: a newly allocated string containing the current working directory
+- * of the foreground process in @screen's PTY; or otherwise the initial working
+- * directory as set by terminal_screen_new()
++ * Tries to determine the current working directory of the foreground process
++ * in @screen's PTY, falling back to the current working directory of the
++ * primary child.
++ *
++ * Returns: a newly allocated string containing the current working directory,
++ * or %NULL on failure
+ */
+ char*
+ terminal_screen_get_current_dir (TerminalScreen *screen)
+ {
+- static const char patterns[][18] = {
+- "/proc/%d/cwd", /* Linux */
+- "/proc/%d/path/cwd", /* Solaris >= 10 */
+- };
+ TerminalScreenPrivate *priv = screen->priv;
+- int fgpid;
+- guint i;
+-
+- g_return_val_if_fail (TERMINAL_IS_SCREEN (screen), NULL);
++ char *cwd;
++
++ if (priv->pty_fd != -1) {
++ /* Get the foreground process ID */
++ cwd = cwd_of_pid (tcgetpgrp (priv->pty_fd));
++ if (cwd != NULL)
++ return cwd;
++
++ /* If that didn't work, try falling back to the primary child. See bug #575184. */
++ cwd = cwd_of_pid (priv->child_pid);
++ if (cwd != NULL)
++ return cwd;
++ }
+
+- if (priv->pty_fd == -1)
+- return g_strdup (priv->initial_working_directory);
++ return NULL;
++}
+
+- /* Get the foreground process ID */
+- fgpid = tcgetpgrp (priv->pty_fd);
++/**
++ * terminal_screen_get_current_dir_with_fallback:
++ * @screen:
++ *
++ * Returns: a newly allocated string containing the current working directory
++ * of the foreground process in @screen's PTY; or otherwise the initial working
++ * directory as set by terminal_screen_new(), or %NULL if unable to determine
++ * the current working directory
++ */
++char*
++terminal_screen_get_current_dir_with_fallback (TerminalScreen *screen)
++{
++ TerminalScreenPrivate *priv = screen->priv;
++ char *cwd;
+
+- /* If that didn't work, try falling back to the primary child. See bug #575184. */
+- if (fgpid == -1)
+- fgpid = priv->child_pid;
++ cwd = terminal_screen_get_current_dir (screen);
++ if (cwd != NULL)
++ return cwd;
+
+- if (fgpid == -1)
++ if (priv->initial_working_directory != NULL)
+ return g_strdup (priv->initial_working_directory);
+
+- /* Try to get the working directory using various OS-specific mechanisms */
+- for (i = 0; i < G_N_ELEMENTS (patterns); ++i)
+- {
+- char cwd_file[64];
+- char buf[PATH_MAX + 1];
+- int len;
+-
+- g_snprintf (cwd_file, sizeof (cwd_file), patterns[i], fgpid);
+- len = readlink (cwd_file, buf, sizeof (buf) - 1);
+-
+- if (len > 0 && buf[0] == '/')
+- return g_strndup (buf, len);
+-
+- /* If that didn't do it, try this hack */
+- if (len <= 0)
+- {
+- char *cwd, *working_dir = NULL;
+-
+- cwd = g_get_current_dir ();
+- if (cwd != NULL)
+- {
+- /* On Solaris, readlink returns an empty string, but the
+- * link can be used as a directory, including as a target
+- * of chdir().
+- */
+- if (chdir (cwd_file) == 0)
+- {
+- working_dir = g_get_current_dir ();
+- chdir (cwd);
+- }
+- g_free (cwd);
+- }
+-
+- if (working_dir)
+- return working_dir;
+- }
+- }
+-
+- return g_strdup (priv->initial_working_directory);
++ return g_strdup (g_get_home_dir ());
+ }
+
+ void
+diff --git a/src/terminal-screen.h b/src/terminal-screen.h
+index efd5b3c..8b1e422 100644
+--- a/src/terminal-screen.h
++++ b/src/terminal-screen.h
+@@ -110,6 +110,7 @@ const char *terminal_screen_get_dynamic_title (TerminalScreen *screen);
+ const char *terminal_screen_get_dynamic_icon_title (TerminalScreen *screen);
+
+ char *terminal_screen_get_current_dir (TerminalScreen *screen);
++char *terminal_screen_get_current_dir_with_fallback (TerminalScreen *screen);
+
+ void terminal_screen_set_font (TerminalScreen *screen);
+ void terminal_screen_set_font_scale (TerminalScreen *screen,
+diff --git a/src/terminal-window.c b/src/terminal-window.c
+index 188bdd1..05e0af1 100644
+--- a/src/terminal-window.c
++++ b/src/terminal-window.c
+@@ -2807,7 +2807,7 @@ file_new_window_callback (GtkAction *action,
+
+ new_window = terminal_app_new_window (app, gtk_widget_get_screen (GTK_WIDGET (window)));
+
+- new_working_directory = terminal_screen_get_current_dir (priv->active_screen);
++ new_working_directory = terminal_screen_get_current_dir_with_fallback (priv->active_screen);
+ terminal_app_new_terminal (app, new_window, profile,
+ NULL, NULL,
+ new_working_directory,
+@@ -2839,7 +2839,7 @@ file_new_tab_callback (GtkAction *action,
+ if (_terminal_profile_get_forgotten (profile))
+ return;
+
+- new_working_directory = terminal_screen_get_current_dir (priv->active_screen);
++ new_working_directory = terminal_screen_get_current_dir_with_fallback (priv->active_screen);
+ terminal_app_new_terminal (app, window, profile,
+ NULL, NULL,
+ new_working_directory,
diff --git a/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1.ebuild b/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1-r1.ebuild
index 755a6074e04e..d951ddd35b7a 100644
--- a/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1.ebuild
+++ b/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1.ebuild,v 1.1 2009/07/09 22:46:37 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-terms/gnome-terminal/gnome-terminal-2.26.3.1-r1.ebuild,v 1.1 2009/08/28 16:27:47 mrpouet Exp $
inherit eutils gnome2
@@ -39,6 +39,10 @@ src_unpack() {
# Use login shell by default (#12900)
epatch "${FILESDIR}"/${PN}-2.22.0-default_shell.patch
+ # If we're logged in root on the first tab, don't open a new tab
+ # in user on /, fix bug #269318, import from upstream bug #565328.
+ epatch "${FILESDIR}"/${P}-cwd-on-new-tab.patch
+
# patch gnome terminal to report as GNOME rather than xterm
# This needs to resolve a few bugs (#120294,)
# Leave out for now; causing too many problems