Annotation of doc/loncapafiles/lcmathcomplex.piml, revision 1.1
1.1 ! raeburn 1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
! 2: "http://lpml.sourceforge.net/DTD/piml.dtd">
! 3: <!-- lcmathcomplex.piml -->
! 4:
! 5: <!-- $Id: lcmathcomplex.piml,v 1.1 2013/10/27 22:05:41 albertel Exp $ -->
! 6:
! 7: <!--
! 8:
! 9: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
! 10:
! 11: LON-CAPA is free software; you can redistribute it and/or modify
! 12: it under the terms of the GNU General Public License as published by
! 13: the Free Software Foundation; either version 2 of the License, or
! 14: (at your option) any later version.
! 15:
! 16: LON-CAPA is distributed in the hope that it will be useful,
! 17: but WITHOUT ANY WARRANTY; without even the implied warranty of
! 18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 19: GNU General Public License for more details.
! 20:
! 21: You should have received a copy of the GNU General Public License
! 22: along with LON-CAPA; if not, write to the Free Software
! 23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! 24:
! 25: /home/httpd/html/adm/gpl.txt
! 26:
! 27: http://www.lon-capa.org/
! 28:
! 29: -->
! 30:
! 31: <piml>
! 32: <targetroot>/</targetroot>
! 33: <files>
! 34: <file>
! 35: <target dist="default">/home/httpd/lonUsers</target>
! 36: <perlscript mode="fg">
! 37:
! 38: use strict;
! 39: use Config;
! 40:
! 41: my $nvsize = $Config{nvsize} ||
! 42: ($Config{uselongdouble} && $Config{longdblsize}) ||
! 43: $Config{doublesize};
! 44:
! 45: unless ($nvsize =~ /^\d+$/) {
! 46: print "Unexpected value: $nvsize determined for nvsize from Config.pm for use in LCMathComplex.pm\n";
! 47: exit;
! 48: }
! 49:
! 50: my $fh;
! 51: my ($mathcomplex,$changed);
! 52: if (open($fh,"</home/httpd/lib/perl/LONCAPA/LCMathComplex.pm")) {
! 53: while (<$fh>) {
! 54: if (/^\s*\Qmy $nvsize = \E(\d+);/) {
! 55: my $currsize = $1;
! 56: if ($currsize != $nvsize) {
! 57: $changed = 1;
! 58: $mathcomplex .= ' my $nvsize = '.$nvsize.';'."\n";
! 59: } else {
! 60: print "nvsize in LCMathComplex.pm already set to $nvsize -- no action required.\n";
! 61: last;
! 62: }
! 63: } else {
! 64: $mathcomplex .= $_;
! 65: }
! 66: }
! 67: close($fh);
! 68: if ($changed) {
! 69: if (open($fh,">/home/httpd/lib/perl/LONCAPA/LCMathComplex.pm")) {
! 70: print $fh $mathcomplex;
! 71: close($fh);
! 72: print "nvsize now set to $nvsize in LCMathComplex.pm\n";
! 73: }
! 74: }
! 75: }
! 76:
! 77: </perlscript>
! 78: </file>
! 79: </files>
! 80: </piml>
! 81:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>