--- loncom/lonnet/perl/lonnet.pm 2001/07/27 20:17:14 1.134 +++ loncom/lonnet/perl/lonnet.pm 2001/08/04 13:38:35 1.135 @@ -121,7 +121,8 @@ # 5/26,5/28 Gerd Kortemeyer # 5/30 H. K. Ng # 6/1 Gerd Kortemeyer -# +# July Guy Albertelli +# 8/4 Gerd Kortemeyer package Apache::lonnet; @@ -130,7 +131,7 @@ use Apache::File; use LWP::UserAgent(); use HTTP::Headers; use vars -qw(%perlvar %hostname %homecache %spareid %hostdom %libserv %pr %prp %fe %fd $readit %metacache); +qw(%perlvar %hostname %homecache %spareid %hostdom %libserv %pr %prp %fe %fd $readit %metacache %packagetab); use IO::Socket; use GDBM_File; use Apache::Constants qw(:common :http); @@ -1851,6 +1852,8 @@ sub metadata { my $token; while ($token=$parser->get_token) { if ($token->[0] eq 'S') { + if (defined($token->[2]->{'package'})) { + } else { my $entry=$token->[1]; my $unikey=$entry; if (defined($token->[2]->{'part'})) { @@ -1872,7 +1875,8 @@ sub metadata { ) { $metacache{$uri.':'.$unikey}= $metacache{$uri.':'.$unikey.'.default'}; } - } + } + } } } return $metacache{$uri.':'.$what}; @@ -2154,6 +2158,17 @@ if ($readit ne 'done') { } } +# ---------------------------------------------------------- Read package table +{ + my $config=Apache::File->new("$perlvar{'lonTabDir'}/packages.tab"); + + while (my $configline=<$config>) { + chomp($configline); + my ($short,$plain)=split(/:/,$configline); + if ($plain ne '') { $packagetab{$short}=$plain; } + } +} + # ------------------------------------------------------------- Read file types { my $config=Apache::File->new("$perlvar{'lonTabDir'}/filetypes.tab");