diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-09-13 09:54:12 +0000 |
---|---|---|
committer | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-09-13 09:54:12 +0000 |
commit | 5eeaf3a45ae46e3baa32b714212e9f0fa3d61623 (patch) | |
tree | 96ad8d7693257f226ca3f5fa788b4a49e005a45a /net-misc/networkmanager | |
parent | Version bump with lots of SMS fixes and improved hardware support. Drop old. (diff) | |
download | historical-5eeaf3a45ae46e3baa32b714212e9f0fa3d61623.tar.gz historical-5eeaf3a45ae46e3baa32b714212e9f0fa3d61623.tar.bz2 historical-5eeaf3a45ae46e3baa32b714212e9f0fa3d61623.zip |
Version bump with various fixes. No longer saves thousands of temporary ipv6 routes (bug #428274, thanks to Matthias Nagel). No longer installs dispatcher and init scripts when USE=systemd to avoid annoying systemd users (bug #434692, thanks to Arne Stäcker). Drop old.
Package-Manager: portage-2.2.0_alpha125/cvs/Linux x86_64
Diffstat (limited to 'net-misc/networkmanager')
21 files changed, 231 insertions, 1443 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog index ffdaf1b383be..4298551de6cb 100644 --- a/net-misc/networkmanager/ChangeLog +++ b/net-misc/networkmanager/ChangeLog @@ -1,6 +1,32 @@ # 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.144 2012/08/23 21:00:14 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.145 2012/09/13 09:54:12 tetromino Exp $ + +*networkmanager-0.9.6.0 (13 Sep 2012) + + 13 Sep 2012; Alexandre Rostovtsev <tetromino@gentoo.org> + -files/10-openrc-status-r1, -networkmanager-0.8-r1.ebuild, + -files/networkmanager-0.8-confchanges.patch, + -files/networkmanager-0.8-nscd-clear-cache.patch, + -files/networkmanager-0.8-read-hostname.patch, -networkmanager-0.9.0.ebuild, + -files/networkmanager-0.9.1.95-force-libnl1.1.patch, + -networkmanager-0.9.2.0-r5.ebuild, + -files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch, + -files/networkmanager-0.9.2.0-ifnet-openrc-style.patch, + -files/networkmanager-0.9.2.0-ifnet-password-truncated.patch, + -files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch, + -files/networkmanager-0.9.2.0-ifnet-unquote-hostname.patch, + -files/networkmanager-0.9.2.0-init-provide-net.patch, + +networkmanager-0.9.6.0.ebuild, + +files/networkmanager-0.9.6.0-cached-ipv6-routes-1.patch, + +files/networkmanager-0.9.6.0-cached-ipv6-routes-2.patch, + +files/networkmanager-0.9.6.0-daemon-signals.patch, + -files/NetworkManagerDispatcher, -files/nm-system-settings.conf, + metadata.xml: + Version bump with various fixes. No longer saves thousands of temporary ipv6 + routes (bug #428274, thanks to Matthias Nagel). No longer installs dispatcher + and init scripts when USE=systemd to avoid annoying systemd users (bug + #434692, thanks to Arne Stäcker). Drop old. 23 Aug 2012; Markus Meier <maekke@gentoo.org> networkmanager-0.9.4.0-r6.ebuild: diff --git a/net-misc/networkmanager/files/10-openrc-status-r1 b/net-misc/networkmanager/files/10-openrc-status-r1 deleted file mode 100644 index 53716b1b8478..000000000000 --- a/net-misc/networkmanager/files/10-openrc-status-r1 +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012 Alexandre Rostovtsev -# Released under the 2-clause BSD license. - -# Ensures that the NetworkManager OpenRC service is marked as started and -# providing net only when it has a successful connection. - -# Ensure rc-service is in PATH -PATH="${PATH}:@EPREFIX@/sbin:@EPREFIX@/usr/sbin" - -# Exit if the NetworkManager OpenRC service is not running -rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0 - -# Call rc-service in background mode so that the start/stop functions update -# NetworkManager service status to started or inactive instead of actually -# starting or stopping the daemon -export IN_BACKGROUND=YES - -case "$2" in - up) nm-online -t 0 && exec rc-service NetworkManager start ;; - down) nm-online -t 0 || exec rc-service NetworkManager stop ;; - pre-sleep) exec rc-service NetworkManager stop ;; -esac diff --git a/net-misc/networkmanager/files/NetworkManagerDispatcher b/net-misc/networkmanager/files/NetworkManagerDispatcher deleted file mode 100644 index 24aa37b97f69..000000000000 --- a/net-misc/networkmanager/files/NetworkManagerDispatcher +++ /dev/null @@ -1,48 +0,0 @@ -#!/sbin/runscript -# -# NetworkManagerDispatcher: NetworkManagerDispatcher daemon -# -# chkconfig: 345 98 02 -# description: This is a daemon for automatically executing certain -# actions, when switching networks -# -# processname: NetworkManagerDispatcher -# pidfile: /var/run/NetworkManagerDispatcher.pid - -prefix=/usr -exec_prefix=/usr -sbindir=${exec_prefix}/sbin - -NETWORKMANAGERDISPATCHER_BIN=${sbindir}/NetworkManagerDispatcher - -# Sanity checks. -[ -x $NETWORKMANAGERDISPATCHER_BIN ] || exit 0 - -# so we can rearrange this easily -processname=$NETWORKMANAGERDISPATCHER_BIN -pidfile=/var/run/NetworkManagerDispatcher.pid - -depend() { - need NetworkManager -} - -start() -{ - if [ -e ${pidfile} ]; then - rm -f ${pidfile} - fi - ebegin "Starting NetworkManagerDispatcher" - start-stop-daemon --start --quiet --exec ${processname} - eend $? - echo $(/bin/pidof NetworkManagerDispatcher) > ${pidfile} -} - -stop() -{ - ebegin "Stopping NetworkManagerDispatcher" - start-stop-daemon --stop --quiet --exec ${processname} --pidfile ${pidfile} - eend $? - if [ -e ${pidfile} ]; then - rm -f $pidfile - fi -} diff --git a/net-misc/networkmanager/files/networkmanager-0.8-confchanges.patch b/net-misc/networkmanager/files/networkmanager-0.8-confchanges.patch deleted file mode 100644 index 039a074f724f..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.8-confchanges.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN NetworkManager-0.8.orig/src/NetworkManager.conf NetworkManager-0.8/src/NetworkManager.conf ---- NetworkManager-0.8.orig/src/NetworkManager.conf 2010-02-18 10:47:45.000000000 -0500 -+++ NetworkManager-0.8/src/NetworkManager.conf 2010-03-30 11:27:27.751522916 -0400 -@@ -56,6 +56,15 @@ - - <allow send_destination="org.freedesktop.NetworkManager" - send_interface="org.freedesktop.NetworkManager.VPN.Connection"/> -+ -+ <allow send_destination="org.freedesktop.NetworkManager" -+ send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/> -+ </policy> -+ <policy group="plugdev"> -+ <allow send_destination="org.freedesktop.NetworkManager"/> -+ -+ <deny send_destination="org.freedesktop.NetworkManager" -+ send_interface="org.freedesktop.NetworkManager.PPP"/> - </policy> - <policy context="default"> - <deny own="org.freedesktop.NetworkManager"/> diff --git a/net-misc/networkmanager/files/networkmanager-0.8-nscd-clear-cache.patch b/net-misc/networkmanager/files/networkmanager-0.8-nscd-clear-cache.patch deleted file mode 100644 index e92c883c2cb8..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.8-nscd-clear-cache.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 327e00f06358ef388f4fad5abcb016daa0ec3452 Mon Sep 17 00:00:00 2001 -From: Robert Piasek <dagger@gentoo.org> -Date: Mon, 22 Feb 2010 10:34:23 +0000 -Subject: [PATCH] fix: use nscd -i to clear cache - - -Signed-off-by: Robert Piasek <dagger@gentoo.org> ---- - src/backends/NetworkManagerGentoo.c | 11 +++++------ - 1 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c -index 7fa1207..aa4b40c 100644 ---- a/src/backends/NetworkManagerGentoo.c -+++ b/src/backends/NetworkManagerGentoo.c -@@ -34,6 +34,7 @@ - #include "NetworkManagerGeneric.h" - #include "NetworkManagerSystem.h" - #include "NetworkManagerUtils.h" -+#include "nm-utils.h" - - /* - * nm_system_enable_loopback -@@ -57,11 +58,9 @@ void nm_system_enable_loopback (void) - */ - void nm_system_update_dns (void) - { -- #ifdef NM_NO_NAMED -- if (nm_spawn_process ("/etc/init.d/nscd status") == 0) -- nm_spawn_process ("/etc/init.d/nscd restart"); -- #else -- nm_spawn_process("/usr/bin/killall -q nscd"); -- #endif -+ if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { -+ nm_info ("Clearing nscd hosts cache."); -+ nm_spawn_process ("/usr/sbin/nscd -i hosts"); -+ } - } - --- -1.7.0 - diff --git a/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch b/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch deleted file mode 100644 index ac59fe26ca26..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch +++ /dev/null @@ -1,76 +0,0 @@ -When reading hostname from NM keyfile, if no hostname is set, read from the -system file at /etc/conf.d/hostname to set hostname. This patch is not meant to -be ever upstreamed. Proper fix is to write a gentoo-specific ifcfg plugin. - -To change hostname, touch nm-system-settings.conf, which will reload the keyfile -and cause /etc/conf.d/hostname to be reloaded. - -This horrible hack fixes http://bugs.gentoo.org/176873 - -Author: Nirbheek Chauhan <nirbheek@gentoo.org> -Reviewed-by: Arun Raghavan <ford_prefect@gentoo.org> - ---- ---- system-settings/plugins/keyfile/plugin.c -+++ system-settings/plugins/keyfile/plugin.c -@@ -43,6 +43,9 @@ - #define KEYFILE_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." - - #define CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" -+#ifdef TARGET_GENTOO -+#define HOSTNAME_FILE SYSCONFDIR "/conf.d/hostname" -+#endif - - static char *plugin_get_hostname (SCPluginKeyfile *plugin); - static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); -@@ -381,6 +384,12 @@ - GKeyFile *key_file; - char *hostname = NULL; - GError *error = NULL; -+#ifdef TARGET_GENTOO -+ char *contents = NULL; -+ char **lines = NULL, **line; -+ GError *contents_err = NULL; -+ gsize contents_len = 0; -+#endif - - key_file = g_key_file_new (); - if (g_key_file_load_from_file (key_file, CONF_FILE, G_KEY_FILE_NONE, &error)) -@@ -392,7 +401,37 @@ - - g_key_file_free (key_file); - -+ if (hostname) -+ goto out; -+#ifdef TARGET_GENTOO -+ /* If hostname is unset in keyfile, read system file to get hostname */ -+ if (!g_file_get_contents (HOSTNAME_FILE, &contents, -+ &contents_len, &contents_err)) -+ goto out; -+ -+ lines = g_strsplit_set (contents, "\n\r", 0); -+ if (!lines) -+ goto out; -+ -+ for (line = lines; *line; line++) { -+ if (!g_str_has_prefix (*line, "hostname=")) -+ continue; -+ hostname = g_strsplit_set (g_strsplit_set (*line, "=", 0)[1], "#", 0)[0]; -+ g_strstrip (hostname); -+ if (!hostname) -+ goto out; -+ /* Remove quotes surrounding hostname */ -+ if (hostname[0] == '"' && hostname[strlen(hostname)-1] == '"') -+ contents = g_strndup(&hostname[1], strlen(hostname)-2); -+ /* Un-escape before using to imitate librc behaviour */ -+ hostname = g_strcompress (contents); -+ } -+ -+out: -+ g_error_free(contents_err); -+ - return hostname; -+#endif - } - - static gboolean diff --git a/net-misc/networkmanager/files/networkmanager-0.9.1.95-force-libnl1.1.patch b/net-misc/networkmanager/files/networkmanager-0.9.1.95-force-libnl1.1.patch deleted file mode 100644 index 8eb66efe9eaf..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.1.95-force-libnl1.1.patch +++ /dev/null @@ -1,47 +0,0 @@ -Build against libnl:1.1 only. Otherwise, networkmanager will link to -libnl-3.so and to libiWmxSdk (from wimax-1.5.2) which links to libnl.so, -and then explode spectacularly at runtime due to symbol collisions. - -diff --git a/configure.ac b/configure.ac -index 75b9978..6761832 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -314,32 +314,13 @@ fi - AC_DEFINE_UNQUOTED(NO_CONSOLEKIT, $no_ck, [Define to disable use of ConsoleKit]) - - have_libnl="no" --PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl3=yes], [have_libnl3=no]) --PKG_CHECK_MODULES(LIBNL_ROUTE3, libnl-route-3.0, [have_libnl_route3=yes], [have_libnl_route3=no]) --if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes"); then -- AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support]) -- LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS" -- LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS" -- libnl_version="3" -+PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0-pre8, [have_libnl1=yes], [have_libnl1=no]) -+if (test "${have_libnl1}" = "yes"); then -+ AC_DEFINE(HAVE_LIBNL1, 1, [Define if you require libnl-1 legacy support]) -+ LIBNL_CFLAGS="$LIBNL1_CFLAGS" -+ LIBNL_LIBS="$LIBNL1_LIBS" -+ libnl_version="1" - have_libnl="yes" --else -- PKG_CHECK_MODULES(LIBNL2, libnl-2.0, [have_libnl2=yes], [have_libnl2=no]) -- if (test "${have_libnl2}" = "yes"); then -- AC_DEFINE(HAVE_LIBNL2, 1, [Define if you require specific libnl-2 support]) -- LIBNL_CFLAGS="$LIBNL2_CFLAGS" -- LIBNL_LIBS="$LIBNL2_LIBS" -- libnl_version="2" -- have_libnl="yes" -- else -- PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0-pre8, [have_libnl1=yes], [have_libnl1=no]) -- if (test "${have_libnl1}" = "yes"); then -- AC_DEFINE(HAVE_LIBNL1, 1, [Define if you require libnl-1 legacy support]) -- LIBNL_CFLAGS="$LIBNL1_CFLAGS" -- LIBNL_LIBS="$LIBNL1_LIBS" -- libnl_version="1" -- have_libnl="yes" -- fi -- fi - fi - - if (test "${have_libnl}" = "no"); then diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch deleted file mode 100644 index 73dc477c5a4c..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 022508394484dd1c66a57be565a2f9aa791f7a2f Mon Sep 17 00:00:00 2001 -From: Mu Qiao <qiaomuf@gentoo.org> -Date: Thu, 15 Dec 2011 10:01:50 +0800 -Subject: [PATCH 3/3] ifnet: ignore per-user connections - ---- - src/settings/plugins/ifnet/plugin.c | 46 +++++++++++++++++++++++++++++++---- - 1 files changed, 41 insertions(+), 5 deletions(-) - -diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c -index 5908368..14f2a90 100644 ---- a/src/settings/plugins/ifnet/plugin.c -+++ b/src/settings/plugins/ifnet/plugin.c -@@ -180,7 +180,7 @@ monitor_file_changes (const char *filename, - /* Callback for nm_settings_connection_replace_and_commit. Report any errors - * encountered when commiting connection settings updates. */ - static void --commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused) -+commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused) - { - if (error) { - PLUGIN_WARN (IFNET_PLUGIN_NAME, " error updating: %s", -@@ -317,6 +317,26 @@ reload_connections (gpointer config) - g_list_free (conn_names); - } - -+static void -+check_flagged_secrets (NMSetting *setting, -+ const char *key, -+ const GValue *value, -+ GParamFlags flags, -+ gpointer user_data) -+{ -+ gboolean *is_system_secret = user_data; -+ -+ if (flags & NM_SETTING_PARAM_SECRET) { -+ NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE; -+ -+ nm_setting_get_secret_flags (setting, key, &secret_flags, NULL); -+ -+ if (secret_flags != NM_SETTING_SECRET_FLAG_NONE) { -+ *is_system_secret = TRUE; -+ } -+ } -+} -+ - static NMSettingsConnection * - add_connection (NMSystemConfigInterface *config, - NMConnection *source, -@@ -324,11 +344,27 @@ add_connection (NMSystemConfigInterface *config, - { - NMIfnetConnection *connection = NULL; - char *conn_name; -+ gboolean has_flagged_secrets = FALSE; -+ NMSettingConnection *settings = NM_SETTING_CONNECTION ( -+ nm_connection_get_setting (source, NM_TYPE_SETTING_CONNECTION)); -+ -+ g_assert (settings); -+ /* If the connection is not available for all users, ignore -+ * it as this plugin only deals with System Connections */ -+ if (nm_setting_connection_get_num_permissions (settings)) -+ return NULL; -+ -+ /* If the connection has flagged secrets, ignore -+ * it as this plugin does not deal with user agent service */ -+ nm_connection_for_each_setting_value (source, check_flagged_secrets, &has_flagged_secrets); -+ -+ if (!has_flagged_secrets) { -+ conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error); -+ if (conn_name) -+ connection = nm_ifnet_connection_new (conn_name, source); -+ reload_connections (config); -+ } - -- conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error); -- if (conn_name) -- connection = nm_ifnet_connection_new (conn_name, source); -- reload_connections (config); - return connection ? NM_SETTINGS_CONNECTION (connection) : NULL; - } - --- -1.7.3.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-openrc-style.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-openrc-style.patch deleted file mode 100644 index e89ec74adb34..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-openrc-style.patch +++ /dev/null @@ -1,596 +0,0 @@ -From c5f080923f0c52084a929b4125e8fbe19f6e7279 Mon Sep 17 00:00:00 2001 -From: Mu Qiao <qiaomuf@gentoo.org> -Date: Tue, 6 Dec 2011 14:55:03 +0800 -Subject: [PATCH] ifnet: support reading openrc style - -IP configuration like 192.168.1.{2..4} is not supported anymore. ---- - src/settings/plugins/ifnet/connection_parser.c | 14 +- - src/settings/plugins/ifnet/net_parser.c | 84 ++++++++++---- - src/settings/plugins/ifnet/net_utils.c | 144 ++++++++++-------------- - src/settings/plugins/ifnet/tests/net | 11 ++- - src/settings/plugins/ifnet/tests/test_all.c | 30 ++++- - 5 files changed, 163 insertions(+), 120 deletions(-) - -diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c -index b4aaa8d..66ce318 100644 ---- a/src/settings/plugins/ifnet/connection_parser.c -+++ b/src/settings/plugins/ifnet/connection_parser.c -@@ -567,7 +567,7 @@ make_wired_connection_setting (NMConnection *connection, - nm_connection_add_setting (connection, NM_SETTING (s_wired)); - } - --/* add NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, -+/* add NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, - * NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID in future*/ - static void - make_ip4_setting (NMConnection *connection, -@@ -596,19 +596,19 @@ make_ip4_setting (NMConnection *connection, - g_object_unref (ip4_setting); - return; - } -- if (!strcmp (method, "dhcp")) -+ if (strstr (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")){ -+ else if (strstr (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")){ -+ } else if (strstr (method, "shared")){ - g_object_set (ip4_setting, - NM_SETTING_IP4_CONFIG_METHOD, - NM_SETTING_IP4_CONFIG_METHOD_SHARED, -@@ -663,7 +663,7 @@ make_ip4_setting (NMConnection *connection, - } - - /* add dhcp hostname and client id */ -- if (!is_static_block && !strcmp (method, "dhcp")) { -+ if (!is_static_block && strstr (method, "dhcp")) { - gchar *dhcp_hostname, *client_id; - - get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id); -@@ -868,7 +868,7 @@ make_ip6_setting (NMConnection *connection, - nm_ip6_route_set_dest (route, iblock->ip); - nm_ip6_route_set_next_hop (route, iblock->next_hop); - nm_ip6_route_set_prefix (route, iblock->prefix); -- /* metric is not per routes configuration right now -+ /* metric is not per routes configuration right now - * global metric is also supported (metric="x") */ - if ((metric_str = ifnet_get_data (conn_name, "metric")) != NULL) { - metric = strtol (metric_str, NULL, 10); -@@ -995,7 +995,7 @@ make_wireless_connection_setting (const char *conn_name, - goto error; - } - -- /* mode=0: infrastructure -+ /* mode=0: infrastructure - * mode=1: adhoc */ - value = wpa_get_value (conn_name, "mode"); - if (value) -diff --git a/src/settings/plugins/ifnet/net_parser.c b/src/settings/plugins/ifnet/net_parser.c -index a48103d..4befc37 100644 ---- a/src/settings/plugins/ifnet/net_parser.c -+++ b/src/settings/plugins/ifnet/net_parser.c -@@ -169,12 +169,10 @@ init_block_by_line (gchar * buf) - conn = add_new_connection_config ("wireless", pos); - } - data = g_strdup (key_value[1]); -- tmp = strip_string (data, '('); -- tmp = strip_string (tmp, ')'); -- strip_string (tmp, '"'); -+ tmp = strip_string (data, '"'); - strip_string (tmp, '\''); - if (conn) -- g_hash_table_insert (conn, g_strdup (key_value[0]), -+ g_hash_table_insert (conn, strip_string (g_strdup (key_value[0]), ' '), - g_strdup (tmp)); - g_free (data); - g_strfreev (key_value); -@@ -283,6 +281,22 @@ is_function (gchar * line) - return FALSE; - } - -+static void -+append_line (GString *buf, gchar* line) -+{ -+ gchar *pos = NULL; -+ -+ if ((pos = strchr (line, '#')) != NULL) -+ *pos = '\0'; -+ g_strstrip (line); -+ -+ if (line[0] != '\0') { -+ g_string_append_printf (buf, -+ " %s", line); -+ } -+ g_free (line); -+} -+ - gboolean - ifnet_init (gchar * config_file) - { -@@ -292,6 +306,8 @@ ifnet_init (gchar * config_file) - /* Handle multiple lines with brackets */ - gboolean complete = TRUE; - -+ gboolean openrc_style = TRUE; -+ - /* line buffer */ - GString *buf; - -@@ -319,36 +335,60 @@ ifnet_init (gchar * config_file) - strip_function (channel, line); - continue; - } -- if (line[0] != '#' && line[0] != '\0') { -- gchar *pos = NULL; - -+ // New openrc style, bash arrays are not allowed. We only care about '"' -+ if (openrc_style && line[0] != '#' && line[0] != '\0' -+ && !strchr (line, '(') && !strchr (line, ')')) { -+ gchar *tmp = line; -+ -+ while ((tmp = strchr (tmp, '"')) != NULL) { -+ complete = !complete; -+ ++tmp; -+ } -+ -+ append_line (buf, line); -+ // Add "(separator) for routes. It will be easier for later parsing -+ if (strstr (buf->str, "via")) -+ g_string_append_printf (buf, "\""); -+ -+ if (!complete) -+ continue; -+ -+ strip_string (buf->str, '"'); -+ -+ init_block_by_line (buf->str); -+ g_string_free (buf, TRUE); -+ buf = g_string_new (NULL); -+ } -+ // Old bash arrays for baselayout-1, to be deleted -+ else if (line[0] != '#' && line[0] != '\0') { - if (!complete) { - complete = - g_strrstr (line, - ")") == NULL ? FALSE : TRUE; -- if ((pos = strchr (line, '#')) != NULL) -- *pos = '\0'; -- g_strstrip (line); -- if (line[0] != '\0') { -- g_string_append_printf (buf, -- " %s", line); -- } -- g_free (line); -- if (!complete) -+ -+ append_line (buf, line); -+ if (!complete) { -+ openrc_style = FALSE; - continue; -+ } -+ else { -+ openrc_style = TRUE; -+ } - } else { - complete = - (g_strrstr (line, "(") != NULL - && g_strrstr (line, ")") != NULL) - || g_strrstr (line, "(") == NULL; -- if ((pos = strchr (line, '#')) != NULL) -- *pos = '\0'; -- g_strstrip (line); -- if (line[0] != '\0') -- g_string_append (buf, line); -- g_free (line); -+ -+ append_line (buf, line); - if (!complete) -+ { -+ openrc_style = FALSE; - continue; -+ } else { -+ openrc_style = TRUE; -+ } - } - init_block_by_line (buf->str); - g_string_free (buf, TRUE); -@@ -391,7 +431,7 @@ ifnet_set_data (const char *conn_name, const char *key, const char *value) - } - /* Remove existing key value pair */ - if (g_hash_table_lookup_extended (conn, key, &old_key, &old_value)) { -- if (stripped && !strcmp(old_value, stripped)){ -+ if (stripped && !strcmp (old_value, stripped)){ - g_free (stripped); - return; - } -diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c -index b533ae3..fc7e283 100644 ---- a/src/settings/plugins/ifnet/net_utils.c -+++ b/src/settings/plugins/ifnet/net_utils.c -@@ -352,6 +352,49 @@ is_ip6_address (const char *in_address) - - } - -+// 'c' is only used for openrc style -+static gchar ** -+split_addresses_by_char (const gchar *addresses, const gchar *c) -+{ -+ gchar **ipset; -+ -+ if (addresses == NULL) -+ return NULL; -+ -+ if (strchr (addresses, '(') != NULL) { // old baselayout style -+ gchar *tmp = g_strdup (addresses); -+ strip_string (tmp, '('); -+ strip_string (tmp, ')'); -+ strip_string (tmp, '"'); -+ strip_string (tmp, '\''); -+ ipset = g_strsplit (tmp, "\" \"", 0); -+ g_free(tmp); -+ } else { // openrc style -+ if (strstr (addresses, "netmask")) -+ // There is only one ip address if "netmask" is specified. -+ // '\n' is not used in config so there will be only one split. -+ ipset = g_strsplit (addresses, "\n", 0); -+ else -+ ipset = g_strsplit (addresses, c, 0); -+ } -+ -+ return ipset; -+} -+ -+static gchar ** -+split_addresses (const gchar* addresses) -+{ -+ // " " is only used by openrc style -+ return split_addresses_by_char (addresses, " "); -+} -+ -+static gchar ** -+split_routes (const gchar* routes) -+{ -+ // "\"" is only used by openrc style -+ return split_addresses_by_char (routes, "\""); -+} -+ - gboolean - has_ip6_address (const char *conn_name) - { -@@ -360,7 +403,7 @@ has_ip6_address (const char *conn_name) - guint i; - - g_return_val_if_fail (conn_name != NULL, FALSE); -- ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); -+ ipset = split_addresses (ifnet_get_data (conn_name, "config")); - length = g_strv_length (ipset); - for (i = 0; i < length; i++) { - if (!is_ip6_address (ipset[i])) -@@ -512,8 +555,11 @@ get_ip4_gateway (gchar * gateway) - tmp = g_strdup (tmp); - strip_string (tmp, ' '); - strip_string (tmp, '"'); -+ -+ // Only one gateway is selected - if ((split = strstr (tmp, "\"")) != NULL) - *split = '\0'; -+ - if (!inet_pton (AF_INET, tmp, &tmp_ip4_addr)) - goto error; - g_free (tmp); -@@ -567,14 +613,11 @@ convert_ip4_config_block (const char *conn_name) - gchar *ip; - guint32 def_gateway = 0; - const char *routes; -- gchar *pos; - ip_block *start = NULL, *current = NULL, *iblock = NULL; -- const char *pattern = -- "((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.)\\{(\\d{1,3})\\.\\.(\\d{1,3})\\}(/\\d{1,2}))"; - - g_return_val_if_fail (conn_name != NULL, NULL); - -- ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); -+ ipset = split_addresses (ifnet_get_data (conn_name, "config")); - length = g_strv_length (ipset); - - routes = ifnet_get_data (conn_name, "routes"); -@@ -584,73 +627,16 @@ convert_ip4_config_block (const char *conn_name) - for (i = 0; i < length; i++) { - ip = ipset[i]; - ip = strip_string (ip, '"'); -- //Handle ip like 192.168.4.{1..3} -- if ((pos = strchr (ip, '{')) != NULL) { -- gchar *ip_start, *ip_prefix; -- gchar *begin_str, *end_str; -- int begin, end, j; -- GRegex *regex; -- GMatchInfo *match_info; -- -- regex = g_regex_new (pattern, 0, 0, NULL); -- g_regex_match (regex, ip, 0, &match_info); -- g_regex_unref (regex); -- -- if (!g_match_info_matches (match_info)) { -- g_match_info_free (match_info); -- continue; -- } -- begin_str = g_match_info_fetch (match_info, 3); -- end_str = g_match_info_fetch (match_info, 4); -- begin = atoi (begin_str); -- end = atoi (end_str); -- ip_start = g_match_info_fetch (match_info, 2); -- ip_prefix = g_match_info_fetch (match_info, 5); -- if (end < begin || begin < 1 || end > 254) { -- g_match_info_free (match_info); -- continue; -- } -- -- for (j = begin; j <= end; j++) { -- char suf[4]; -- gchar *newip; -- -- sprintf (suf, "%d", j); -- newip = -- g_strconcat (ip_start, suf, ip_prefix, -- NULL); -- iblock = create_ip4_block (newip); -- if (iblock == NULL) { -- g_free (newip); -- continue; -- } -- if (!iblock->gateway && def_gateway != 0) -- iblock->gateway = def_gateway; -- if (start == NULL) -- start = current = iblock; -- else { -- current->next = iblock; -- current = iblock; -- } -- g_free (newip); -- } -- g_free (begin_str); -- g_free (end_str); -- g_free (ip_start); -- g_free (ip_prefix); -- g_match_info_free (match_info); -- } else { -- iblock = create_ip4_block (ip); -- if (iblock == NULL) -- continue; -- if (!iblock->gateway && def_gateway != 0) -- iblock->gateway = def_gateway; -- if (start == NULL) -- start = current = iblock; -- else { -- current->next = iblock; -- current = iblock; -- } -+ iblock = create_ip4_block (ip); -+ if (iblock == NULL) -+ continue; -+ if (!iblock->gateway && def_gateway != 0) -+ iblock->gateway = def_gateway; -+ if (start == NULL) -+ start = current = iblock; -+ else { -+ current->next = iblock; -+ current = iblock; - } - } - g_strfreev (ipset); -@@ -667,7 +653,7 @@ convert_ip6_config_block (const char *conn_name) - ip6_block *start = NULL, *current = NULL, *iblock = NULL; - - g_return_val_if_fail (conn_name != NULL, NULL); -- ipset = g_strsplit (ifnet_get_data (conn_name, "config"), "\" \"", 0); -+ ipset = split_addresses (ifnet_get_data (conn_name, "config")); - length = g_strv_length (ipset); - for (i = 0; i < length; i++) { - ip = ipset[i]; -@@ -693,15 +679,11 @@ convert_ip4_routes_block (const char *conn_name) - guint length; - guint i; - gchar *ip; -- const char *routes; - ip_block *start = NULL, *current = NULL, *iblock = NULL; - - g_return_val_if_fail (conn_name != NULL, NULL); - -- routes = ifnet_get_data (conn_name, "routes"); -- if (!routes) -- return NULL; -- ipset = g_strsplit (routes, "\" \"", 0); -+ ipset = split_routes (ifnet_get_data (conn_name, "routes")); - length = g_strv_length (ipset); - for (i = 0; i < length; i++) { - ip = ipset[i]; -@@ -731,15 +713,11 @@ convert_ip6_routes_block (const char *conn_name) - guint length; - guint i; - gchar *ip, *tmp_addr; -- const char *routes; - ip6_block *start = NULL, *current = NULL, *iblock = NULL; - struct in6_addr *tmp_ip6_addr; - - g_return_val_if_fail (conn_name != NULL, NULL); -- routes = ifnet_get_data (conn_name, "routes"); -- if (!routes) -- return NULL; -- ipset = g_strsplit (routes, "\" \"", 0); -+ ipset = split_routes (ifnet_get_data (conn_name, "routes")); - length = g_strv_length (ipset); - for (i = 0; i < length; i++) { - ip = ipset[i]; -diff --git a/src/settings/plugins/ifnet/tests/net b/src/settings/plugins/ifnet/tests/net -index 0eef399..27d39f4 100644 ---- a/src/settings/plugins/ifnet/tests/net -+++ b/src/settings/plugins/ifnet/tests/net -@@ -27,10 +27,9 @@ config_eth2=( - routes_eth2=("default via 4321:0:1:2:3:4:567:89ab") - enable_ipv6_eth2="true" - config_eth3=("nufjlsjlll") --managed_eth4=("false") -+managed_eth4="false" - routes_eth4=("default via 4321:0:1:2:3:4:567:89ab") - config_eth5=("dhcp") --config_eth6=("192.168.4.{1..101}/24") - - config_eth7=( "dhcp" ) - auto_eth7="true" -@@ -38,6 +37,14 @@ auto_eth7="true" - # missing config_eth8 - auto_eth8="true" - -+#new openrc style -+config_eth9="202.117.16.10/24 202.117.17.10/24" -+routes_eth9="default via 202.117.16.1 -+10.0.0.0/8 via 192.168.0.1 -+" -+config_eth10="202.117.16.2 netmask 255.255.255.0" -+routes_eth10="10.0.0.0/8 via 192.168.0.1" -+ - config_myxjtu2=("202.117.16.121/24 brd 202.117.16.255") - routes_myxjtu2=("default via 202.117.16.1") - dns_servers_myxjtu2="202.117.0.20 202.117.0.21" -diff --git a/src/settings/plugins/ifnet/tests/test_all.c b/src/settings/plugins/ifnet/tests/test_all.c -index 52d9ce2..9ca5f65 100644 ---- a/src/settings/plugins/ifnet/tests/test_all.c -+++ b/src/settings/plugins/ifnet/tests/test_all.c -@@ -37,7 +37,7 @@ static void - test_getdata () - { - ASSERT (ifnet_get_data ("eth1", "config") -- && strcmp (ifnet_get_data ("eth1", "config"), "dhcp") == 0, -+ && strcmp (ifnet_get_data ("eth1", "config"), "( \"dhcp\" )") == 0, - "get data", "config_eth1 is not correct"); - ASSERT (ifnet_get_data ("ppp0", "username") - && strcmp (ifnet_get_data ("ppp0", "username"), "user") == 0, -@@ -84,7 +84,7 @@ test_is_static () - ASSERT (is_static_ip4 ("eth0") == TRUE, "is static", - "a static interface is recognized as dhcp"); - ASSERT (!is_static_ip6 ("eth0") == TRUE, "is static", -- "a static interface is recognized as dhcp"); -+ "a dhcp interface is recognized as static"); - } - - static void -@@ -182,10 +182,6 @@ test_convert_ipv4_config_block () - ASSERT (iblock == NULL, "convert config_block", - "convert error configuration"); - destroy_ip_block (iblock); -- iblock = convert_ip4_config_block ("eth6"); -- ASSERT (iblock != NULL, "convert config_block", -- "convert error configuration"); -- destroy_ip_block (iblock); - } - - static void -@@ -200,6 +196,16 @@ test_convert_ipv4_routes_block () - destroy_ip_block (tmp); - ASSERT (iblock == NULL, "convert ip4 routes", - "should only get one route"); -+ -+ iblock = convert_ip4_routes_block ("eth9"); -+ tmp = iblock; -+ -+ ASSERT (iblock != NULL, "convert ip4 routes", "should get one route"); -+ check_ip_block (iblock, "10.0.0.0", "255.0.0.0", "192.168.0.1"); -+ iblock = iblock->next; -+ destroy_ip_block (tmp); -+ ASSERT (iblock == NULL, "convert ip4 routes", -+ "should only get one route"); - } - - static void -@@ -272,6 +278,18 @@ test_new_connection () - "new connection failed: %s", - error ? error->message : "NONE"); - g_object_unref (connection); -+ -+ connection = ifnet_update_connection_from_config_block ("eth9", &error); -+ ASSERT (connection != NULL, "new connection", -+ "new connection(eth9) failed: %s", -+ error ? error->message : "NONE"); -+ g_object_unref (connection); -+ -+ connection = ifnet_update_connection_from_config_block ("eth10", &error); -+ ASSERT (connection != NULL, "new connection", -+ "new connection(eth10) failed: %s", -+ error ? error->message : "NONE"); -+ g_object_unref (connection); - } - - #define NET_GEN_NAME "net.generate" --- -1.7.3.4 - -From 73a17edee3ba1f378166e0eee69f25b28902ce8d Mon Sep 17 00:00:00 2001 -From: Mu Qiao <qiaomuf@gentoo.org> -Date: Wed, 7 Dec 2011 10:39:26 +0800 -Subject: [PATCH 2/2] ifnet: support writing for openrc style - ---- - src/settings/plugins/ifnet/net_parser.c | 20 +++++++++++++------- - 1 files changed, 13 insertions(+), 7 deletions(-) - -diff --git a/src/settings/plugins/ifnet/net_parser.c b/src/settings/plugins/ifnet/net_parser.c -index 4befc37..abca89c 100644 ---- a/src/settings/plugins/ifnet/net_parser.c -+++ b/src/settings/plugins/ifnet/net_parser.c -@@ -476,22 +476,28 @@ format_ips (gchar * value, gchar ** out_line, gchar * key, gchar * name) - guint length, i; - GString *formated_string = g_string_new (NULL); - -+ strip_string (value, '('); -+ strip_string (value, ')'); - strip_string (value, '"'); -- ipset = g_strsplit (value, "\" \"", 0); -+ ipset = g_strsplit (value, "\"", 0); - length = g_strv_length (ipset); - - //only one line - if (length < 2) { - *out_line = -- g_strdup_printf ("%s_%s=( \"%s\" )\n", key, name, value); -+ g_strdup_printf ("%s_%s=\"%s\"\n", key, name, value); - goto done; - } - // Multiple lines -- g_string_append_printf (formated_string, "%s_%s=(\n", key, name); -+ g_string_append_printf (formated_string, "%s_%s=\"\n", key, name); - for (i = 0; i < length; i++) -- g_string_append_printf (formated_string, -- "\t\"%s\"\n", ipset[i]); -- g_string_append (formated_string, ")\n"); -+ { -+ strip_string (ipset[i], ' '); -+ if (ipset[i][0] != '\0') -+ g_string_append_printf (formated_string, -+ "%s\n", ipset[i]); -+ } -+ g_string_append (formated_string, "\"\n"); - *out_line = g_strdup (formated_string->str); - done: - g_string_free (formated_string, TRUE); -@@ -506,7 +512,7 @@ ifnet_flush_to_file (const char *config_file) - gpointer key, value, name, network; - GHashTableIter iter, iter_network; - GList *list_iter; -- gchar *out_line; -+ gchar *out_line = NULL; - gsize bytes_written; - gboolean result = FALSE; - --- -1.7.3.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-password-truncated.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-password-truncated.patch deleted file mode 100644 index d41c4b2e07a6..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-password-truncated.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 03d80950e960031af977c3037b57d41e36701fb2 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Sat, 18 Feb 2012 20:03:33 -0500 -Subject: [PATCH] ifnet: do not truncate WPA passwords at '#' character - -We need to do the same thing as wpa_supplicant's own config file parser -and ignore '#' characters that occur between the first and last '"' -characters in a config file line. - -https://bugzilla.gnome.org/show_bug.cgi?id=670381 ---- - src/settings/plugins/ifnet/wpa_parser.c | 13 +++++++++---- - 1 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/settings/plugins/ifnet/wpa_parser.c b/src/settings/plugins/ifnet/wpa_parser.c -index da2bc3b..f7a5b32 100644 ---- a/src/settings/plugins/ifnet/wpa_parser.c -+++ b/src/settings/plugins/ifnet/wpa_parser.c -@@ -279,16 +279,21 @@ wpa_parser_init (const char *wpa_supplicant_conf) - } else { - GHashTable *network = - g_hash_table_new (g_str_hash, g_str_equal); -- gchar *tmp; - - do { -+ gchar *quote_start, *quote_end = NULL, *comment; -+ - if (line[0] == '#' || line[0] == '\0') { - g_free (line); - continue; - } -- /* ignore inline comments */ -- if ((tmp = strchr (line, '#')) != NULL) -- *tmp = '\0'; -+ /* ignore inline comments unless inside -+ a double-quoted string */ -+ if ((quote_start = strchr (line, '"')) != NULL) -+ quote_end = strrchr (quote_start + 1, '"'); -+ if ((comment = strchr ((quote_end != NULL) ? -+ quote_end : line, '#')) != NULL) -+ *comment = '\0'; - if (strstr (line, "}") != NULL) - complete = TRUE; - add_key_value (network, line); --- -1.7.8.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch deleted file mode 100644 index 1dcab2f6e115..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 145f86d0e98f5525e69a86c15be3f932104b5129 Mon Sep 17 00:00:00 2001 -From: Mu Qiao <qiaomuf@gentoo.org> -Date: Thu, 22 Dec 2011 09:57:26 +0800 -Subject: [PATCH 4/4] ifnet: remove system prefix - -As all connections are system connection so the prefix is meaningless. -Drop it now. ---- - po/POTFILES.in | 1 - - src/settings/plugins/ifnet/connection_parser.c | 12 ++---------- - 2 files changed, 2 insertions(+), 11 deletions(-) - -diff --git a/po/POTFILES.in b/po/POTFILES.in -index f021275..20b60d3 100644 ---- a/po/POTFILES.in -+++ b/po/POTFILES.in -@@ -26,6 +26,5 @@ src/nm-device-olpc-mesh.c - src/nm-manager.c - src/nm-netlink-monitor.c - src/settings/plugins/ifcfg-rh/reader.c --src/settings/plugins/ifnet/connection_parser.c - src/settings/nm-settings-utils.c - -diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c -index 66ce318..97bc7ff 100644 ---- a/src/settings/plugins/ifnet/connection_parser.c -+++ b/src/settings/plugins/ifnet/connection_parser.c -@@ -45,12 +45,6 @@ - #include "connection_parser.h" - #include "nm-ifnet-connection.h" - --static const char * --get_prefix (void) --{ -- return _("System"); --} -- - static void - update_connection_id (NMConnection *connection, const char *conn_name) - { -@@ -62,11 +56,9 @@ update_connection_id (NMConnection *connection, const char *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); -+ idstr = utils_hexstr2bin (conn_name + 2, name_len - 2); - } else -- idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name); -+ idstr = g_strdup_printf("%s", conn_name); - uuid_base = idstr; - uuid = nm_utils_uuid_generate_from_string (uuid_base); - setting = --- -1.7.3.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-unquote-hostname.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-unquote-hostname.patch deleted file mode 100644 index e7e6873c29ab..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-unquote-hostname.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8f3c3242a762d77fedd745273a1cdca7f9a2b2f6 Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Tue, 31 Jan 2012 21:10:01 -0500 -Subject: [PATCH] ifnet: properly unquote hostnames with g_shell_unquote() - -If /etc/conf.d/hostname contains "hostname='foo'", then the hostname -needs to be set to "foo", not "'foo'". - -https://bugzilla.gnome.org/show_bug.cgi?id=669148 ---- - src/settings/plugins/ifnet/net_utils.c | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c -index b533ae3..36b465d 100644 ---- a/src/settings/plugins/ifnet/net_utils.c -+++ b/src/settings/plugins/ifnet/net_utils.c -@@ -242,8 +242,7 @@ read_hostname (const char *path) - if (g_str_has_prefix (all_lines[i], "hostname")) { - tmp = strstr (all_lines[i], "="); - tmp++; -- tmp = strip_string (tmp, '"'); -- result = g_strdup (tmp); -+ result = g_shell_unquote (tmp, NULL); - break; - } - --- -1.7.8.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net.patch deleted file mode 100644 index 886fe1a74614..000000000000 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net.patch +++ /dev/null @@ -1,61 +0,0 @@ -From dbb1ed70eca25d57da3c12534c241cd38134627b Mon Sep 17 00:00:00 2001 -From: Alexandre Rostovtsev <tetromino@gentoo.org> -Date: Wed, 1 Feb 2012 05:51:20 -0500 -Subject: [PATCH] gentoo: provide net and use inactive status when not - connected - -The status will be reset to started via a dispatcher script on up/down -events. See https://bugs.gentoo.org/show_bug.cgi?id=252137 ---- - initscript/Gentoo/NetworkManager.in | 24 +++++++++++++++++++++++- - 1 files changed, 23 insertions(+), 1 deletions(-) - -diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in -index 7db410b..d26996d 100755 ---- a/initscript/Gentoo/NetworkManager.in -+++ b/initscript/Gentoo/NetworkManager.in -@@ -3,18 +3,40 @@ - # Distributed under the terms of the GNU General Purpose License v2 - # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net.patch,v 1.1 2012/02/02 00:34:59 tetromino Exp $ - -+description="NetworkManager daemon. The service is marked as started only \ -+when a network connection is established." -+ - depend() { - need dbus -+ provide net -+} -+ -+_is_connected() { -+ [ "x$(LC_ALL=C nmcli -t -f state nm 2> /dev/null)" = "xconnected" ] -+ return $? - } - - start() { -+ if yesno "${IN_BACKGROUND}"; then -+ _is_connected && mark_service_started -+ return -+ fi - ebegin "Starting NetworkManager" - start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \ - --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid -- eend $? -+ local _retval=$? -+ eend "${_retval}" -+ if [ "x${_retval}" = 'x0' ]; then -+ _is_connected || mark_service_inactive -+ fi -+ return "${_retval}" - } - - stop() { -+ if yesno "${IN_BACKGROUND}"; then -+ _is_connected || mark_service_inactive -+ return -+ fi - ebegin "Stopping NetworkManager" - start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid - eend $? --- -1.7.8.4 - diff --git a/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-1.patch b/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-1.patch new file mode 100644 index 000000000000..386f19b9a066 --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-1.patch @@ -0,0 +1,36 @@ +From 3ca3120e4a01ea4a86fd052311c977e7ec136365 Mon Sep 17 00:00:00 2001 +From: Ben Jencks <ben@bjencks.net> +Date: Thu, 30 Aug 2012 13:55:36 -0500 +Subject: [PATCH] ip6: ignore cached/cloned route notifications from the + kernel (lp:1038541) (bgo #671767) + +The kernel periodically adds routes for specific operations, including +when pinging any host. These are temporary routes and aren't part of +the interface's permanent routing configuration, so we should ignore +them. +--- + src/ip6-manager/nm-ip6-manager.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c +index e452c18..3dc8616 100644 +--- a/src/ip6-manager/nm-ip6-manager.c ++++ b/src/ip6-manager/nm-ip6-manager.c +@@ -921,6 +921,14 @@ process_route_change (NMIP6Manager *manager, struct nl_msg *msg) + return NULL; + } + ++ /* Cached/cloned routes are created by the kernel for specific operations ++ * and aren't part of the interface's permanent routing configuration. ++ */ ++ if (rtnl_route_get_flags (rtnlroute) & RTM_F_CLONED) { ++ rtnl_route_put (rtnlroute); ++ return NULL; ++ } ++ + device = nm_ip6_manager_get_device (manager, rtnl_route_get_oif (rtnlroute)); + + old_size = nl_cache_nitems (priv->route_cache); +-- +1.7.12 + diff --git a/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-2.patch b/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-2.patch new file mode 100644 index 000000000000..3c23c2d45c0e --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-0.9.6.0-cached-ipv6-routes-2.patch @@ -0,0 +1,31 @@ +From 46e0af2942e23fb3cf1c313e58e4081877d4f289 Mon Sep 17 00:00:00 2001 +From: Dan Williams <dcbw@redhat.com> +Date: Thu, 30 Aug 2012 13:57:06 -0500 +Subject: [PATCH] ip6: ignore cached/cloned routes when retrieving IPv6 config + (lp:1038541) (bgo #671767) + +Should also ignore them when building up the initial IPv6 config. +--- + src/ip6-manager/nm-ip6-manager.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c +index 3dc8616..4432aa5 100644 +--- a/src/ip6-manager/nm-ip6-manager.c ++++ b/src/ip6-manager/nm-ip6-manager.c +@@ -1531,6 +1531,12 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) + if (rtnl_route_get_family (rtnlroute) != AF_INET6) + continue; + ++ /* And ignore cache/cloned routes as they aren't part of the interface's ++ * permanent routing configuration. ++ */ ++ if (rtnl_route_get_flags (rtnlroute) & RTM_F_CLONED) ++ continue; ++ + nldest = rtnl_route_get_dst (rtnlroute); + if (!nldest || nl_addr_get_family (nldest) != AF_INET6) + continue; +-- +1.7.12 + diff --git a/net-misc/networkmanager/files/networkmanager-0.9.6.0-daemon-signals.patch b/net-misc/networkmanager/files/networkmanager-0.9.6.0-daemon-signals.patch new file mode 100644 index 000000000000..45b2f472f726 --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-0.9.6.0-daemon-signals.patch @@ -0,0 +1,42 @@ +From 24e875ab6cd24deed32fc85639dc0a4b196d1eed Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev <tetromino@gentoo.org> +Date: Thu, 13 Sep 2012 05:32:53 -0400 +Subject: [PATCH] core: wait until we daemonized before setting up signals + (bgo #683932) + +If we mask signals before daemonizing, the daemon process will not be +able to handle them, and thus would be unkillable with anything other +than SIGKILL. +--- + src/main.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/main.c b/src/main.c +index 8bc6d3f..edf4b5f 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -401,10 +401,6 @@ main (int argc, char *argv[]) + exit (1); + } + +- /* Set up unix signal handling */ +- if (!setup_signals ()) +- exit (1); +- + /* Set locale to be able to use environment variables */ + setlocale (LC_ALL, ""); + +@@ -501,6 +497,10 @@ main (int argc, char *argv[]) + wrote_pidfile = TRUE; + } + ++ /* Set up unix signal handling */ ++ if (!setup_signals ()) ++ exit (1); ++ + if (g_fatal_warnings) { + GLogLevelFlags fatal_mask; + +-- +1.7.12 + diff --git a/net-misc/networkmanager/files/nm-system-settings.conf b/net-misc/networkmanager/files/nm-system-settings.conf deleted file mode 100644 index c37b59680034..000000000000 --- a/net-misc/networkmanager/files/nm-system-settings.conf +++ /dev/null @@ -1,2 +0,0 @@ -[main] -plugins=keyfile diff --git a/net-misc/networkmanager/metadata.xml b/net-misc/networkmanager/metadata.xml index 864e87dc779d..5dd1b391649a 100644 --- a/net-misc/networkmanager/metadata.xml +++ b/net-misc/networkmanager/metadata.xml @@ -34,6 +34,7 @@ DNS information</flag> <flag name="systemd">Use <pkg>sys-apps/systemd</pkg> instead of <pkg>sys-auth/consolekit</pkg> for session tracking</flag> + <flag name="vala">Enable bindings for <pkg>dev-lang/vala</pkg></flag> <flag name="wext">Enable support for the deprecated Wext (Wireless Extensions) API; needed for some older drivers (e.g. ipw2200, ndiswrapper)</flag> diff --git a/net-misc/networkmanager/networkmanager-0.8-r1.ebuild b/net-misc/networkmanager/networkmanager-0.8-r1.ebuild deleted file mode 100644 index 49a15a31fed8..000000000000 --- a/net-misc/networkmanager/networkmanager-0.8-r1.ebuild +++ /dev/null @@ -1,131 +0,0 @@ -# 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.8-r1.ebuild,v 1.15 2012/06/27 14:41:17 ssuominen Exp $ - -EAPI="2" - -inherit gnome.org eutils user - -# NetworkManager likes itself with capital letters -MY_PN=${PN/networkmanager/NetworkManager} -MY_P=${MY_PN}-${PV} - -DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." -HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" -SRC_URI="${SRC_URI//${PN}/${MY_PN}}" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~arm ppc ppc64 x86" -IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd resolvconf connection-sharing" - -RDEPEND=">=sys-apps/dbus-1.2 - >=dev-libs/dbus-glib-0.75 - >=net-wireless/wireless-tools-28_pre9 - || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-145[extras] ) - >=dev-libs/glib-2.18 - >=sys-auth/polkit-0.92 - >=dev-libs/libnl-1.1:1.1 - >=net-misc/modemmanager-0.2 - >=net-wireless/wpa_supplicant-0.5.10[dbus] - bluetooth? ( net-wireless/bluez ) - || ( sys-libs/e2fsprogs-libs <sys-fs/e2fsprogs-1.41.0 ) - avahi? ( net-dns/avahi[autoipd] ) - gnutls? ( - nss? ( >=dev-libs/nss-3.11 ) - !nss? ( dev-libs/libgcrypt - net-libs/gnutls ) ) - !gnutls? ( >=dev-libs/nss-3.11 ) - dhclient? ( - dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - !dhcpcd? ( >=net-misc/dhcp-3.0.0 ) ) - !dhclient? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - resolvconf? ( net-dns/openresolv ) - connection-sharing? ( - net-dns/dnsmasq - net-firewall/iptables )" - -DEPEND="${RDEPEND} - virtual/pkgconfig - dev-util/intltool - net-dialup/ppp - doc? ( >=dev-util/gtk-doc-1.8 )" - -S=${WORKDIR}/${MY_P} - -pkg_setup() { - # FIXME. Required by -confchanges.patch, but the patch is invalid as - # ConsoleKit and PolicyKit is enough to get authorization. - enewgroup plugdev -} - -src_prepare() { - # Fix up the dbus conf file to use plugdev group - epatch "${FILESDIR}/${PN}-0.8-confchanges.patch" - - # Hack keyfile plugin to read hostname file, fixes bug 176873 - epatch "${FILESDIR}/${P}-read-hostname.patch" - - # Clear NSCD cache rather then kill daemon bug 301720 - epatch "${FILESDIR}/${P}-nscd-clear-cache.patch" -} - -src_configure() { - ECONF="--disable-more-warnings - --localstatedir=/var - --with-distro=gentoo - --with-dbus-sys-dir=/etc/dbus-1/system.d - --with-udev-dir=/etc/udev - --with-iptables=/sbin/iptables - $(use_enable doc gtk-doc) - $(use_with doc docs) - $(use_with resolvconf)" - - # default is dhcpcd (if none or both are specified), ISC dchclient otherwise - if use dhclient ; then - if use dhcpcd ; then - ECONF="${ECONF} --with-dhcp-client=dhcpcd" - else - ECONF="${ECONF} --with-dhcp-client=dhclient" - fi - else - ECONF="${ECONF} --with-dhcp-client=dhcpcd" - fi - - # default is NSS (if none or both are specified), GnuTLS otherwise - if use gnutls ; then - if use nss ; then - ECONF="${ECONF} --with-crypto=nss" - else - ECONF="${ECONF} --with-crypto=gnutls" - fi - else - ECONF="${ECONF} --with-crypto=nss" - fi - - econf ${ECONF} -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - # Need to keep the /var/run/NetworkManager directory - keepdir /var/run/NetworkManager - - # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts - keepdir /etc/NetworkManager/dispatcher.d - - dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" - - # Add keyfile plugin support - keepdir /etc/NetworkManager/system-connections - insinto /etc/NetworkManager - newins "${FILESDIR}/nm-system-settings.conf" nm-system-settings.conf \ - || die "newins failed" -} - -pkg_postinst() { - elog "You will need to reload DBus if this is your first time installing" - elog "NetworkManager, or if you're upgrading from 0.7 or older." - elog "" -} diff --git a/net-misc/networkmanager/networkmanager-0.9.0.ebuild b/net-misc/networkmanager/networkmanager-0.9.0.ebuild deleted file mode 100644 index 02c77a15c0b2..000000000000 --- a/net-misc/networkmanager/networkmanager-0.9.0.ebuild +++ /dev/null @@ -1,139 +0,0 @@ -# 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.0.ebuild,v 1.6 2012/05/24 03:04:31 tetromino Exp $ - -EAPI="4" -GNOME_ORG_MODULE="NetworkManager" - -inherit autotools eutils gnome.org linux-info systemd - -DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." -HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" - -LICENSE="GPL-2" -SLOT="0" -IUSE="avahi bluetooth doc +nss gnutls dhclient +dhcpcd +introspection - kernel_linux +ppp resolvconf connection-sharing wimax" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" - -REQUIRED_USE=" - ^^ ( nss gnutls ) - ^^ ( dhclient dhcpcd )" - -# gobject-introspection-0.10.3 is needed due to gnome bug 642300 -# wpa_supplicant-0.7.3-r3 is needed due to bug 359271 -# TODO: Qt support? -COMMON_DEPEND=">=sys-apps/dbus-1.2 - >=dev-libs/dbus-glib-0.75 - >=net-wireless/wireless-tools-28_pre9 - || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-147[extras] ) - >=dev-libs/glib-2.26 - >=sys-auth/polkit-0.97 - >=dev-libs/libnl-1.1:1.1 - >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] - bluetooth? ( >=net-wireless/bluez-4.82 ) - avahi? ( net-dns/avahi[autoipd] ) - gnutls? ( - dev-libs/libgcrypt - net-libs/gnutls ) - nss? ( >=dev-libs/nss-3.11 ) - dhclient? ( net-misc/dhcp ) - dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - introspection? ( >=dev-libs/gobject-introspection-0.10.3 ) - ppp? ( - >=net-misc/modemmanager-0.4 - >=net-dialup/ppp-2.4.5 ) - resolvconf? ( net-dns/openresolv ) - connection-sharing? ( - net-dns/dnsmasq - net-firewall/iptables ) - wimax? ( >=net-wireless/wimax-1.5.1 )" - -RDEPEND="${COMMON_DEPEND} - sys-auth/consolekit" - -DEPEND="${COMMON_DEPEND} - virtual/pkgconfig - >=dev-util/intltool-0.40 - >=sys-devel/gettext-0.17 - doc? ( >=dev-util/gtk-doc-1.8 )" - -sysfs_deprecated_check() { - ebegin "Checking for SYSFS_DEPRECATED support" - - if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then - eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel" - eerror "or NetworkManager will not work correctly." - eerror "See http://bugs.gentoo.org/333639 for more info." - die "CONFIG_SYSFS_DEPRECATED_V2 support detected!" - fi - eend $? -} - -pkg_pretend() { - if use kernel_linux; then - get_version - if linux_config_exists; then - sysfs_deprecated_check - else - ewarn "Was unable to determine your kernel .config" - ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly." - ewarn "See http://bugs.gentoo.org/333639 for more info." - fi - - fi -} - -src_prepare() { - # Don't build tests - epatch "${FILESDIR}/${PN}-0.9_rc3-fix-tests.patch" - # Fix building against linux-headers-3.4, #417055 - epatch "${FILESDIR}/${PN}-0.9.4.0-ip_ppp.h.patch" - eautoreconf - default -} - -src_configure() { - ECONF="--disable-more-warnings - --disable-static - --localstatedir=/var - --with-distro=gentoo - --with-dbus-sys-dir=/etc/dbus-1/system.d - --with-udev-dir=/lib/udev - --with-iptables=/sbin/iptables - $(use_enable doc gtk-doc) - $(use_enable introspection) - $(use_enable ppp) - $(use_enable wimax) - $(use_with dhclient) - $(use_with dhcpcd) - $(use_with doc docs) - $(use_with resolvconf) - $(systemd_with_unitdir)" - - if use nss ; then - ECONF="${ECONF} $(use_with nss crypto=nss)" - else - ECONF="${ECONF} $(use_with gnutls crypto=gnutls)" - fi - - econf ${ECONF} -} - -src_install() { - default - # Need to keep the /var/run/NetworkManager directory - keepdir /var/run/NetworkManager - - # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts - keepdir /etc/NetworkManager/dispatcher.d - - # Add keyfile plugin support - keepdir /etc/NetworkManager/system-connections - chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765 - insinto /etc/NetworkManager - newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf - - # Remove useless .la files - find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" -} diff --git a/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild b/net-misc/networkmanager/networkmanager-0.9.6.0.ebuild index 68ca494d3401..d494a2aec3f6 100644 --- a/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild +++ b/net-misc/networkmanager/networkmanager-0.9.6.0.ebuild @@ -1,22 +1,24 @@ # 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.2.0-r5.ebuild,v 1.4 2012/06/27 14:41:17 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.6.0.ebuild,v 1.1 2012/09/13 09:54:12 tetromino Exp $ EAPI="4" GNOME_ORG_MODULE="NetworkManager" +VALA_MIN_API_VERSION="0.18" +VALA_USE_DEPEND="vapigen" -inherit autotools eutils gnome.org linux-info systemd user +inherit autotools eutils gnome.org linux-info systemd user toolchain-funcs vala DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" LICENSE="GPL-2" SLOT="0" -IUSE="avahi bluetooth doc +nss gnutls dhclient +dhcpcd +introspection - kernel_linux +ppp resolvconf connection-sharing wimax" +IUSE="avahi bluetooth connection-sharing dhclient +dhcpcd doc gnutls +introspection kernel_linux +nss modemmanager +ppp resolvconf systemd vala +wext wimax" KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" REQUIRED_USE=" + modemmanager? ( ppp ) ^^ ( nss gnutls ) ^^ ( dhclient dhcpcd )" @@ -26,12 +28,11 @@ REQUIRED_USE=" # XXX: on bump, check that net-wireless/wimax is still using libnl:1.1 ! # TODO: Qt support? COMMON_DEPEND=">=sys-apps/dbus-1.2 - >=dev-libs/dbus-glib-0.75 - >=net-wireless/wireless-tools-28_pre9 + >=dev-libs/dbus-glib-0.94 || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-147[extras] ) >=dev-libs/glib-2.26 >=sys-auth/polkit-0.97 - dev-libs/libnl:1.1 + >=net-libs/libsoup-2.26:2.4 >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] bluetooth? ( >=net-wireless/bluez-4.82 ) avahi? ( net-dns/avahi[autoipd] ) @@ -42,23 +43,29 @@ COMMON_DEPEND=">=sys-apps/dbus-1.2 dhclient? ( net-misc/dhcp ) dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) introspection? ( >=dev-libs/gobject-introspection-0.10.3 ) - ppp? ( - >=net-misc/modemmanager-0.4 - >=net-dialup/ppp-2.4.5 ) + ppp? ( >=net-dialup/ppp-2.4.5 ) resolvconf? ( net-dns/openresolv ) connection-sharing? ( net-dns/dnsmasq net-firewall/iptables ) - wimax? ( >=net-wireless/wimax-1.5.1 )" + wimax? ( + dev-libs/libnl:1.1 + >=net-wireless/wimax-1.5.1 ) + !wimax? ( dev-libs/libnl:3 )" RDEPEND="${COMMON_DEPEND} - sys-auth/consolekit" + modemmanager? ( >=net-misc/modemmanager-0.4 ) + systemd? ( >=sys-apps/systemd-31 ) + !systemd? ( sys-auth/consolekit )" DEPEND="${COMMON_DEPEND} virtual/pkgconfig + dev-libs/vala-common >=dev-util/intltool-0.40 >=sys-devel/gettext-0.17 - doc? ( >=dev-util/gtk-doc-1.8 )" + >=sys-kernel/linux-headers-2.6.29 + doc? ( >=dev-util/gtk-doc-1.8 ) + vala? ( $(vala_depend) )" sysfs_deprecated_check() { ebegin "Checking for SYSFS_DEPRECATED support" @@ -94,36 +101,37 @@ src_prepare() { # Don't build tests epatch "${FILESDIR}/${PN}-0.9_rc3-fix-tests.patch" # Build against libnl:1.1 for net-wireless/wimax-1.5.2 compatibility - epatch "${FILESDIR}/${PN}-0.9.1.95-force-libnl1.1.patch" - # Migrate to openrc style - epatch "${FILESDIR}/${P}-ifnet-openrc-style.patch" - # Ignore per-user connections - epatch "${FILESDIR}/${P}-ifnet-ignore-user-connections.patch" - # Remove system prefix - epatch "${FILESDIR}/${P}-ifnet-remove-system-prefix.patch" - # Correctly deal with single quotes in /etc/conf.d/hostname - epatch "${FILESDIR}/${P}-ifnet-unquote-hostname.patch" + epatch "${FILESDIR}/${PN}-0.9.4.0-force-libnl1.1-r1.patch" # Update init.d script to provide net and use inactive status if not connected - epatch "${FILESDIR}/${P}-init-provide-net-r1.patch" - # Bug #402133, https://bugzilla.gnome.org/show_bug.cgi?id=670381 - epatch "${FILESDIR}/${P}-ifnet-password-truncated.patch" + 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}/${P}-pre-sleep.patch" - # Fix building against linux-headers-3.4, #417055 - epatch "${FILESDIR}/${PN}-0.9.4.0-ip_ppp.h.patch" + epatch "${FILESDIR}/${PN}-0.9.2.0-pre-sleep.patch" + # Bug #335147, https://bugzilla.gnome.org/show_bug.cgi?id=679428 + epatch "${FILESDIR}/${PN}-0.9.4.0-dhclient-ipv6.patch" + # Bug #428274, don't save temporary ipv6 routes + epatch "${FILESDIR}/${P}-cached-ipv6-routes-"{1,2}.patch + # https://bugzilla.gnome.org/show_bug.cgi?id=683932 + epatch "${FILESDIR}/${PN}-0.9.6.0-daemon-signals.patch" + epatch_user + + use vala && vala_src_prepare eautoreconf default } src_configure() { + local udevdir=/lib/udev + has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" + ECONF="--disable-more-warnings --disable-static --localstatedir=/var --with-distro=gentoo --with-dbus-sys-dir=/etc/dbus-1/system.d - --with-udev-dir=/lib/udev + --with-udev-dir=${udevdir} --with-iptables=/sbin/iptables + --enable-concheck $(use_enable doc gtk-doc) $(use_enable introspection) $(use_enable ppp) @@ -132,6 +140,9 @@ src_configure() { $(use_with dhcpcd) $(use_with doc docs) $(use_with resolvconf) + $(use_enable vala) + $(use_with wext) + $(use_with wimax libnl-1) $(systemd_with_unitdir)" if use nss ; then @@ -140,6 +151,12 @@ src_configure() { ECONF="${ECONF} $(use_with gnutls crypto=gnutls)" fi + if use systemd; then + ECONF="${ECONF} --with-session-tracking=systemd" + else + ECONF="${ECONF} --with-session-tracking=ck" + fi + econf ${ECONF} } @@ -151,24 +168,34 @@ src_install() { # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts keepdir /etc/NetworkManager/dispatcher.d - # Provide openrc net dependency only when nm is connected - exeinto /etc/NetworkManager/dispatcher.d - newexe "${FILESDIR}/10-openrc-status-r1" 10-openrc-status - sed -e "s:@EPREFIX@:${EPREFIX}:g" \ - -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die + if use systemd; then + # Our init.d script requires running a dispatcher script that annoys + # systemd users; bug #434692 + rm -rv "${ED}/etc/init.d" || die "rm failed" + else + # Provide openrc net dependency only when nm is connected + exeinto /etc/NetworkManager/dispatcher.d + newexe "${FILESDIR}/10-openrc-status-r2" 10-openrc-status + sed -e "s:@EPREFIX@:${EPREFIX}:g" \ + -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die + + # Default conf.d file + newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager + fi # Add keyfile plugin support keepdir /etc/NetworkManager/system-connections chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765 insinto /etc/NetworkManager - newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf + newins "${FILESDIR}/nm-system-settings.conf-ifnet" NetworkManager.conf # Allow users in plugdev group to modify system connections - insinto /etc/polkit-1/localauthority/10-vendor.d - doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.pkla" - - # Default conf.d file - newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager + insinto /usr/share/polkit-1/rules.d/ + doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.rules" + if has_version '<sys-auth/polkit-0.106'; then + insinto /etc/polkit-1/localauthority/10-vendor.d + doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.pkla" + fi # Remove useless .la files find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" @@ -177,4 +204,31 @@ src_install() { pkg_postinst() { elog "To modify system network connections without needing to enter the" elog "root password, add your user account to the 'plugdev' group." + + if [[ -e "${EROOT}etc/NetworkManager/nm-system-settings.conf" ]]; then + ewarn "The ${PN} system configuration file has moved to a new location." + ewarn "You must migrate your settings from ${EROOT}/etc/NetworkManager/nm-system-settings.conf" + ewarn "to ${EROOT}etc/NetworkManager/NetworkManager.conf" + ewarn + ewarn "After doing so, you can remove ${EROOT}etc/NetworkManager/nm-system-settings.conf" + fi + + # The polkit rules file moved to /usr/share + old_rules="${EROOT}etc/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules" + if [[ -f "${old_rules}" ]]; then + case "$(md5sum ${old_rules})" in + 574d0cfa7e911b1f7792077003060240* ) + # Automatically delete the old rules.d file if the user did not change it + elog + elog "Removing old ${old_rules} ..." + rm -f "${old_rules}" || eerror "Failed, please remove ${old_rules} manually" + ;; + * ) + elog "The ${old_rules}" + elog "file moved to /usr/share/polkit-1/rules.d/ in >=networkmanager-0.9.4.0-r4" + elog "If you edited ${old_rules}" + elog "without changing its behavior, you may want to remove it." + ;; + esac + fi } |