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

www www@source.lon-capa.org
Thu, 03 Jun 2010 00:07:17 -0000


www		Thu Jun  3 00:07:17 2010 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Disentangling the code in preparation for new importmodes.
  This should not have changed anything.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1066 loncom/lonnet/perl/lonnet.pm:1.1067
--- loncom/lonnet/perl/lonnet.pm:1.1066	Sun May 30 21:12:24 2010
+++ loncom/lonnet/perl/lonnet.pm	Thu Jun  3 00:07:17 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1066 2010/05/30 21:12:24 droeschl Exp $
+# $Id: lonnet.pm,v 1.1067 2010/06/03 00:07:17 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8241,26 +8241,22 @@
 #
 		    my $entry=$token->[1];
 		    my $unikey;
-		    if ($entry eq 'import') {
-			$unikey='';
-		    } else {
-			$unikey=$entry;
-		    }
-		    $unikey.=&add_prefix_and_part($prefix,$token->[2]->{'part'});
-
-		    if (defined($token->[2]->{'id'})) { 
-			$unikey.='_'.$token->[2]->{'id'}; 
-		    }
 
 		    if ($entry eq 'import') {
 #
 # Importing a library here
 #
+                        my $location=$parser->get_text('/import');
+                        my $dir=$filename;
+                        $dir=~s|[^/]*$||;
+                        $location=&filelocation($dir,$location);
+ 
+                        $unikey=&add_prefix_and_part($prefix,$token->[2]->{'part'});
+                        if (defined($token->[2]->{'id'})) {
+                           $unikey.='_'.$token->[2]->{'id'};
+                        }
+
 			if ($depthcount<20) {
-			    my $location=$parser->get_text('/import');
-			    my $dir=$filename;
-			    $dir=~s|[^/]*$||;
-			    $location=&filelocation($dir,$location);
 			    my $metadata = 
 				&metadata($uri,'keys', $location,$unikey,
 					  $depthcount+1);
@@ -8269,8 +8265,14 @@
 				$metathesekeys{$meta}=1;
 			    }
 			}
-		    } else { 
-			
+		    } else {
+#
+# Not importing, some other kind of non-package, non-library start tag
+# 
+                        $unikey=$entry.&add_prefix_and_part($prefix,$token->[2]->{'part'});
+                        if (defined($token->[2]->{'id'})) {
+                            $unikey.='_'.$token->[2]->{'id'};
+                        }
 			if (defined($token->[2]->{'name'})) { 
 			    $unikey.='_'.$token->[2]->{'name'}; 
 			}