summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2012-04-05 03:09:09 +0000
committerMu Qiao <qiaomuf@gentoo.org>2012-04-05 03:09:09 +0000
commit5fd4c76f430bca2f83c85e081334c085776060b1 (patch)
tree7213b8cd56a1182e8d107e5d1c8dd38af1f2c80b /net-misc/networkmanager
parentmarked x86 per bug 404891 (diff)
downloadgentoo-2-5fd4c76f430bca2f83c85e081334c085776060b1.tar.gz
gentoo-2-5fd4c76f430bca2f83c85e081334c085776060b1.tar.bz2
gentoo-2-5fd4c76f430bca2f83c85e081334c085776060b1.zip
Fix quote handling for global data
(Portage version: 2.1.10.52/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/networkmanager')
-rw-r--r--net-misc/networkmanager/ChangeLog9
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.9.4.0-fix-quote-handling.patch73
-rw-r--r--net-misc/networkmanager/networkmanager-0.9.4.0-r1.ebuild (renamed from net-misc/networkmanager/networkmanager-0.9.4.0.ebuild)4
3 files changed, 84 insertions, 2 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog
index 0722aa08a711..b86d87c39b54 100644
--- a/net-misc/networkmanager/ChangeLog
+++ b/net-misc/networkmanager/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/networkmanager
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.129 2012/03/27 09:11:53 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.130 2012/04/05 03:09:09 qiaomuf Exp $
+
+*networkmanager-0.9.4.0-r1 (05 Apr 2012)
+
+ 05 Apr 2012; Mu Qiao <qiaomuf@gentoo.org> -networkmanager-0.9.4.0.ebuild,
+ +networkmanager-0.9.4.0-r1.ebuild,
+ +files/networkmanager-0.9.4.0-fix-quote-handling.patch:
+ Fix quote handling for global data
*networkmanager-0.9.4.0 (27 Mar 2012)
diff --git a/net-misc/networkmanager/files/networkmanager-0.9.4.0-fix-quote-handling.patch b/net-misc/networkmanager/files/networkmanager-0.9.4.0-fix-quote-handling.patch
new file mode 100644
index 000000000000..d5cd87b4b5bf
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.9.4.0-fix-quote-handling.patch
@@ -0,0 +1,73 @@
+From 593f87514484aa82c9f1b39c96ee859671186831 Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Thu, 5 Apr 2012 10:12:37 +0800
+Subject: [PATCH] ifnet: fix quote handling for global data
+
+---
+ src/settings/plugins/ifnet/net_parser.c | 13 +++++++------
+ src/settings/plugins/ifnet/tests/net | 2 ++
+ src/settings/plugins/ifnet/tests/test_all.c | 3 +++
+ 3 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/settings/plugins/ifnet/net_parser.c b/src/settings/plugins/ifnet/net_parser.c
+index 38765f5..c230138 100644
+--- a/src/settings/plugins/ifnet/net_parser.c
++++ b/src/settings/plugins/ifnet/net_parser.c
+@@ -143,12 +143,13 @@ init_block_by_line (gchar * buf)
+ pos = g_strrstr (key_value[0], "_");
+ if (pos == NULL || is_global_setting (key_value[0])) {
+ /* global data */
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "global:%s-%s\n", key_value[0],
+- key_value[1]);
+- g_hash_table_insert (global_settings_table,
+- g_strdup (key_value[0]),
+- g_strdup (key_value[1]));
++ data = g_strdup (key_value[1]);
++ tmp = strip_string (data, '"');
++ strip_string (tmp, '\'');
++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "global:%s-%s\n", key_value[0], tmp);
++ g_hash_table_insert (global_settings_table, g_strdup (key_value[0]), g_strdup (tmp));
+ g_strfreev (key_value);
++ g_free (data);
+ return;
+ }
+ *pos++ = '\0';
+@@ -593,7 +594,7 @@ ifnet_flush_to_file (const char *config_file)
+ /* Writing global data */
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ out_line =
+- g_strdup_printf ("%s=%s\n", (gchar *) key, (gchar *) value);
++ g_strdup_printf ("%s=\"%s\"\n", (gchar *) key, (gchar *) value);
+ g_io_channel_write_chars (channel, out_line, -1,
+ &bytes_written, error);
+ if (bytes_written == 0 || (error && *error))
+diff --git a/src/settings/plugins/ifnet/tests/net b/src/settings/plugins/ifnet/tests/net
+index 27d39f4..a5ac9ca 100644
+--- a/src/settings/plugins/ifnet/tests/net
++++ b/src/settings/plugins/ifnet/tests/net
+@@ -3,6 +3,8 @@
+ # please review /etc/conf.d/net.example and save your configuration
+ # in /etc/conf.d/net (this file :]!).
+
++modules="!wpa_supplicant"
++
+ config_eth0=(
+ "202.117.16.121 netmask 255.255.255.0 brd 202.117.16.255"
+ "192.168.4.121/24"
+diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test_all.c
+index 50441d4..974258b 100644
+--- a/src/settings/plugins/ifnet/tests/test_all.c
++++ b/src/settings/plugins/ifnet/tests/test_all.c
+@@ -56,6 +56,9 @@ test_getdata ()
+ && strcmp (ifnet_get_data ("ppp0", "password"),
+ "password") == 0, "get data",
+ "config_ppp0 password is not correctly read");
++ ASSERT (ifnet_get_global_data ("modules")
++ && strcmp ("!wpa_supplicant", ifnet_get_global_data ("modules")) == 0,
++ "get data", "config_eth1 is not correct");
+ }
+
+ static void
+--
+1.7.3.4
+
diff --git a/net-misc/networkmanager/networkmanager-0.9.4.0.ebuild b/net-misc/networkmanager/networkmanager-0.9.4.0-r1.ebuild
index f7b6e487bd8b..fbab7b91120b 100644
--- a/net-misc/networkmanager/networkmanager-0.9.4.0.ebuild
+++ b/net-misc/networkmanager/networkmanager-0.9.4.0-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.4.0.ebuild,v 1.1 2012/03/27 09:11:53 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.4.0-r1.ebuild,v 1.1 2012/04/05 03:09:09 qiaomuf Exp $
EAPI="4"
GNOME_ORG_MODULE="NetworkManager"
@@ -100,6 +100,8 @@ src_prepare() {
epatch "${FILESDIR}/${PN}-0.9.2.0-init-provide-net-r1.patch"
# Bug #402085, https://bugzilla.gnome.org/show_bug.cgi?id=387832
epatch "${FILESDIR}/${PN}-0.9.2.0-pre-sleep.patch"
+ # Fix quote handling for global data (Bug #410821)
+ epatch "${FILESDIR}/${PN}-0.9.4.0-fix-quote-handling.patch"
eautoreconf
default