]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
* Now unofficial Ikiwiki backports for Ubuntu Intrepid
[ikiwiki.git] / IkiWiki.pm
index a81e34c3dfcb82b47ab743a53bf2eadb4b4238ad..54e00ec7b57bae548c1e559e246a3cc6763ea131 100644 (file)
@@ -1536,15 +1536,19 @@ sub run_hooks ($$) {
        my $sub=shift;
 
        if (exists $hooks{$type}) {
-               my @deferred;
+               my (@first, @middle, @last);
                foreach my $id (keys %{$hooks{$type}}) {
-                       if ($hooks{$type}{$id}{last}) {
-                               push @deferred, $id;
-                               next;
+                       if ($hooks{$type}{$id}{first}) {
+                               push @first, $id;
+                       }
+                       elsif ($hooks{$type}{$id}{last}) {
+                               push @last, $id;
+                       }
+                       else {
+                               push @middle, $id;
                        }
-                       $sub->($hooks{$type}{$id}{call});
                }
-               foreach my $id (@deferred) {
+               foreach my $id (@first, @middle, @last) {
                        $sub->($hooks{$type}{$id}{call});
                }
        }
@@ -1597,8 +1601,6 @@ sub rcs_receive () {
 }
 
 sub globlist_to_pagespec ($) {
-       print STDERR "warning: deprecated GlobList style PageSpec \"$_[0]\" will stop working in ikiwiki version 3.0\n";
-
        my @globlist=split(' ', shift);
 
        my (@spec, @skip);
@@ -1626,7 +1628,10 @@ sub globlist_to_pagespec ($) {
 
 sub is_globlist ($) {
        my $s=shift;
-       return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+       my $ret= ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+       print STDERR "warning: deprecated GlobList style PageSpec \"$s\" will stop working in ikiwiki version 3.0\n"
+               if $ret && $s !~ /TMPL_VAR/; # hack alert
+       return $ret;
 }
 
 sub safequote ($) {