aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2014-08-04 11:35:03 -0300
committerDavid Bremner <bremner@debian.org>2014-08-06 22:28:32 -0300
commita55a20f5f879b11ce1ac2e7c72ca7c3f7dea6a9b (patch)
tree62971d5bd7502bb31892c2211c60ccb58e41f310
parent18977ae3c7d35e62f0c1e6aab893a76fa1dab31d (diff)
downloadikiwiki-a55a20f5f879b11ce1ac2e7c72ca7c3f7dea6a9b.tar
ikiwiki-a55a20f5f879b11ce1ac2e7c72ca7c3f7dea6a9b.tar.gz
cope with missing getConfDir in 3.18+ of highlight.
Unfortunately we have to try a couple things since the API changed between 3.9 and 3.18
-rw-r--r--IkiWiki/Plugin/highlight.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm
index fbe7ddff4..0aa7386ba 100644
--- a/IkiWiki/Plugin/highlight.pm
+++ b/IkiWiki/Plugin/highlight.pm
@@ -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}=