#!/usr/bin/perl
+no lib '.';
use warnings;
use strict;
-use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile.
use IkiWiki;
use IkiWiki::Setup;
use Getopt::Long;
#!/usr/bin/perl
+no lib '.';
use warnings;
use strict;
-use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile.
use IkiWiki;
use IkiWiki::Plugin::comments;
use Getopt::Long;
#!/usr/bin/perl
+no lib '.';
use warnings;
use strict;
#!/usr/bin/perl
+no lib '.';
use warnings;
use strict;
-use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile.
use IkiWiki;
use HTML::Entities;
#!/usr/bin/perl -t
# Add a user to the system wide wikilist.
# This script can safely be made suid or put in /etc/sudoers.
+no lib '.';
use warnings;
use strict;
use English;
#!/usr/bin/perl
package IkiWiki;
+no lib '.';
use warnings;
use strict;
-use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile.
use IkiWiki 3.00;
sub usage () {
elsif (/VERSION_AUTOREPLACE/) {
$_=qq{our \$version="$ver";};
}
-elsif (/^use lib/) {
+elsif (/^(?:use FindBin; *)?use lib/) {
# The idea here is to figure out if the libdir the Makefile.PL
# was configured to use is in perl's normal search path.
# If not, hard code it into ikiwiki.
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
my $installed = $ENV{INSTALLED_TESTS};
else {
ok(! system("make -s ikiwiki.out"));
ok(! system("make underlay_install DESTDIR=`pwd`/t/tmp/install PREFIX=/usr >/dev/null"));
- @command = qw(env LC_ALL=C perl -I. ./ikiwiki.out
+ @command = (qw(env LC_ALL=C perl), "-I".getcwd, qw(./ikiwiki.out
--underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki
--set underlaydirbase=t/tmp/install/usr/share/ikiwiki
- --templatedir=templates);
+ --templatedir=templates));
}
foreach my $plugin ("", "listdirectives") {
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
use IkiWiki;
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
my $comment;
# Tests for bugs relating to conflicting files in the srcdir
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More tests => 106;
my $installed = $ENV{INSTALLED_TESTS};
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
# setup
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
plan(skip_all => "Image::Magick not available")
unless eval q{use Image::Magick; 1};
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose);
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
use IkiWiki;
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
push @command, qw(--set usedirs=0 --plugin inline
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
use IkiWiki;
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
push @command, qw(--plugin meta --disable-plugin htmlscrubber);
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
my $installed = $ENV{INSTALLED_TESTS};
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
ok(! system("rm -rf t/tmp"));
}
else {
ok(! system("make -s ikiwiki.out"));
- @base_command = qw(perl -I. ./ikiwiki.out
+ @base_command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
my $tmp = 't/tmp';
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
sub parse_cgi_content {
#!/usr/bin/perl
use warnings;
use strict;
+use Cwd qw(getcwd);
use Test::More;
use IkiWiki;
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(perl -I. ./ikiwiki.out
+ @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
push @command, qw(--set usedirs=0 --plugin trail --plugin inline
}
else {
ok(! system("make -s ikiwiki.out"));
- @command = qw(env PERL5LIB=t/tmp:blib/lib:blib/arch perl -I. ./ikiwiki.out
+ @command = (qw(env PERL5LIB=t/tmp:blib/lib:blib/arch perl),
+ "-I".getcwd, qw(./ikiwiki.out
--underlaydir=underlays/basewiki
--set underlaydirbase=underlays
- --templatedir=templates);
+ --templatedir=templates));
}
writefile("test.setup", "t/tmp", <<EOF