From: Martin Mares Date: Fri, 11 Feb 2011 15:23:33 +0000 (+0100) Subject: Added tracking of dependencies from MJ's web X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=46d86b4ed6f355f9257cfa3c5b87b10d054ea8cf;p=temple.git Added tracking of dependencies from MJ's web It is up to external modules to read the list of dependencies and process it somehow. --- diff --git a/UCW/Temple.pm b/UCW/Temple.pm index 7224ac4..eded624 100644 --- a/UCW/Temple.pm +++ b/UCW/Temple.pm @@ -24,6 +24,12 @@ sub out { return; } +our %deps = (); + +sub add_depend($) { + $deps{$_[0]} = 1; +} + sub get_nested($$$) { my ($r,$left,$right) = @_; pos $$r = pos($$r)-1; @@ -134,6 +140,7 @@ sub parse_string($) { sub parse_file($) { my ($name) = @_; + add_depend($name); my $fh = new IO::File $name; die "Unable to open $name: $!" unless defined $fh; my $text; @@ -190,6 +197,7 @@ sub include { sub load { my $f = shift @_; (!defined($f) || @_) and die "\@load requires only one argument"; + UCW::Temple::add_depend($f); require $f; return; }