From a55a20f5f879b11ce1ac2e7c72ca7c3f7dea6a9b Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 4 Aug 2014 11:35:03 -0300 Subject: [PATCH] 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 --- IkiWiki/Plugin/highlight.pm | 14 +++++++++++--- 1 file 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}= -- 2.39.5