summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-05-18 11:20:12 +0000
committerMu Qiao <qiaomuf@gentoo.org>2011-05-18 11:20:12 +0000
commit3534bd7002ba2567d3307f4b0a6bb9371e045b3a (patch)
tree41b2af9dd0a2c7b9c3d703ff3650b76fb39fa485 /net-misc/networkmanager
parentAdd blocker for the knetworkmanager due to file collision. Per bug #367715. (diff)
downloadhistorical-3534bd7002ba2567d3307f4b0a6bb9371e045b3a.tar.gz
historical-3534bd7002ba2567d3307f4b0a6bb9371e045b3a.tar.bz2
historical-3534bd7002ba2567d3307f4b0a6bb9371e045b3a.zip
Add backported patches for the ifnet plug-in.
Package-Manager: portage-2.1.9.49/cvs/Linux x86_64
Diffstat (limited to 'net-misc/networkmanager')
-rw-r--r--net-misc/networkmanager/ChangeLog11
-rw-r--r--net-misc/networkmanager/Manifest21
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8.4.0-fix-tests.patch55
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8.4.0-ifnet-smarter-write.patch158
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8.4.0-shared-connection.patch458
-rw-r--r--net-misc/networkmanager/networkmanager-0.8.4.0-r1.ebuild (renamed from net-misc/networkmanager/networkmanager-0.8.4.0.ebuild)13
6 files changed, 709 insertions, 7 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog
index cdaf768d3224..55a84c80fa52 100644
--- a/net-misc/networkmanager/ChangeLog
+++ b/net-misc/networkmanager/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-misc/networkmanager
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.104 2011/05/18 09:23:32 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.105 2011/05/18 11:20:12 qiaomuf Exp $
+
+*networkmanager-0.8.4.0-r1 (18 May 2011)
+
+ 18 May 2011; Mu Qiao <qiaomuf@gentoo.org> -networkmanager-0.8.4.0.ebuild,
+ +networkmanager-0.8.4.0-r1.ebuild,
+ +files/networkmanager-0.8.4.0-fix-tests.patch,
+ +files/networkmanager-0.8.4.0-ifnet-smarter-write.patch,
+ +files/networkmanager-0.8.4.0-shared-connection.patch:
+ Add backported patches for the ifnet plug-in.
*networkmanager-0.8.4.0 (18 May 2011)
diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest
index 6ab0bd669a2e..538f7df1b1dd 100644
--- a/net-misc/networkmanager/Manifest
+++ b/net-misc/networkmanager/Manifest
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98e SHA1 1dd2250c746b25566fceaab551f4ef8335fe4f55 SHA256 f8cb5d0470619cf1f0812fffcf1bf2091e3c44a757899c07164f80ddd6a2641e
AUX networkmanager-0.8-confchanges.patch 1063 RMD160 25a0d45410fa5590098386556e9947dd15507eda SHA1 ba6eaa63188f97f93bbbb327676d8104bbf7e8c8 SHA256 9fcbe0b9ab4cc38c9057a0dde2f5153efc12515ed4d28920a455dad7fc2b1e09
AUX networkmanager-0.8-nscd-clear-cache.patch 1214 RMD160 2381f455593202a740e634601c0ba8245ecb8fac SHA1 b4a0cec446b6f8fa81c06d5992db61b296f17057 SHA256 2d981bafa96607acb06740d78b8e33afdc675c52b0cf3ce5b098c67566362c99
@@ -18,6 +21,9 @@ AUX networkmanager-0.8.2-fix-tests.patch 2156 RMD160 b549d50e96efe7f26402f5d9745
AUX networkmanager-0.8.2-fix-timestamp.patch 950 RMD160 4217e0332457eae47eb6c2f87a91f87adad37970 SHA1 d9fcaed9f2622937137bb977fba2d1c123b35893 SHA256 7d1d123b0da02ca8f02ce13b805eec912334bf1981032a38dcd2ef7e422bbf81
AUX networkmanager-0.8.2-ifnet-smarter-write.patch 5969 RMD160 d401c8eae69ea70f5bf08f2950a6e476a03f460b SHA1 9a1fde1c789b42ce6e3b0766125862bde962b4c8 SHA256 b4fbc482cbc22edfff0f89624d857cd35b6cb3d7fe85604c5453e7685eb4e12a
AUX networkmanager-0.8.2-shared-connection.patch 15067 RMD160 3e878a999e92fdb6baffba6f2a12caa25a2ba2c6 SHA1 e9664c505bc19964082aa319c4d524e6cf6651e2 SHA256 57f56fb45e48f80636a17d64f080aae594d6f19e51ff5467cc27a739b4b380e6
+AUX networkmanager-0.8.4.0-fix-tests.patch 2079 RMD160 8e867d51abbd0418e4eeb92d5e9d8315cafe78fe SHA1 31f9ab7e9f35798590e5c35965f9b96874055550 SHA256 33ca19856777794b558b88972a5ba15a13c53d77834eaf2339a64c6b072c31a7
+AUX networkmanager-0.8.4.0-ifnet-smarter-write.patch 5969 RMD160 d401c8eae69ea70f5bf08f2950a6e476a03f460b SHA1 9a1fde1c789b42ce6e3b0766125862bde962b4c8 SHA256 b4fbc482cbc22edfff0f89624d857cd35b6cb3d7fe85604c5453e7685eb4e12a
+AUX networkmanager-0.8.4.0-shared-connection.patch 15067 RMD160 3e878a999e92fdb6baffba6f2a12caa25a2ba2c6 SHA1 e9664c505bc19964082aa319c4d524e6cf6651e2 SHA256 57f56fb45e48f80636a17d64f080aae594d6f19e51ff5467cc27a739b4b380e6
AUX nm-system-settings.conf 23 RMD160 6d66c702b345bde668a420a15716feea6005fbd1 SHA1 49ba558d20f5ca5a201e027e13b878dd5ac3569c SHA256 44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21
AUX nm-system-settings.conf-ifnet 70 RMD160 c0d2be147383999b62cead86ab4333169e4ef277 SHA1 679ec8052b610969c148a2d34cd4da7a41484a76 SHA256 34f53d9ac1ad65eda6942dc3059117f60f6321059ca23f4fbfcc2f2edcae151f
DIST NetworkManager-0.8.1.tar.bz2 1505134 RMD160 82f5ad1a641fa49acf34604f89154c865f3d5fbc SHA1 778989ed73cfd7ec05714f77121fa8bfc1bf0981 SHA256 dc126fbe3199d47899c4781e4fff32cee404dc7c728c6ade9eaa899bd80f19fa
@@ -31,6 +37,17 @@ EBUILD networkmanager-0.8.2-r1.ebuild 4132 RMD160 1261ce2f0e499ece5e2ea4c010c862
EBUILD networkmanager-0.8.2-r10.ebuild 5131 RMD160 815b339d654c6b325e7022fe69efa97a29c413a4 SHA1 7ee100e2fff620185d464ac62dc2cef4e7c4c560 SHA256 47e5cff11aa187e6489f28568597d3dd998ed56d471369179027b0a0dc0cd175
EBUILD networkmanager-0.8.2-r2.ebuild 4407 RMD160 6ecc01211eb01e86a6856a1379dfdb991177b0d9 SHA1 ae3cc0a5869fc26b155b9704b286e61a01899c8c SHA256 0ead477d6ed601be6d1e3e5fa2a4546cc9cbbde77703406287125b3b639c5db2
EBUILD networkmanager-0.8.2-r6.ebuild 4837 RMD160 417fa42b1d369fedaa6b7aea043a80cb52fd81e8 SHA1 99779c8f7693c2aeec53c489fa2319e042242b6d SHA256 c591c769bea0660755c3913a879fe74ab6413e2e3e58e83fcf2f0e24f49597de
-EBUILD networkmanager-0.8.4.0.ebuild 4047 RMD160 d2b6da95b684265b926996c06fc5b2b8455016dc SHA1 2809730b387c9fdd62721a695f4cbf02597c6e2c SHA256 45307b07db3febf17077b2f21bc0e9d7d4d03e4f186ef3725a9920e25d2459ad
-MISC ChangeLog 21480 RMD160 34b59e044c44785d4333dc4b38a1e7468ad3878a SHA1 623c09e232f2805a6a626f798791a69887ffece6 SHA256 3f5cf946f4711e9eb254d74d80b4da2319db2ebcdf638c15ab480ce5d49e6e22
+EBUILD networkmanager-0.8.4.0-r1.ebuild 4247 RMD160 e4834a56ceb04dd52e024abbd23ee244766e1c49 SHA1 5491aed30c54022ad48edb89f5968cd8cd31e4bc SHA256 de3f1882aa754394226692d89ade5b1b9c903c616f7cb0bcfc7e3b918ff659ba
+MISC ChangeLog 21850 RMD160 3a5d45e99abf216bf08fea21c9506711cbb5bf22 SHA1 9634890b45db38a71c0ec06c66007ab9e7985777 SHA256 5cf4ee2ca5318159c66729911b7bb9c9f28d4c7f9814af63815d47e19726b79e
MISC metadata.xml 1064 RMD160 28d68851ef6cb80bfef006ab6f88d2f93f44bee9 SHA1 ea76e3b1043d5933df8ed0531f89b0bc8e4b7d7c SHA256 ebb4664fb8edea0672a185e68c1cda3c0f3d5fa0ad906a50a67caafe380ef6be
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.17 (GNU/Linux)
+
+iQEcBAEBAgAGBQJN06t9AAoJEDCzDeQXsVfpobAH/3LpIs6JAEnfCV1TSRks0+DA
++YvKkRPkAjtBzSwtjTFU1G836iwo3P9BsKX2vtGcCZbDGMpj80/DtLzY5zGyAJKr
+IZ3U15qmD1kCLYhukNs0/g1+pHJX6ZS0wz6KKpDFAuqPNu8xGPiYw37BWz9A3qcu
+M5M2vi4NyY/4thcEeAsNy9H0/UQySNPoNXyjiX/QUsWRcK1/RKi4R8Xv9WdNduyO
+pIPyN1yVmqQJzGsl3PIARK4H0vRWlg1mlKfWpB2CYzwS8YvW8cQh92ymZowYDmof
+p0W2EuUAeU3pMF4OSwHPDR+hnoX3rMowgrx15KqHbs3wM7zGX8wTDJWuBRfe6x0=
+=HSOk
+-----END PGP SIGNATURE-----
diff --git a/net-misc/networkmanager/files/networkmanager-0.8.4.0-fix-tests.patch b/net-misc/networkmanager/files/networkmanager-0.8.4.0-fix-tests.patch
new file mode 100644
index 000000000000..d8af30fc5a5a
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.8.4.0-fix-tests.patch
@@ -0,0 +1,55 @@
+From 21e7fda25507e68c13b97040b3b9e5dc3c9726bf Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Wed, 18 May 2011 19:02:40 +0800
+Subject: [PATCH] fix-tests
+
+---
+ configure.ac | 1 -
+ system-settings/plugins/ifnet/Makefile.am | 1 -
+ system-settings/plugins/ifnet/tests/Makefile.am | 13 -------------
+ 3 files changed, 0 insertions(+), 15 deletions(-)
+ delete mode 100644 system-settings/plugins/ifnet/tests/Makefile.am
+
+diff --git a/configure.ac b/configure.ac
+index d8a266e..8304aa4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -571,7 +571,6 @@ system-settings/plugins/Makefile
+ system-settings/plugins/ifupdown/Makefile
+ system-settings/plugins/ifupdown/tests/Makefile
+ system-settings/plugins/ifnet/Makefile
+-system-settings/plugins/ifnet/tests/Makefile
+ system-settings/plugins/ifcfg-rh/Makefile
+ system-settings/plugins/ifcfg-rh/tests/Makefile
+ system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile
+diff --git a/system-settings/plugins/ifnet/Makefile.am b/system-settings/plugins/ifnet/Makefile.am
+index 86d5ea2..f61e112 100644
+--- a/system-settings/plugins/ifnet/Makefile.am
++++ b/system-settings/plugins/ifnet/Makefile.am
+@@ -1,4 +1,3 @@
+-SUBDIRS = . tests
+ INCLUDES = \
+ -I$(top_srcdir)/src/system-settings \
+ -I$(top_srcdir)/include \
+diff --git a/system-settings/plugins/ifnet/tests/Makefile.am b/system-settings/plugins/ifnet/tests/Makefile.am
+deleted file mode 100644
+index 17a081f..0000000
+--- a/system-settings/plugins/ifnet/tests/Makefile.am
++++ /dev/null
+@@ -1,13 +0,0 @@
+-INCLUDES=-I$(top_srcdir)/system-settings/plugins/ifnet\
+- -I$(top_srcdir)/libnm-glib \
+- -I$(top_srcdir)/libnm-util \
+- -I$(top_srcdir)/include \
+- -I$(top_srcdir)/src/system-settings
+-TESTS = check_ifnet
+-check_PROGRAMS = check_ifnet
+-check_ifnet_SOURCES = test_all.c
+-check_ifnet_CPPFLAGS = $(CHECK_CFLAGS) $(GLIB_CFLAGS)
+-check_ifnet_LDADD = $(top_srcdir)/libnm-util/libnm-util.la\
+- $(top_srcdir)/system-settings/plugins/ifnet/lib-ifnet-io.la\
+- $(CHECK_LIBS)\
+- $(GLIB_LIBS)
+--
+1.7.3.4
+
diff --git a/net-misc/networkmanager/files/networkmanager-0.8.4.0-ifnet-smarter-write.patch b/net-misc/networkmanager/files/networkmanager-0.8.4.0-ifnet-smarter-write.patch
new file mode 100644
index 000000000000..ff4c1f253677
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.8.4.0-ifnet-smarter-write.patch
@@ -0,0 +1,158 @@
+From 776fafc133e18df48dc92a717c662e1b2858567e Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Fri, 25 Feb 2011 16:25:07 +0000
+Subject: [PATCH 3/3] Won't write when nothing changed
+ Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
+ Make log less excessive, accept non-alnum ssid (bug #356337)
+
+Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
+---
+ system-settings/plugins/ifnet/connection_parser.c | 33 +++++++++-----------
+ system-settings/plugins/ifnet/net_parser.c | 8 ++++-
+ system-settings/plugins/ifnet/plugin.c | 4 --
+ system-settings/plugins/ifnet/wpa_parser.c | 7 +++-
+ 4 files changed, 26 insertions(+), 26 deletions(-)
+
+diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c
+index 9b5ddc1..4ac2173 100644
+--- a/system-settings/plugins/ifnet/connection_parser.c
++++ b/system-settings/plugins/ifnet/connection_parser.c
+@@ -55,9 +55,16 @@ update_connection_id (NMConnection * connection, gchar * conn_name)
+ gchar *idstr = NULL;
+ gchar *uuid_base = NULL;
+ gchar *uuid = NULL;
++ int name_len;
+ NMSettingConnection *setting;
+
+- idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name);
++ name_len = strlen (conn_name);
++ if ((name_len > 2) && (g_str_has_prefix (conn_name, "0x"))) {
++ gchar * conn_name_printable = utils_hexstr2bin (conn_name + 2, name_len - 2);
++ idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name_printable);
++ g_free (conn_name_printable);
++ } else
++ idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name);
+ uuid_base = idstr;
+ uuid = nm_utils_uuid_generate_from_string (uuid_base);
+ setting =
+@@ -627,23 +634,13 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
+ g_object_set (ip4_setting,
+ NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES,
+ TRUE, NULL);
+- if (nm_setting_ip4_config_add_address
+- (ip4_setting, ip4_addr)) {
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME,
+- "new address: %d", iblock->ip);
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME,
+- "ipv4 addresses count: %d",
+- nm_setting_ip4_config_get_num_addresses
+- (ip4_setting));
+- } else {
+- PLUGIN_WARN (IFNET_PLUGIN_NAME,
+- "ignoring duplicate IP4 address");
+- }
++ if (!nm_setting_ip4_config_add_address (ip4_setting, ip4_addr))
++ PLUGIN_WARN (IFNET_PLUGIN_NAME,
++ "ignoring duplicate IP4 address");
+ nm_ip4_address_unref (ip4_addr);
+ current_iblock = iblock;
+ iblock = iblock->next;
+ destroy_ip_block (current_iblock);
+-
+ }
+ g_object_set (ip4_setting,
+ NM_SETTING_IP4_CONFIG_METHOD,
+@@ -2276,11 +2273,12 @@ write_wireless_setting (NMConnection * connection,
+ return FALSE;
+ }
+
+- /* If the SSID contains any non-printable characters, we need to use the
+- * hex notation of the SSID instead.
++ /* If the SSID contains any non-alnum characters, we need to use
++ * the hex notation of the SSID instead. (Because openrc doesn't
++ * support these characters, see bug #356337)
+ */
+ for (i = 0; i < ssid->len; i++) {
+- if (!isprint (ssid->data[i])) {
++ if (!isalnum (ssid->data[i])) {
+ hex_ssid = TRUE;
+ break;
+ }
+@@ -2487,7 +2485,6 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name,
+ ifnet_set_data (conn_name, "config", "dhcp");
+
+ /* DNS Servers */
+- ifnet_set_data (conn_name, "dns_servers", NULL);
+ num = nm_setting_ip4_config_get_num_dns (s_ip4);
+ if (num > 0) {
+ dns = g_string_new (NULL);
+diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c
+index de2db8a..57f3688 100644
+--- a/system-settings/plugins/ifnet/net_parser.c
++++ b/system-settings/plugins/ifnet/net_parser.c
+@@ -411,12 +411,16 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value)
+ }
+ /* Remove existing key value pair */
+ if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) {
+- if (new_value && !strcmp (orin_value, new_value))
++ if (new_value && !strcmp (orin_value, new_value)){
++ g_free (new_value);
+ return;
++ }
+ g_hash_table_remove (conn, orin_key);
+ g_free (orin_key);
+ g_free (orin_value);
+- }
++ /* old key/value doesn't exist but new value is NULL */
++ } else if (!value)
++ return;
+ if (new_value)
+ g_hash_table_insert (conn, g_strdup (key), new_value);
+ net_parser_data_changed = TRUE;
+diff --git a/system-settings/plugins/ifnet/plugin.c b/system-settings/plugins/ifnet/plugin.c
+index 94f9e79..3952e91 100644
+--- a/system-settings/plugins/ifnet/plugin.c
++++ b/system-settings/plugins/ifnet/plugin.c
+@@ -91,8 +91,6 @@ update_system_hostname (gpointer config)
+ {
+ SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config);
+
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Updating hostname");
+-
+ if (priv->hostname)
+ g_free (priv->hostname);
+ priv->hostname = read_hostname (IFNET_SYSTEM_HOSTNAME_FILE);
+@@ -184,8 +182,6 @@ monitor_file_changes (const char *filename,
+ info);
+ g_signal_connect (monitor, "changed", G_CALLBACK (file_changed),
+ info);
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Monitoring %s", filename);
+-
+ } else
+ PLUGIN_WARN (IFNET_PLUGIN_NAME,
+ "Monitoring %s failed, error: %s", filename,
+diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c
+index 42c52c3..338c338 100644
+--- a/system-settings/plugins/ifnet/wpa_parser.c
++++ b/system-settings/plugins/ifnet/wpa_parser.c
+@@ -463,12 +463,15 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * value)
+ /* Remove old key value pairs */
+ if (g_hash_table_lookup_extended
+ (security, key, &orig_key, &orig_value)) {
+- if (new_value && !strcmp(orig_value, new_value))
++ if (new_value && !strcmp(orig_value, new_value)){
++ g_free (new_value);
+ return;
++ }
+ g_hash_table_remove (security, orig_key);
+ g_free (orig_key);
+ g_free (orig_value);
+- }
++ } else if (!value)
++ return;
+
+ /* Add new key value */
+ if (new_value)
+--
+1.7.3.4
+
diff --git a/net-misc/networkmanager/files/networkmanager-0.8.4.0-shared-connection.patch b/net-misc/networkmanager/files/networkmanager-0.8.4.0-shared-connection.patch
new file mode 100644
index 000000000000..3ce883aa7c1c
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.8.4.0-shared-connection.patch
@@ -0,0 +1,458 @@
+From d252fad6aa69aefa17b592111c2db23864f63907 Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Tue, 25 Jan 2011 10:31:53 +0000
+Subject: [PATCH] shared-connection
+
+Signed-off-by: Mu Qiao <qiaomuf@gentoo.org>
+---
+ system-settings/plugins/ifnet/connection_parser.c | 90 ++++++++++++++------
+ system-settings/plugins/ifnet/net_parser.c | 55 +++++++-----
+ system-settings/plugins/ifnet/net_parser.h | 4 +-
+ system-settings/plugins/ifnet/net_utils.c | 6 +-
+ .../plugins/ifnet/nm-ifnet-connection.c | 8 +-
+ system-settings/plugins/ifnet/wpa_parser.c | 21 +++--
+ 6 files changed, 122 insertions(+), 62 deletions(-)
+
+diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c
+index f9fae51..9b5ddc1 100644
+--- a/system-settings/plugins/ifnet/connection_parser.c
++++ b/system-settings/plugins/ifnet/connection_parser.c
+@@ -557,7 +557,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
+
+ NMSettingIP4Config *ip4_setting =
+ NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ());
+- gchar *value;
++ gchar *value, *method = NULL;
+ gboolean is_static_block = is_static_ip4 (conn_name);
+ ip_block *iblock = NULL;
+
+@@ -569,13 +569,41 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
+ && strstr (value, "nogateway") ? TRUE : FALSE, NULL);
+
+ if (!is_static_block) {
+- g_object_set (ip4_setting,
+- NM_SETTING_IP4_CONFIG_METHOD,
+- NM_SETTING_IP4_CONFIG_METHOD_AUTO,
+- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using DHCP for %s",
+- conn_name);
+- } else {
++ method = ifnet_get_data (conn_name, "config");
++ if (!method){
++ g_set_error (error, ifnet_plugin_error_quark (), 0,
++ "Unknown config for %s", conn_name);
++ g_object_unref (ip4_setting);
++ return;
++ }
++ if (!strcmp (method, "dhcp"))
++ g_object_set (ip4_setting,
++ NM_SETTING_IP4_CONFIG_METHOD,
++ NM_SETTING_IP4_CONFIG_METHOD_AUTO,
++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
++ else if (!strcmp (method, "autoip")){
++ g_object_set (ip4_setting,
++ NM_SETTING_IP4_CONFIG_METHOD,
++ NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL,
++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
++ nm_connection_add_setting (connection, NM_SETTING (ip4_setting));
++ return;
++ } else if (!strcmp (method, "shared")){
++ g_object_set (ip4_setting,
++ NM_SETTING_IP4_CONFIG_METHOD,
++ NM_SETTING_IP4_CONFIG_METHOD_SHARED,
++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL);
++ nm_connection_add_setting (connection, NM_SETTING (ip4_setting));
++ return;
++ } else {
++ g_set_error (error, ifnet_plugin_error_quark (), 0,
++ "Unknown config for %s", conn_name);
++ g_object_unref (ip4_setting);
++ return;
++ }
++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using %s method for %s",
++ method, conn_name);
++ }else {
+ iblock = convert_ip4_config_block (conn_name);
+ if (!iblock) {
+ g_set_error (error, ifnet_plugin_error_quark (), 0,
+@@ -625,7 +653,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
+ }
+
+ /* add dhcp hostname and client id */
+- if (!is_static_block) {
++ if (method && !strcmp (method, "dhcp")) {
+ gchar *dhcp_hostname, *client_id;
+
+ get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id);
+@@ -712,7 +740,6 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error)
+ iblock = iblock->next;
+ destroy_ip_block (current_iblock);
+ }
+-
+ /* Finally add setting to connection */
+ nm_connection_add_setting (connection, NM_SETTING (ip4_setting));
+ }
+@@ -1243,10 +1270,10 @@ parse_wpa_psk (gchar * psk, GError ** error)
+ * the passphrase contains spaces.
+ */
+
+- p = psk;
+- if (p[0] == '"' && psk[strlen (psk) - 1] == '"')
++ p = g_strdup (psk);
++ if (p[0] == '"' && p[strlen (p) - 1] == '"')
+ quoted = TRUE;
+- if (!quoted && (strlen (psk) == 64)) {
++ if (!quoted && (strlen (p) == 64)) {
+ /* Verify the hex PSK; 64 digits */
+ if (!is_hex (p)) {
+ g_set_error (error, ifnet_plugin_error_quark (),
+@@ -1254,7 +1281,7 @@ parse_wpa_psk (gchar * psk, GError ** error)
+ "Invalid WPA_PSK (contains non-hexadecimal characters)");
+ goto out;
+ }
+- hashed = g_strdup (psk);
++ hashed = g_strdup (p);
+ } else {
+ strip_string (p, '"');
+
+@@ -1276,6 +1303,7 @@ parse_wpa_psk (gchar * psk, GError ** error)
+ }
+
+ out:
++ g_free (p);
+ return hashed;
+ }
+
+@@ -2085,7 +2113,8 @@ write_wireless_security_setting (NMConnection * connection,
+ } else if (!strcmp (key_mgmt, "wpa-eap")) {
+ wpa_set_data (conn_name, "key_mgmt", "WPA-EAP");
+ wpa = TRUE;
+- }
++ } else
++ PLUGIN_WARN (IFNET_PLUGIN_NAME, "Unknown key_mgmt: %s", key_mgmt);
+
+ if (auth_alg) {
+ if (!strcmp (auth_alg, "shared"))
+@@ -2180,8 +2209,11 @@ write_wireless_security_setting (NMConnection * connection,
+ g_string_append (quoted, psk);
+ g_string_append_c (quoted, '"');
+ }
+- wpa_set_data (conn_name, "psk",
+- quoted ? quoted->str : (gchar *) psk);
++ if (psk)
++ wpa_set_data (conn_name, "psk",
++ quoted ? quoted->str : (gchar *) psk);
++ else
++ PLUGIN_WARN (IFNET_PLUGIN_NAME, "Use WPA, but no psk received from NM");
+ if (quoted)
+ g_string_free (quoted, TRUE);
+ } else
+@@ -2190,15 +2222,19 @@ write_wireless_security_setting (NMConnection * connection,
+ return TRUE;
+ }
+
+-/* remove old ssid and add new one*/
++/* Only remove old config when ssid is changed.
++ * See bug #350476.
++ * */
+ static void
+ update_wireless_ssid (NMConnection * connection, gchar * conn_name,
+ gchar * ssid, gboolean hex)
+ {
+- ifnet_delete_network (conn_name);
+- ifnet_add_connection (ssid, "wireless");
++ if (strcmp (conn_name, ssid)){
++ ifnet_delete_network (conn_name);
++ wpa_delete_security (conn_name);
++ }
+
+- wpa_delete_security (conn_name);
++ ifnet_add_network (ssid, "wireless");
+ wpa_add_security (ssid);
+ }
+
+@@ -2443,7 +2479,11 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name,
+ }
+ ifnet_set_data (conn_name, "config", ips->str);
+ g_string_free (ips, TRUE);
+- } else
++ } else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
++ ifnet_set_data (conn_name, "config", "shared");
++ else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
++ ifnet_set_data (conn_name, "config", "autoip");
++ else
+ ifnet_set_data (conn_name, "config", "dhcp");
+
+ /* DNS Servers */
+@@ -2858,7 +2898,7 @@ get_wired_name ()
+ for (; i < 256; i++) {
+ gchar *conn_name = g_strdup_printf ("eth%d", i);
+
+- if (!ifnet_has_connection (conn_name)) {
++ if (!ifnet_has_network (conn_name)) {
+ return conn_name;
+ } else
+ g_free (conn_name);
+@@ -2875,7 +2915,7 @@ get_ppp_name ()
+ for (; i < 256; i++) {
+ gchar *conn_name = g_strdup_printf ("ppp%d", i);
+
+- if (!ifnet_has_connection (conn_name)) {
++ if (!ifnet_has_network (conn_name)) {
+ return conn_name;
+ } else
+ g_free (conn_name);
+@@ -2982,7 +3022,7 @@ ifnet_add_new_connection (NMConnection * connection,
+ goto out;
+ }
+
+- if (ifnet_add_connection (new_name, new_type))
++ if (ifnet_add_network (new_name, new_type))
+ success =
+ ifnet_update_parsers_by_connection (connection, new_name,
+ NULL, config_file,
+diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c
+index b4a381d..de2db8a 100644
+--- a/system-settings/plugins/ifnet/net_parser.c
++++ b/system-settings/plugins/ifnet/net_parser.c
+@@ -37,6 +37,9 @@ static GList *functions_list;
+ /* Used to decide whether to write changes to file*/
+ static gboolean net_parser_data_changed = FALSE;
+
++static void
++destroy_connection_config (GHashTable * conn);
++
+ static GHashTable *
+ add_new_connection_config (const gchar * type, const gchar * name)
+ {
+@@ -58,8 +61,10 @@ add_new_connection_config (const gchar * type, const gchar * name)
+ }
+
+ gboolean
+-ifnet_add_connection (gchar * name, gchar * type)
++ifnet_add_network (gchar * name, gchar * type)
+ {
++ if (ifnet_has_network (name))
++ return TRUE;
+ if (add_new_connection_config (type, name)) {
+ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name);
+ net_parser_data_changed = TRUE;
+@@ -69,11 +74,27 @@ ifnet_add_connection (gchar * name, gchar * type)
+ }
+
+ gboolean
+-ifnet_has_connection (gchar * conn_name)
++ifnet_has_network (gchar * conn_name)
+ {
+ return g_hash_table_lookup (conn_table, conn_name) != NULL;
+ }
+
++gboolean
++ifnet_delete_network (gchar * conn_name)
++{
++ GHashTable *network = NULL;
++
++ g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE);
++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name);
++ network = g_hash_table_lookup (conn_table, conn_name);
++ if (!network)
++ return FALSE;
++ g_hash_table_remove (conn_table, conn_name);
++ destroy_connection_config (network);
++ net_parser_data_changed = TRUE;
++ return TRUE;
++}
++
+ static GHashTable *
+ get_connection_config (gchar * name)
+ {
+@@ -377,21 +398,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value)
+ {
+ gpointer orin_key = NULL, orin_value = NULL;
+ GHashTable *conn = g_hash_table_lookup (conn_table, conn_name);
++ gchar *new_value = NULL;
+
+ if (!conn) {
+ PLUGIN_WARN (IFNET_PLUGIN_NAME,
+ "%s does not exsit!", conn_name);
+ return;
+ }
++ if (value){
++ new_value = g_strdup (value);
++ strip_string (new_value, '"');
++ }
+ /* Remove existing key value pair */
+ if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) {
++ if (new_value && !strcmp (orin_value, new_value))
++ return;
+ g_hash_table_remove (conn, orin_key);
+ g_free (orin_key);
+ g_free (orin_value);
+ }
+- if (value)
+- g_hash_table_insert (conn, g_strdup (key),
+- strip_string (g_strdup (value), '"'));
++ if (new_value)
++ g_hash_table_insert (conn, g_strdup (key), new_value);
+ net_parser_data_changed = TRUE;
+ }
+
+@@ -467,7 +494,7 @@ ifnet_flush_to_file (gchar * config_file)
+ gboolean result = FALSE;
+
+ if (!net_parser_data_changed)
+- return FALSE;
++ return TRUE;
+ if (!conn_table || !global_settings_table)
+ return FALSE;
+
+@@ -583,22 +610,6 @@ ifnet_flush_to_file (gchar * config_file)
+ return result;
+ }
+
+-gboolean
+-ifnet_delete_network (gchar * conn_name)
+-{
+- GHashTable *network = NULL;
+-
+- g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE);
+- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name);
+- network = g_hash_table_lookup (conn_table, conn_name);
+- if (!network)
+- return FALSE;
+- g_hash_table_remove (conn_table, conn_name);
+- destroy_connection_config (network);
+- net_parser_data_changed = TRUE;
+- return TRUE;
+-}
+-
+ void
+ ifnet_destroy (void)
+ {
+diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h
+index 73a44c8..b71a01f 100644
+--- a/system-settings/plugins/ifnet/net_parser.h
++++ b/system-settings/plugins/ifnet/net_parser.h
+@@ -36,11 +36,11 @@ GList *ifnet_get_connection_names (void);
+ gchar *ifnet_get_data (gchar * conn_name, const gchar * key);
+ gchar *ifnet_get_global_data (const gchar * key);
+ gchar *ifnet_get_global_setting (gchar * group, gchar * key);
+-gboolean ifnet_has_connection (gchar * conn_name);
++gboolean ifnet_has_network (gchar * conn_name);
+
+ /* Writer functions */
+ gboolean ifnet_flush_to_file (gchar * config_file);
+ void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value);
+-gboolean ifnet_add_connection (gchar * name, gchar * type);
++gboolean ifnet_add_network (gchar * name, gchar * type);
+ gboolean ifnet_delete_network (gchar * conn_name);
+ #endif
+diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c
+index 2dc253c..83b4325 100644
+--- a/system-settings/plugins/ifnet/net_utils.c
++++ b/system-settings/plugins/ifnet/net_utils.c
+@@ -278,6 +278,10 @@ is_static_ip4 (gchar * conn_name)
+
+ if (!data)
+ return FALSE;
++ if (!strcmp (data, "shared"))
++ return FALSE;
++ if (!strcmp (data, "autoip"))
++ return FALSE;
+ dhcp6 = strstr (data, "dhcp6");
+ if (dhcp6) {
+ gchar *dhcp4;
+@@ -942,8 +946,8 @@ get_dhcp_hostname_and_client_id (char **hostname, char **client_id)
+ else if ((tmp = strstr (line, "send host-name")) != NULL) {
+ tmp += strlen ("send host-name");
+ g_strstrip (tmp);
+- strip_string (tmp, '"');
+ strip_string (tmp, ';');
++ strip_string (tmp, '"');
+ if (tmp[0] != '\0')
+ *hostname = g_strdup (tmp);
+ else
+diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.c b/system-settings/plugins/ifnet/nm-ifnet-connection.c
+index e47495c..ebe2581 100644
+--- a/system-settings/plugins/ifnet/nm-ifnet-connection.c
++++ b/system-settings/plugins/ifnet/nm-ifnet-connection.c
+@@ -71,12 +71,14 @@ nm_ifnet_connection_new (gchar * conn_name)
+ {
+ NMConnection *tmp;
+ GObject *object;
+- GError **error = NULL;
++ GError *error = NULL;
+
+ g_return_val_if_fail (conn_name != NULL, NULL);
+- tmp = ifnet_update_connection_from_config_block (conn_name, error);
+- if (!tmp)
++ tmp = ifnet_update_connection_from_config_block (conn_name, &error);
++ if (!tmp){
++ g_error_free (error);
+ return NULL;
++ }
+ object = (GObject *) g_object_new (NM_TYPE_IFNET_CONNECTION,
+ NM_IFNET_CONNECTION_CONN_NAME,
+ conn_name, NULL);
+diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c
+index 5e94108..42c52c3 100644
+--- a/system-settings/plugins/ifnet/wpa_parser.c
++++ b/system-settings/plugins/ifnet/wpa_parser.c
+@@ -366,7 +366,7 @@ wpa_flush_to_file (gchar * config_file)
+ gboolean result = FALSE;
+
+ if (!wpa_parser_data_changed)
+- return FALSE;
++ return TRUE;
+ if (!wsec_table || !wsec_global_table)
+ return FALSE;
+
+@@ -450,26 +450,29 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * value)
+ {
+ gpointer orig_key = NULL, orig_value = NULL;
+ GHashTable *security = g_hash_table_lookup (wsec_table, ssid);
++ gchar *new_value = NULL;
+
+ g_return_if_fail (security != NULL);
+
++ if (value){
++ new_value = g_strdup(value);
++ if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0
++ && !g_str_has_prefix (key, "wep_key"))
++ strip_string (new_value, '"');
++ }
+ /* Remove old key value pairs */
+ if (g_hash_table_lookup_extended
+ (security, key, &orig_key, &orig_value)) {
++ if (new_value && !strcmp(orig_value, new_value))
++ return;
+ g_hash_table_remove (security, orig_key);
+ g_free (orig_key);
+ g_free (orig_value);
+ }
+
+ /* Add new key value */
+- if (value) {
+- gchar *new_value = g_strdup (value);
+-
+- if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0
+- && !g_str_has_prefix (key, "wep_key"))
+- strip_string (new_value, '"');
++ if (new_value)
+ g_hash_table_insert (security, g_strdup (key), new_value);
+- }
+ wpa_parser_data_changed = TRUE;
+ }
+
+@@ -483,7 +486,7 @@ gboolean
+ wpa_add_security (gchar * ssid)
+ {
+ if (wpa_has_security (ssid))
+- return FALSE;
++ return TRUE;
+ else {
+ GHashTable *security =
+ g_hash_table_new (g_str_hash, g_str_equal);
+--
+1.7.3.4
+
diff --git a/net-misc/networkmanager/networkmanager-0.8.4.0.ebuild b/net-misc/networkmanager/networkmanager-0.8.4.0-r1.ebuild
index 6a5ef6db630f..4f7a00cd385b 100644
--- a/net-misc/networkmanager/networkmanager-0.8.4.0.ebuild
+++ b/net-misc/networkmanager/networkmanager-0.8.4.0-r1.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.4.0.ebuild,v 1.1 2011/05/18 09:23:32 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.4.0-r1.ebuild,v 1.1 2011/05/18 11:20:12 qiaomuf Exp $
EAPI="2"
-inherit eutils gnome.org linux-info
+inherit autotools eutils gnome.org linux-info
# NetworkManager likes itself with capital letters
MY_PN=${PN/networkmanager/NetworkManager}
@@ -79,8 +79,13 @@ pkg_setup() {
fi
}
-#src_prepare() {
-#}
+src_prepare() {
+ # backported ifnet patches
+ epatch "${FILESDIR}/${P}-shared-connection.patch"
+ epatch "${FILESDIR}/${P}-fix-tests.patch"
+ epatch "${FILESDIR}/${P}-ifnet-smarter-write.patch"
+ eautoreconf
+}
src_configure() {
ECONF="--disable-more-warnings