[LON-CAPA-cvs] cvs: loncom(version_0_5_1) /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 30 Aug 2002 19:09:27 -0000


albertel		Fri Aug 30 15:09:27 2002 EDT

  Modified files:              (Branch: version_0_5_1)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - backport of metadata <import> fixes from 1.275
  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.267 loncom/lonnet/perl/lonnet.pm:1.267.4.1
--- loncom/lonnet/perl/lonnet.pm:1.267	Tue Aug 13 10:37:52 2002
+++ loncom/lonnet/perl/lonnet.pm	Fri Aug 30 15:09:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.267 2002/08/13 14:37:52 albertel Exp $
+# $Id: lonnet.pm,v 1.267.4.1 2002/08/30 19:09:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2743,7 +2743,7 @@
 	      my $package=$token->[2]->{'package'};
 	      my $keyroot='';
               if ($prefix) {
-		  $keyroot.='_'.$prefix;
+		  $keyroot.=$prefix;
               } else {
                 if (defined($token->[2]->{'part'})) { 
                    $keyroot.='_'.$token->[2]->{'part'}; 
@@ -2801,12 +2801,14 @@
 #
 # Importing a library here
 #                
-		 if (defined($depthcount)) { $depthcount++; } else 
-                                           { $depthcount=0; }
                  if ($depthcount<20) {
-		     foreach (split(/\,/,&metadata($uri,'keys',
-                                  $parser->get_text('/import'),$unikey,
-                                  $depthcount))) {
+		     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)))) {
                          $metathesekeys{$_}=1;
 		     }
 		 }