]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
cope with missing getConfDir in 3.18+ of highlight.
authorDavid Bremner <bremner@debian.org>
Mon, 4 Aug 2014 14:35:03 +0000 (11:35 -0300)
committerDavid Bremner <bremner@debian.org>
Thu, 7 Aug 2014 01:28:32 +0000 (22:28 -0300)
Unfortunately we have to try a couple things since the API changed
between 3.9 and 3.18

IkiWiki/Plugin/highlight.pm

index fbe7ddff44f0c9111b63cca96f6a58fb80ac41f8..0aa7386baa59804a9505ff684c3258df47df3b65 100644 (file)
@@ -60,9 +60,17 @@ sub checkconfig () {
        }
 
        if (! exists $config{filetypes_conf}) {
-               $config{filetypes_conf}= 
-                    ($data_dir ? $data_dir->getConfDir() : "/etc/highlight/")
-                         . "filetypes.conf";
+         if (! $data_dir ) {
+               $config{filetypes_conf}= "/etc/highlight/filetypes.conf";
+             } elsif ( $data_dir -> can('searchFile') ) {
+               # 3.18 +
+               $config{filetypes_conf}=
+                 $data_dir -> searchFile("filetypes.conf");
+             } else {
+               # 3.9 +
+               $config{filetypes_conf}=
+                 $data_dir -> getConfDir() . "/filetypes.conf";
+             }
        }
        if (! exists $config{langdefdir}) {
                $config{langdefdir}=