Merge remote branch 'origin/master' into rm-userset
authorDan Williams <dcbw@redhat.com>
Wed, 17 Nov 2010 00:08:48 +0000 (18:08 -0600)
committerDan Williams <dcbw@redhat.com>
Wed, 17 Nov 2010 00:08:48 +0000 (18:08 -0600)
1  2 
configure.ac
po/cs.po
po/lt.po
src/Makefile.am
src/nm-manager.c
src/nm-policy.c
system-settings/plugins/ifcfg-rh/plugin.c
system-settings/plugins/keyfile/Makefile.am
system-settings/plugins/keyfile/plugin.c

diff --cc configure.ac
Simple merge
diff --cc po/cs.po
+++ b/po/cs.po
@@@ -1344,12 -1748,13 +1748,13 @@@ msgstr "
  msgid "The nameservers listed below may not be recognized."
  msgstr "Jmenné servery uvedené v následujícím seznamu nelze rozpoznat."
  
 -#: ../src/system-settings/nm-default-wired-connection.c:157
 +#: ../src/settings/nm-default-wired-connection.c:157
  #, c-format
  msgid "Auto %s"
- msgstr "%s (automaticky)"
+ msgstr "Automaticky %s"
  
- #: ../system-settings/plugins/ifcfg-rh/reader.c:3213
+ #: ../system-settings/plugins/ifcfg-rh/reader.c:3412
+ #: ../system-settings/plugins/ifnet/connection_parser.c:49
  msgid "System"
  msgstr "Systém"
  
diff --cc po/lt.po
Simple merge
diff --cc src/Makefile.am
Simple merge
Simple merge
diff --cc src/nm-policy.c
@@@ -742,9 -753,12 +756,9 @@@ auto_activate_device (gpointer user_dat
        if (nm_device_get_act_request (data->device))
                goto out;
  
 -      /* System connections first, then user connections */
 -      connections = nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_SYSTEM);
 -      if (nm_manager_auto_user_connections_allowed (policy->manager))
 -              connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER));
 +      connections = nm_settings_get_connections (policy->settings);
  
-       /* Remove connections that are in the invalid list. */
+       /* Remove connections that have INVALID_TAG and shouldn't be retried any more. */
        iter = connections;
        while (iter) {
                NMConnection *iter_connection = NM_CONNECTION (iter->data);
@@@ -269,9 -232,20 +269,19 @@@ connection_new_or_changed (SCPluginIfcf
                return;
        }
  
-       /* Successfully read connection */
 -
+       /* Successfully read connection changes */
  
-       old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (existing));
+       /* When the connections are the same, nothing is done */
+       if (nm_connection_compare (NM_CONNECTION (connection),
+                                  NM_CONNECTION (new),
+                                  NM_SETTING_COMPARE_FLAG_EXACT)) {
+               g_object_unref (new);
+               return;
+       }
+       PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path);
+       old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection));
        new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (new));
  
        if (new_unmanaged) {
@@@ -122,14 -87,29 +123,17 @@@ read_connections (NMSystemConfigInterfa
        }
  
        while ((item = g_dir_read_name (dir))) {
 -              NMKeyfileConnection *connection;
 +              NMSysconfigConnection *connection;
                char *full_path;
  
+               if (utils_should_ignore_file (item))
+                       continue;
                full_path = g_build_filename (KEYFILE_DIR, item, NULL);
                PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "parsing %s ... ", item);
 -              connection = nm_keyfile_connection_new (full_path, &error);
 -              if (connection) {
 -                      NMSettingConnection *s_con;
 -                      const char *cid;
 -
 -                      s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION);
 -                      g_assert (s_con);
 -
 -                      cid = nm_setting_connection_get_id (s_con);
 -                      g_assert (cid);
 -
 -                      g_hash_table_insert (priv->hash,
 -                                           (gpointer) nm_keyfile_connection_get_filename (connection),
 -                                           connection);
  
 +              connection = _internal_new_connection (self, full_path, NULL, &cid, &error);
 +              if (connection) {
                        PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "    read connection '%s'", cid);
                } else {
                        PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "    error: %s",
@@@ -218,8 -195,13 +222,13 @@@ dir_changed (GFileMonitor *monitor
        NMKeyfileConnection *connection;
        GError *error = NULL;
  
 -      name = g_file_get_path (file);
 -      if (utils_should_ignore_file (name)) {
 -              g_free (name);
 +      full_path = g_file_get_path (file);
++      if (utils_should_ignore_file (full_path)) {
++              g_free (full_path);
+               return;
+       }
 -      connection = g_hash_table_lookup (priv->hash, name);
 +      connection = g_hash_table_lookup (priv->hash, full_path);
  
        switch (event_type) {
        case G_FILE_MONITOR_EVENT_DELETED:
                        /* Update */
                        NMKeyfileConnection *tmp;
  
 -                      tmp = nm_keyfile_connection_new (name, &error);
 +                      tmp = nm_keyfile_connection_new (full_path, NULL, &error);
                        if (tmp) {
-                               update_connection_settings (connection, tmp);
+                               if (!nm_connection_compare (NM_CONNECTION (connection),
+                                                           NM_CONNECTION (tmp),
+                                                           NM_SETTING_COMPARE_FLAG_EXACT)) {
+                                       PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
+                                       update_connection_settings (connection, tmp);
+                               }
                                g_object_unref (tmp);
                        } else {
                                /* Error; remove the connection */
                                PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "    error: %s",
                                                      (error && error->message) ? error->message : "(unknown)");
                                g_clear_error (&error);
 -                              remove_connection (SC_PLUGIN_KEYFILE (config), connection, name);
 +                              remove_connection (SC_PLUGIN_KEYFILE (config), connection, full_path);
                        }
                } else {
+                       PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
                        /* New */
 -                      connection = nm_keyfile_connection_new (name, &error);
 +                      connection = nm_keyfile_connection_new (full_path, NULL, &error);
                        if (connection) {
 -                              NMSettingConnection *s_con;
 -                              const char *connection_uuid;
                                NMKeyfileConnection *found = NULL;
 +                              NMSettingConnection *s_con;
  
                                /* Connection renames will show up as different files but with
                                 * the same UUID.  Try to find the original connection.