]> spindle.queued.net Git - midori/commitdiff
Avoid pre- and suffix with extension default configs
authorChristian Dywan <christian@twotoasts.de>
Thu, 20 Oct 2011 21:39:28 +0000 (23:39 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 20 Oct 2011 21:39:28 +0000 (23:39 +0200)
So this mainly matters to package maintainers, as the
configuration files for extensions have pre- and suffix
according to library naming of the platform. Basically
this only ever worked on Linux and Windows.
Now default configs are always installed with plain names.

midori/midori-extension.c
wscript

index 4eb83ef718a909a6ac94ec8c7e997eeef034d779..634462cc015310ec9ff018f853c7e7ef48aa44fd 100644 (file)
@@ -294,7 +294,16 @@ midori_extension_activate_cb (MidoriExtension* extension,
             if (error->code == G_FILE_ERROR_NOENT)
             {
                 gchar* filename = g_object_get_data (G_OBJECT (extension), "filename");
-                gchar* folder = g_strconcat ("extensions/", filename, NULL);
+                gchar* folder;
+                if (g_str_has_prefix (filename, "lib"))
+                    filename = &filename[strlen ("len")];
+                if (g_str_has_suffix (filename, G_MODULE_SUFFIX))
+                    filename = g_strndup (filename,
+                        strlen (filename) - strlen ("." G_MODULE_SUFFIX));
+                else
+                    filename = g_strdup (filename);
+                folder = g_strconcat ("extensions/", filename, NULL);
+                g_free (filename);
                 katze_assign (config_file,
                     sokoke_find_config_filename (folder, "config"));
                 g_free (folder);
diff --git a/wscript b/wscript
index d8abd157cf17e17021815fb83831af43d14e35de..36051a86cd965c23e14709ab3b4e84c5d50f936a 100644 (file)
--- a/wscript
+++ b/wscript
@@ -476,23 +476,13 @@ def build (bld):
         bld.install_files ('${MDATADIR}/' + APPNAME + '/res', 'data/autosuggestcontrol.js')
         bld.install_files ('${MDATADIR}/' + APPNAME + '/res', 'data/autosuggestcontrol.css')
 
-        # FIXME: Determine the library naming for other platforms
-        if bld.env['platform'] == 'win32':
+        if 1:
             extensions = os.listdir ('data/extensions')
             for extension in extensions:
-                folder = 'lib' + extension + '.dll'
                 source = 'data/extensions/' + extension +  '/config'
                 if os.path.exists (source):
                     bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + \
-                                       '/extensions/' + folder, source)
-        elif Options.platform == 'linux':
-            extensions = os.listdir ('data/extensions')
-            for extension in extensions:
-                folder = 'lib' + extension + '.so'
-                source = 'data/extensions/' + extension +  '/config'
-                if os.path.exists (source):
-                    bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + \
-                                       '/extensions/' + folder, source)
+                                       '/extensions/' + extension, source)
 
     if Options.commands['check'] or bld.env['tests']:
         bld.add_subdirs ('tests')