+sub getlibdirs () {
+ my @libdirs;
+ if ($config{libdirs}) {
+ @libdirs = @{$config{libdirs}};
+ }
+ if (length $config{libdir}) {
+ push @libdirs, $config{libdir};
+ }
+ return @libdirs;
+}
+
next unless defined $dir && length $dir;
foreach my $file (glob("$dir/IkiWiki/Plugin/*.pm")) {
my ($plugin)=$file=~/.*\/(.*)\.pm$/;
$ret{$plugin}=1;
}
}
next unless defined $dir && length $dir;
foreach my $file (glob("$dir/IkiWiki/Plugin/*.pm")) {
my ($plugin)=$file=~/.*\/(.*)\.pm$/;
$ret{$plugin}=1;
}
}
next unless defined $dir && length $dir;
foreach my $file (glob("$dir/plugins/*")) {
$ret{basename($file)}=1 if -x $file;
next unless defined $dir && length $dir;
foreach my $file (glob("$dir/plugins/*")) {
$ret{basename($file)}=1 if -x $file;
- if (defined $config{libdir} && length $config{libdir}) {
- unshift @INC, possibly_foolish_untaint($config{libdir});
+ foreach my $dir (getlibdirs()) {
+ unshift @INC, possibly_foolish_untaint($dir);
- foreach my $dir (defined $config{libdir} ? possibly_foolish_untaint($config{libdir}) : undef,
- "$installdir/lib/ikiwiki") {
+ foreach my $possiblytainteddir (getlibdirs(), "$installdir/lib/ikiwiki") {
+ my $dir = possibly_foolish_untaint($possiblytainteddir);
open($wikilock, '>', "$config{wikistatedir}/lockfile") ||
error ("cannot write to $config{wikistatedir}/lockfile: $!");
if (! flock($wikilock, LOCK_EX | LOCK_NB)) {
open($wikilock, '>', "$config{wikistatedir}/lockfile") ||
error ("cannot write to $config{wikistatedir}/lockfile: $!");
if (! flock($wikilock, LOCK_EX | LOCK_NB)) {
if (! flock($wikilock, LOCK_EX)) {
error("failed to get lock");
}
if (! flock($wikilock, LOCK_EX)) {
error("failed to get lock");
}