2008-11-25 Dan Williams <dcbw@redhat.com>

* system-settings/plugins/ifcfg-rh
		- Rename 'ifcfg-fedora' to 'ifcfg-rh'; it's not just used on Fedora

	* system-settings/src/main.c
		- (load_plugins): transparently handle ifcfg-fedora as ifcfg-rh



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4337 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-11-25 22:42:21 +00:00
parent fd929de635
commit 04be05e59f
14 changed files with 32 additions and 20 deletions

View file

@ -1,3 +1,11 @@
2008-11-25 Dan Williams <dcbw@redhat.com>
* system-settings/plugins/ifcfg-rh
- Rename 'ifcfg-fedora' to 'ifcfg-rh'; it's not just used on Fedora
* system-settings/src/main.c
- (load_plugins): transparently handle ifcfg-fedora as ifcfg-rh
2008-11-25 Dan Williams <dcbw@redhat.com>
Patch from Tambet Ingo <tambet@gmail.com>

View file

@ -501,7 +501,7 @@ system-settings/Makefile
system-settings/src/Makefile
system-settings/plugins/Makefile
system-settings/plugins/ifupdown/Makefile
system-settings/plugins/ifcfg-fedora/Makefile
system-settings/plugins/ifcfg-rh/Makefile
system-settings/plugins/ifcfg-suse/Makefile
system-settings/plugins/keyfile/Makefile
test/Makefile

View file

@ -1,7 +1,7 @@
SUBDIRS=keyfile
if TARGET_REDHAT
SUBDIRS+=ifcfg-fedora
SUBDIRS+=ifcfg-rh
endif
if TARGET_SUSE
@ -9,7 +9,7 @@ SUBDIRS+=ifcfg-suse
endif
if TARGET_MANDRIVA
SUBDIRS+=ifcfg-fedora
SUBDIRS+=ifcfg-rh
endif
if TARGET_DEBIAN

View file

@ -1,7 +1,7 @@
pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-fedora.la
pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-rh.la
libnm_settings_plugin_ifcfg_fedora_la_SOURCES = \
libnm_settings_plugin_ifcfg_rh_la_SOURCES = \
shvar.c \
shvar.h \
plugin.c \
@ -12,7 +12,7 @@ libnm_settings_plugin_ifcfg_fedora_la_SOURCES = \
reader.h \
common.h
libnm_settings_plugin_ifcfg_fedora_la_CPPFLAGS = \
libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(GMODULE_CFLAGS) \
$(DBUS_CFLAGS) \
@ -24,8 +24,8 @@ libnm_settings_plugin_ifcfg_fedora_la_CPPFLAGS = \
-I$(top_builddir)/marshallers \
-DSYSCONFDIR=\"$(sysconfdir)\"
libnm_settings_plugin_ifcfg_fedora_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifcfg_fedora_la_LIBADD = \
libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifcfg_rh_la_LIBADD = \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
$(top_builddir)/libnm-util/libnm-util.la \
@ -33,10 +33,10 @@ libnm_settings_plugin_ifcfg_fedora_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la
if NO_GIO
libnm_settings_plugin_ifcfg_fedora_la_LIBADD += \
libnm_settings_plugin_ifcfg_rh_la_LIBADD += \
$(top_builddir)/gfilemonitor/libgfilemonitor.la
else
libnm_settings_plugin_ifcfg_fedora_la_LIBADD += \
libnm_settings_plugin_ifcfg_rh_la_LIBADD += \
$(GIO_LIBS)
endif

View file

@ -28,7 +28,7 @@
#define ORIG_TAG ".orig"
#define REJ_TAG ".rej"
#define IFCFG_PLUGIN_NAME "ifcfg-fedora"
#define IFCFG_PLUGIN_NAME "ifcfg-rh"
#define IFCFG_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
#include <glib.h>

View file

@ -111,31 +111,35 @@ load_plugins (Application *app, const char *plugins, GError **error)
{
GSList *list = NULL;
char **plist;
char **pname;
char **iter;
plist = g_strsplit (plugins, ",", 0);
if (!plist)
return FALSE;
for (pname = plist; *pname; pname++) {
for (iter = plist; *iter; iter++) {
GModule *plugin;
char *full_name;
char *path;
char *full_name, *path;
const char *pname = *iter;
GObject *obj;
GObject * (*factory_func) (void);
obj = find_plugin (list, *pname);
/* ifcfg-fedora was renamed ifcfg-rh; handle old configs here */
if (!strcmp (pname, "ifcfg-fedora"))
pname = "ifcfg-rh";
obj = find_plugin (list, pname);
if (obj)
continue;
full_name = g_strdup_printf ("nm-settings-plugin-%s", *pname);
full_name = g_strdup_printf ("nm-settings-plugin-%s", pname);
path = g_module_build_path (PLUGINDIR, full_name);
plugin = g_module_open (path, G_MODULE_BIND_LOCAL);
if (!plugin) {
g_set_error (error, plugins_error_quark (), 0,
"Could not load plugin '%s': %s",
*pname, g_module_error ());
pname, g_module_error ());
g_free (full_name);
g_free (path);
break;
@ -147,7 +151,7 @@ load_plugins (Application *app, const char *plugins, GError **error)
if (!g_module_symbol (plugin, "nm_system_config_factory", (gpointer) (&factory_func))) {
g_set_error (error, plugins_error_quark (), 0,
"Could not find plugin '%s' factory function.",
*pname);
pname);
break;
}
@ -155,7 +159,7 @@ load_plugins (Application *app, const char *plugins, GError **error)
if (!obj || !NM_IS_SYSTEM_CONFIG_INTERFACE (obj)) {
g_set_error (error, plugins_error_quark (), 0,
"Plugin '%s' returned invalid system config object.",
*pname);
pname);
break;
}