]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
er, what absolute links?
[ikiwiki.git] / doc / bugs / tbasewiki__95__brokenlinks.t_broken.mdwn
1 t/basewiki_brokenlinks.t was failing with the following error:
2
3     t/basewiki_brokenlinks.....Can't locate IkiWiki.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/vendor_perl/5.8.8/i686-linux
4     /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8
5     /usr/lib/perl5/site_perl /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/local/lib/site_perl) at ./ikiwiki.out line 9.
6
7 When ikiwiki.out is executed the 'blib/lib' directory isn't inherited by the child process.  I can add "use lib 'blib/lib'" to ikiwiki.out easily enough, but I can't figure out how to add it to ikiwiki.in so that pm_filter doesn't strip it out.
8
9 Anyway, once the 'use lib' is added I get the following error:
10
11     t/basewiki_brokenlinks.....ok 1/3Can't locate object method "new" via package "HTML::Template" at blib/lib/IkiWiki.pm line 858.
12
13 After some digging I found that HTML::Template is being required after the new statement, again, easily fixed:
14
15     Index: IkiWiki.pm
16     ===================================================================
17     --- IkiWiki.pm  (revision 3724)
18     +++ IkiWiki.pm  (working copy)
19     @@ -842,7 +842,6 @@
20                     return "";
21             }
22
23     -       require HTML::Template;
24             my @ret=(
25                     filter => sub {
26                             my $text_ref = shift;
27     @@ -857,6 +856,7 @@
28      } #}}}
29
30      sub template ($;@) { #{{{
31     +       require HTML::Template;
32             HTML::Template->new(template_params(@_));
33      } #}}}
34
35 **That** gave me:
36
37     t/basewiki_brokenlinks.....ok 1/3HTML::Template->new called with multiple (or no) template sources specified!  A valid call to new() has exactly one filename => 'file' OR exactly one scalarref => \$scalar OR exactly one arrayref => \@array OR exactly one filehandle => *FH at blib/lib/IkiWiki.pm line 858
38
39 After some step through I figured out that the template directory was invalid, again easily fixed:
40
41     Index: t/basewiki_brokenlinks.t
42     ===================================================================
43     --- t/basewiki_brokenlinks.t    (revision 3724)
44     +++ t/basewiki_brokenlinks.t    (working copy)
45     @@ -4,6 +4,6 @@
46      use Test::More tests => 3;
47
48      ok(! system("make ikiwiki.out"));
49     -ok(! system("PERL5LIB=. ./ikiwiki.out -plugin brokenlinks -rebuild -underlaydir=basewiki t/basewiki_brokenlinks t/basewiki_brokenlinks/out"));
50     +ok(! system("PERL5LIB=. ./ikiwiki.out -plugin brokenlinks -rebuild -underlaydir=basewiki -templatedir=templates t/basewiki_brokenlinks t/basewiki_brokenlinks/out"));
51      ok(`grep 'no broken links' t/basewiki_brokenlinks/out/index.html`);
52      system("rm -rf t/basewiki_brokenlinks/out t/basewiki_brokenlinks/.ikiwiki");
53
54 Other than ikiwiki.in, am I missing something here?
55
56 >> I think this is [[debbug 425891]]. I have sent there a patch that incorporates the original
57 >> author's two diffs but has a more correct solution to the first problem described 
58 >> above. -- Thomas, 2007-06-26
59
60 [[done]]