[LON-CAPA-cvs] cvs: loncom / lond /interface lonmeta.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 14 Mar 2003 19:29:36 -0000


albertel		Fri Mar 14 14:29:36 2003 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
    /loncom	lond 
  Log:
  - more fixes for a file named ).problem
  
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.27 loncom/interface/lonmeta.pm:1.28
--- loncom/interface/lonmeta.pm:1.27	Thu Mar 13 21:26:12 2003
+++ loncom/interface/lonmeta.pm	Fri Mar 14 14:29:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.27 2003/03/14 02:26:12 www Exp $
+# $Id: lonmeta.pm,v 1.28 2003/03/14 19:29:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -320,7 +320,7 @@
    '<h4>Error Messages (visible to author and co-authors only)</h4>');
       my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2);
       foreach (keys %errormsgs) {
-	if ($_=~/^$disuri\_\d+$/) {
+	if ($_=~/^\Q$disuri\E\_\d+$/) {
           my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_});
 	  $r->print('<b>'.$content{'time'}.'</b>: '.$content{'message'}.
                     '<br />');
Index: loncom/lond
diff -u loncom/lond:1.113 loncom/lond:1.114
--- loncom/lond:1.113	Thu Mar 13 16:01:52 2003
+++ loncom/lond	Fri Mar 14 14:29:36 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.113 2003/03/13 21:01:52 albertel Exp $
+# $Id: lond,v 1.114 2003/03/14 19:29:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1776,20 +1776,26 @@
     if ($fname=~/^(.+)\/[^\/]+$/) {
        $ulsdir=$1;
     }
+    my ($fnamere1,$fnamere2);
+    # remove version if already specified
     $fname=~s/\.\d+\.(\w+(?:\.meta)*)$/\.$1/;
-    $fname=~s/\.(\w+(?:\.meta)*)$/\.\(\\d\+\)\.$1\$/;
-
+    # get the bits that go before and after the version number
+    if ( $fname=~/^(.*\.)(\w+(?:\.meta)*)$/ ) {
+	$fnamere1=$1;
+	$fnamere2='.'.$2;
+    }
     if (-e $fname) { $version=1; }
     if (-e $ulsdir) {
        if(-d $ulsdir) {
           if (opendir(LSDIR,$ulsdir)) {
+
              while ($ulsfn=readdir(LSDIR)) {
 # see if this is a regular file (ignore links produced earlier)
                  my $thisfile=$ulsdir.'/'.$ulsfn;
                  unless (-l $thisfile) {
-		    if ($thisfile=~/$fname/) {
-		        if ($1>$version) { $version=$1; }
-                    }
+		     if ($thisfile=~/\Q$fnamere1\E(\d+)\Q$fnamere2\E/) {
+			 if ($1>$version) { $version=$1; }
+		     }
 		 }
              }
              closedir(LSDIR);