- if ($pagespec =~ /$config{wiki_file_regexp}/ &&
- $pagespec !~ /[\s*?()!]/) {
- # a simple dependency, which can be matched by string eq
- $depends_simple{$page}{lc $pagespec} = 1;
+ # Is the pagespec a simple page name?
+ my $simple=$pagespec =~ /$config{wiki_file_regexp}/ &&
+ $pagespec !~ /[\s*?()!]/;
+
+ my $deptype=$DEPEND_CONTENT;
+ if (@_) {
+ my %params=@_;
+
+ # Is the pagespec limited to terms that will continue
+ # to match pages as long as those pages exist?
+ my $limited=1;
+ while ($limited && $pagespec=~m/(\w+)\([^\)]*\)/g) {
+ $limited = $1 =~ /^(glob|internal|creation_month|creation_day|creation_year|created_before|created_after)$/;
+ }
+
+ $deptype=$deptype & ~$DEPEND_CONTENT | $DEPEND_PRESENCE
+ if $params{presence} && $limited;
+ $deptype=$deptype & ~$DEPEND_CONTENT | $DEPEND_LINKS
+ if $params{links} && $limited;
+ }
+
+ if ($simple) {
+ $depends_simple{$page}{lc $pagespec} |= $deptype;