[LON-CAPA-cvs] cvs: doc /loncapafiles updatequery.piml

harris41 lon-capa-cvs@mail.lon-capa.org
Mon, 13 May 2002 09:05:18 -0000


harris41		Mon May 13 05:05:18 2002 EDT

  Modified files:              
    /doc/loncapafiles	updatequery.piml 
  Log:
  now functional; BUG 327
  
  
  
Index: doc/loncapafiles/updatequery.piml
diff -u doc/loncapafiles/updatequery.piml:1.6 doc/loncapafiles/updatequery.piml:1.7
--- doc/loncapafiles/updatequery.piml:1.6	Sun May 12 22:24:44 2002
+++ doc/loncapafiles/updatequery.piml	Mon May 13 05:05:18 2002
@@ -1,7 +1,7 @@
 <!-- updatequery.piml -->
 <!-- Scott Harrison -->
 
-<!-- $Id: updatequery.piml,v 1.6 2002/05/13 02:24:44 harris41 Exp $ -->
+<!-- $Id: updatequery.piml,v 1.7 2002/05/13 09:05:18 harris41 Exp $ -->
 
 <!--
 
@@ -52,7 +52,7 @@
 </perlscript>
 </file>
 <file>
-<target dist='default'>/home/httpd/lonUsers2/</target>
+<target dist='default'>/home/httpd/lonUsers/</target>
 <perlscript mode='fg'>
 $|=1;
 unless (-e "<TARGET />") {
@@ -242,8 +242,8 @@
 }
 
 # update loncapa.conf
-#my $confdir='/etc/httpd/conf/';
-my $confdir='';
+my $confdir='/etc/httpd/conf/';
+#my $confdir='';
 my $filename='loncapa.conf';
 my %perlvar;
     if (-e "$confdir$filename") {
@@ -295,8 +295,8 @@
 <target dist='default'>/</target>
 <perlscript mode='fg'>
 # read values from loncapa.conf
-#my $confdir='/etc/httpd/conf/';
-my $confdir='';
+my $confdir='/etc/httpd/conf/';
+#my $confdir='';
 my $filename='loncapa.conf';
 my %perlvar;
     if (-e "$confdir$filename") {
@@ -311,6 +311,19 @@
 	}
 	close(CONFIG);
     }
+my %perlvarstatic;
+    if (-e "${confdir}loncapa_apache.conf") {
+	open(CONFIG,'&lt;'.$confdir.'loncapa_apache.conf') or 
+          die("Can't read ${confdir}loncapa_apache.conf");
+	while (my $configline=&lt;CONFIG&gt;) {
+	    if ($configline =~ /^[^\#]*PerlSetVar/) {
+		my ($unused,$varname,$varvalue)=split(/\s+/,$configline);
+		chomp($varvalue);
+		$perlvarstatic{$varname}=$varvalue;
+	    }
+	}
+	close(CONFIG);
+    }
 # implement editing logic below, interactively
 # update loncapa.conf until 7 is entered
 
@@ -394,6 +407,15 @@
 
   }
 }
+    open(OUT,"&gt;$confdir$filename") or
+      die("Cannot output to $confdir$filename\n");
+    foreach my $key (keys %perlvar) {
+      my $value=$perlvar{$key};
+      print(OUT &lt;&lt;END) unless $perlvarstat{$key};
+PerlSetVar     $key      $value
+END
+    }
+    close(OUT);
 </perlscript>
 </file>
 <file>