[LON-CAPA-cvs] cvs: loncom / LONCAPA.pm lond /publisher lonpublisher.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 10 Jan 2007 20:23:22 -0000


albertel		Wed Jan 10 15:23:22 2007 EDT

  Modified files:              
    /loncom	lond LONCAPA.pm 
    /loncom/publisher	lonpublisher.pm 
  Log:
  - lonid can have . and - now
  
  
Index: loncom/lond
diff -u loncom/lond:1.354 loncom/lond:1.355
--- loncom/lond:1.354	Wed Jan 10 14:18:12 2007
+++ loncom/lond	Wed Jan 10 15:22:30 2007
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.354 2007/01/10 19:18:12 albertel Exp $
+# $Id: lond,v 1.355 2007/01/10 20:22:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -60,7 +60,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.354 $'; #' stupid emacs
+my $VERSION='$Revision: 1.355 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -5920,8 +5920,7 @@
     my ($fname,$hostid,$ip,$newline)=@_;
     my $contents;
     my $found=0;
-    my $expr='^'.$hostid.':'.$ip.':';
-    $expr =~ s/\./\\\./g;
+    my $expr='^'.quotemeta($hostid).':'.quotemeta($ip).':';
     my $sh;
     if ($sh=IO::File->new("$fname.subscription")) {
 	while (my $subline=<$sh>) {
Index: loncom/LONCAPA.pm
diff -u loncom/LONCAPA.pm:1.22 loncom/LONCAPA.pm:1.23
--- loncom/LONCAPA.pm:1.22	Wed Dec 20 17:23:50 2006
+++ loncom/LONCAPA.pm	Wed Jan 10 15:22:30 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Base routines
 #
-# $Id: LONCAPA.pm,v 1.22 2006/12/20 22:23:50 albertel Exp $
+# $Id: LONCAPA.pm,v 1.23 2007/01/10 20:22:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -43,6 +43,7 @@
 	    $match_username $match_not_username
 	    $match_courseid $match_not_courseid
 	    $match_name
+            $match_lonid
 	    $match_handle   $match_not_handle);
 
 require Exporter;
@@ -54,11 +55,13 @@
 		    $match_username $match_not_username
 		    $match_courseid $match_not_courseid
 		    $match_name
+		    $match_lonid
 		    $match_handle   $match_not_handle);
 our %EXPORT_TAGS = ( 'match' =>[qw($match_domain   $match_not_domain
 				   $match_username $match_not_username
 				   $match_courseid $match_not_courseid
 				   $match_name
+				   $match_lonid
 				   $match_handle   $match_not_handle)],);
 my %perlvar;
 
@@ -136,6 +139,8 @@
     return $name;
 }
 
+$match_lonid     = $LONCAPA::lonid_re     = qr{[\w\-.]+};
+
 sub split_courseid {
     my ($courseid) = @_;
     my  ($domain,$coursenum) = 
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.215 loncom/publisher/lonpublisher.pm:1.216
--- loncom/publisher/lonpublisher.pm:1.215	Wed Dec  6 17:22:39 2006
+++ loncom/publisher/lonpublisher.pm	Wed Jan 10 15:23:21 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.215 2006/12/06 22:22:39 albertel Exp $
+# $Id: lonpublisher.pm,v 1.216 2007/01/10 20:23:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -495,7 +495,7 @@
     my $srcf=$2;
     opendir(DIR,$1);
     while ($filename=readdir(DIR)) {
-	if ($filename=~/\Q$srcf\E\.(\w+)$/) {
+	if ($filename=~/\Q$srcf\E\.($match_lonid)$/) {
 	    my $subhost=$1;
 	    if (($subhost ne 'meta' && $subhost ne 'subscription' &&
 		 $subhost ne 'tmp') &&
@@ -509,7 +509,7 @@
     if ( $sh=Apache::File->new("$target.subscription") ) {
 	&Apache::lonnet::logthis("opened $target.subscription");
 	while (my $subline=<$sh>) {
-	    if ($subline =~ /(^\w+):/) { 
+	    if ($subline =~ /^($match_lonid):/) { 
                 if ($1 ne $Apache::lonnet::perlvar{'lonHostID'}) { 
                    push(@subscribed,$1);
 	        }