[LON-CAPA-cvs] cvs: loncom /build lpml_parse.pl doc/loncapafiles loncapafiles.lpml

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 09 Dec 2005 20:41:36 -0000


albertel		Fri Dec  9 15:41:36 2005 EDT

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/build	lpml_parse.pl 
  Log:
  - updating lpml_parse so there can be an install time script run
  - switch the jsMath-font installtion to take place during install bnot build
  - update the plugins dir creation
  - gradesubmission/.pl was trying to install itself in a not existant location
  
  
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.463 doc/loncapafiles/loncapafiles.lpml:1.464
--- doc/loncapafiles/loncapafiles.lpml:1.463	Wed Dec  7 14:17:50 2005
+++ doc/loncapafiles/loncapafiles.lpml	Fri Dec  9 15:41:32 2005
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.463 2005/12/07 19:17:50 albertel Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.464 2005/12/09 20:41:32 albertel Exp $ -->
 
 <!--
 
@@ -546,6 +546,12 @@
 </directory>
 <directory dist='default'>
   <protectionlevel>modest_delete</protectionlevel>
+  <targetdir dist='default'>home/httpd/html/adm/jsMath/plugins</targetdir>
+  <categoryname>server readonly</categoryname>
+  <description>jsMath plugin files</description>
+</directory>
+<directory dist='default'>
+  <protectionlevel>modest_delete</protectionlevel>
   <targetdir dist='default'>home/httpd/html/adm/helper</targetdir>
   <categoryname>server readonly</categoryname>
   <description>XML specifications for helpers</description>
@@ -3072,7 +3078,7 @@
 </file>
 <file>
   <source>loncom/homework/gradesubmission.pl</source>
-  <target dist='default'>home/httpd/perl/cgi-bin/gradesubmission.pl</target>
+  <target dist='default'>home/httpd/cgi-bin/gradesubmission.pl</target>
   <categoryname>handler</categoryname>
   <description>
 Example script for use with external response.
@@ -3480,14 +3486,14 @@
 
 <file>
   <source>loncom/html/adm/jsMath/jsMath-fonts-1.2.zip</source>
-  <target dist='default'>home/httpd/html/adm/jsMath</target>
+  <target dist='default'>home/httpd/html/adm/jsMath/fonts/</target>
   <categoryname>script</categoryname>
   <description>
     Dynamically converts JME strings into either a png or ps file.
   </description>
-  <build trigger='always run'>
-loncom/html/adm/jsMath/commands /home/httpd/html/adm/jsMath
-  </build>
+  <installscript>
+commands /home/httpd/html/adm/jsMath
+  </installscript>
   <dependencies>
 commands;
 jsMath-fonts-1.2.zip;
@@ -3496,8 +3502,8 @@
 
 <fileglob>
   <glob>*.*</glob>
-  <sourcedir>loncom/html/adm/jsMath/plugins</sourcedir>
-  <targetdir dist='default'>home/httpd/html/adm/jsMath/plugins</targetdir>
+  <sourcedir>loncom/html/adm/jsMath/plugins/</sourcedir>
+  <targetdir dist='default'>home/httpd/html/adm/jsMath/plugins/</targetdir>
   <categoryname>interface file</categoryname>
   <description>
 jsMath is a Javascript solution to converting TeX to something the browser can see
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.52 loncom/build/lpml_parse.pl:1.53
--- loncom/build/lpml_parse.pl:1.52	Thu Sep 11 18:01:48 2003
+++ loncom/build/lpml_parse.pl	Fri Dec  9 15:41:35 2005
@@ -12,7 +12,7 @@
 # The LearningOnline Network with CAPA
 # lpml_parse.pl - Linux Packaging Markup Language parser
 #
-# $Id: lpml_parse.pl,v 1.52 2003/09/11 22:01:48 albertel Exp $
+# $Id: lpml_parse.pl,v 1.53 2005/12/09 20:41:35 albertel Exp $
 #
 # Written by Scott Harrison, codeharrison@yahoo.com
 #
@@ -313,6 +313,7 @@
 my $target;
 my $source;
 my $note;
+my $installscript;
 my $build;
 my $buildlink;
 my $commands;
@@ -384,6 +385,7 @@
     target => \&format_target,
     note => \&format_note,
     build => \&format_build,
+    installscript => \&format_installscript,
     status => \&format_status,
     dependencies => \&format_dependencies,
     privatedependencies => \&format_privatedependencies,
@@ -643,6 +645,8 @@
 	    my ($user,$group)=split(/\:/,$chown);
 	    $categoryhash{$category_att_name}='-o '.$user.' -g '.$group.
 		' -m '.$chmod;
+	    $categoryhash{"chmod.".$category_att_name}=$chmod;
+	    $categoryhash{"chown.".$category_att_name}=$chown;
 	}
 	return '';
     }
@@ -1218,7 +1222,7 @@
 sub format_file {
     my @tokeninfo=@_;
     $file=''; $source=''; $target=''; $categoryname=''; $description='';
-    $note=''; $build=''; $status=''; $dependencies='';
+    $note=''; $build=''; $status=''; $dependencies=''; $installscript='';
     my $text=&trim($parser->get_text('/file'));
     my $buildtest;
     $file_count++;
@@ -1294,6 +1298,15 @@
 	fi
 END
 	    }
+	    if ($installscript) {
+		my $dir = $sourceroot.'/'.$source;
+		$dir =~ s|/([^/]*)$||;
+		return <<"END";
+$buildtest	cd $dir ; sh $installscript\\
+		chmod -R $categoryhash{chmod.$categoryname} ${targetroot}/${target} \\
+		chown -R $categoryhash{chown.$categoryname} ${targetroot}/${target} \\
+END
+	    }
             my $bflag='-b1';
             $bflag='-b3' if $dependencies or $buildlink;
 	    return <<END;
@@ -1597,6 +1610,16 @@
     }
     return '';
 }
+# ------------------------------------------------ Format installscript section
+sub format_installscript {
+    my @tokeninfo=@_;
+    $installscript= &trim($parser->get_text('/installscript'));
+    if ($installscript) {
+	$parser->get_tag('/installscript');
+	$installscript=~s/([^\\])\\\s+/$1/g; # allow for lines split onto new lines
+    }
+    return '';
+}
 # -------------------------------------------------------- Format build section
 sub format_buildlink {
     my @tokeninfo=@_;