--- loncom/lonnet/perl/lonnet.pm 2002/08/30 20:33:58 1.267.4.3 +++ loncom/lonnet/perl/lonnet.pm 2002/08/17 18:23:27 1.268 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.267.4.3 2002/08/30 20:33:58 albertel Exp $ +# $Id: lonnet.pm,v 1.268 2002/08/17 18:23:27 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2720,7 +2720,7 @@ sub metadata { # Look at timestamp of caching # Everything is cached by the main uri, libraries are never directly cached # - unless (abs($metacache{$uri.':cachedtimestamp'}-time)<600 && !defined($liburi)) { + unless (abs($metacache{$uri.':cachedtimestamp'}-time)<600) { # # Is this a recursive call for a library? # @@ -2743,7 +2743,7 @@ sub metadata { my $package=$token->[2]->{'package'}; my $keyroot=''; if ($prefix) { - $keyroot.=$prefix; + $keyroot.='_'.$prefix; } else { if (defined($token->[2]->{'part'})) { $keyroot.='_'.$token->[2]->{'part'}; @@ -2801,14 +2801,12 @@ sub metadata { # # Importing a library here # + if (defined($depthcount)) { $depthcount++; } else + { $depthcount=0; } if ($depthcount<20) { - my $location=$parser->get_text('/import'); - my $dir=$filename; - $dir=~s|[^/]*$||; - $location=&filelocation($dir,$location); - foreach (sort(split(/\,/,&metadata($uri,'keys', - $location,$unikey, - $depthcount+1)))) { + foreach (split(/\,/,&metadata($uri,'keys', + $parser->get_text('/import'),$unikey, + $depthcount))) { $metathesekeys{$_}=1; } } @@ -2833,9 +2831,8 @@ sub metadata { # the next is the end of "start tag" } } - $metacache{$uri.':keys'}=join(',',keys %metathesekeys); &metadata_generate_part0(\%metathesekeys,\%metacache,$uri); - $metacache{$uri.':allpossiblekeys'}=join(',',keys %metathesekeys); + $metacache{$uri.':keys'}=join(',',keys %metathesekeys); $metacache{$uri.':cachedtimestamp'}=time; # this is the end of "was not already recently cached } @@ -3138,6 +3135,14 @@ sub declutter { return $thisfn; } +# ------------------------------------------------------------- Clutter up URLs + +sub clutter { + my $thisfn='/'.&declutter(shift); + unless ($thisfn=~/^\/(uploaded|adm)\//) { $thisfn='/res'.$thisfn; } + return $thisfn; +} + # -------------------------------------------------------- Escape Special Chars sub escape {