]> sipb.mit.edu Git - ikiwiki.git/commitdiff
conditional: use yesno
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 9 Oct 2009 16:54:13 +0000 (12:54 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 9 Oct 2009 16:54:35 +0000 (12:54 -0400)
IkiWiki.pm
IkiWiki/Plugin/conditional.pm
t/yesno.t

index fd7e2352474400c04eb7bdc4b4dd79746d570da6..475e278c3b3ef5ad7a434f0cf84bc3117b340436 100644 (file)
@@ -1792,7 +1792,7 @@ sub add_depends ($$;$) {
        #               $depends_simple{$page}{lc $i} |= $i{$i};
        #       }
        #}
-       print STDERR "warning: use of add_depends; influences not tracked\n";
+       print STDERR "warning: use of add_depends by ".caller()."; influences not tracked\n";
 
        $depends{$page}{$pagespec} |= $deptype;
        return 1;
index 7445dbdad71420bb4228f573543ac673732b197c..7ead701f28a95b3e5286672534ebe47ed3d23c7d 100644 (file)
@@ -29,7 +29,7 @@ sub preprocess_if (@) {
        }
 
        my $result=0;
-       if ((exists $params{all} && lc $params{all} eq "no") ||
+       if (! IkiWiki::yesno($params{all}) ||
                # An optimisation to avoid needless looping over every page
                # and adding of dependencies for simple uses of some of the
                # tests.
index 60a8c071d6153739639cb6c50322fd2aaea082c0..8770390a1075651caf9c6c4aeb46db3df338f0f8 100755 (executable)
--- a/t/yesno.t
+++ b/t/yesno.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 10;
+use Test::More tests => 11;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -19,3 +19,5 @@ ok(IkiWiki::yesno("NO") == 0);
 ok(IkiWiki::yesno("1") == 1);
 ok(IkiWiki::yesno("0") == 0);
 ok(IkiWiki::yesno("mooooooooooo") == 0);
+
+ok(IkiWiki::yesno(undef) == 0);