- if (! exists $depends{$page}) {
- $depends{$page}=$pagespec;
- }
- else {
- $depends{$page}=pagespec_merge($depends{$page}, $pagespec);
+ my $deptype=0;
+ if (@_) {
+ my %params=@_;
+
+ $deptype=$deptype | $DEPEND_PRESENCE if $params{presence};
+ $deptype=$deptype | $DEPEND_LINKS if $params{links};
+ }
+ $deptype=$DEPEND_CONTENT unless $deptype;
+
+ # Is the pagespec a simple page name?
+ if ($pagespec =~ /$config{wiki_file_regexp}/ &&
+ $pagespec !~ /[\s*?()!]/) {
+ $depends_simple{$page}{lc $pagespec} |= $deptype;
+ return 1;
+ }
+
+ # Analyse the pagespec, and match it against all pages
+ # to get a list of influences, and add explicit
+ # content dependencies for those.
+ my $sub=pagespec_translate($pagespec);
+ return if $@;
+ foreach my $p (keys %pagesources) {
+ my $r=$sub->($p, location => $page );
+ my %i=$r->influences;
+ foreach my $i (keys %i) {
+ $depends_simple{$page}{lc $i} |= $i{$i};
+ }