]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Improve plugin selection (#676453)
authorFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 17:39:00 +0000 (19:39 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 17:39:00 +0000 (19:39 +0200)
src/libvaladoc/moduleloader.vala

index 9ac5d7b9ed72298ab3045ead10345bc8327e3c17..a4e8697b38b8485bd32576e94eb1aea0555dd2ed 100644 (file)
@@ -75,12 +75,17 @@ public class Valadoc.ModuleLoader : Object {
                return FileUtils.test (path, FileTest.EXISTS) && FileUtils.test (library_path, FileTest.EXISTS);
        }
 
+       public static bool is_doclet (string path) {
+               string library_path = Path.build_filename (path, "libdoclet." + Module.SUFFIX);
+               return FileUtils.test (path, FileTest.EXISTS) && FileUtils.test (library_path, FileTest.EXISTS);
+       }
+
        private static string get_plugin_path (string pluginpath, string pluginsubdir) {
                if (Path.is_absolute (pluginpath) == false) {
                        // Test to see if the plugin exists in the expanded path and then fallback
                        // to using the configured plugin directory
                        string local_path = Path.build_filename (Environment.get_current_dir(), pluginpath);
-                       if (FileUtils.test(local_path, FileTest.EXISTS)) {
+                       if (is_doclet(local_path)) {
                                return local_path;
                        } else {
                                return Path.build_filename (Config.plugin_dir, pluginsubdir, pluginpath);