From: David Bremner Date: Mon, 4 Aug 2014 14:35:03 +0000 (-0300) Subject: cope with missing getConfDir in 3.18+ of highlight. X-Git-Tag: debian/3.20140815~5^2~1 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/a55a20f5f879b11ce1ac2e7c72ca7c3f7dea6a9b 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 --- 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}=