X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/79d2d44db2acc4aeaf60de17d86951e1d7259e1d..5f55ee0b783fb0a7b3b1dcb63ff280bad25af364:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 6747a3ba4..f6adb360a 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -24,7 +24,7 @@ our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match inject %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); -our $VERSION = 2.00; # plugin interface version, next is ikiwiki version +our $VERSION = 3.00; # plugin interface version, next is ikiwiki version our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE @@ -194,7 +194,7 @@ sub getsetup () { }, prefix_directives => { type => "boolean", - default => 0, + default => 1, description => "use '!'-prefixed preprocessor directives?", safe => 0, # changing requires manual transition rebuild => 1, @@ -1596,37 +1596,6 @@ sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } -sub globlist_to_pagespec ($) { - my @globlist=split(' ', shift); - - my (@spec, @skip); - foreach my $glob (@globlist) { - if ($glob=~/^!(.*)/) { - push @skip, $glob; - } - else { - push @spec, $glob; - } - } - - my $spec=join(' or ', @spec); - if (@skip) { - my $skip=join(' and ', @skip); - if (length $spec) { - $spec="$skip and ($spec)"; - } - else { - $spec=$skip; - } - } - return $spec; -} - -sub is_globlist ($) { - my $s=shift; - return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" ); -} - sub safequote ($) { my $s=shift; $s=~s/[{}]//g; @@ -1718,26 +1687,12 @@ sub pagespec_merge ($$) { my $b=shift; return $a if $a eq $b; - - # Support for old-style GlobLists. - if (is_globlist($a)) { - $a=globlist_to_pagespec($a); - } - if (is_globlist($b)) { - $b=globlist_to_pagespec($b); - } - return "($a) or ($b)"; } sub pagespec_translate ($) { my $spec=shift; - # Support for old-style GlobLists. - if (is_globlist($spec)) { - $spec=globlist_to_pagespec($spec); - } - # Convert spec to perl code. my $code=""; while ($spec=~m{