Annotation of doc/loncapafiles/picins_check.piml, revision 1.54

1.1       raeburn     1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
                      2: 	"http://lpml.sourceforge.net/DTD/piml.dtd">
                      3: <!-- picins_check.piml -->
                      4: <!-- Stuart Raeburn -->
                      5: 
1.54    ! raeburn     6: <!-- $Id: picins_check.piml,v 1.53 2023/05/09 00:55:29 raeburn Exp $ -->
1.1       raeburn     7: 
                      8: <!--
                      9: 
                     10: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                     11: 
                     12: LON-CAPA is free software; you can redistribute it and/or modify
                     13: it under the terms of the GNU General Public License as published by
                     14: the Free Software Foundation; either version 2 of the License, or
                     15: (at your option) any later version.
                     16: 
                     17: LON-CAPA is distributed in the hope that it will be useful,
                     18: but WITHOUT ANY WARRANTY; without even the implied warranty of
                     19: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     20: GNU General Public License for more details.
                     21: 
                     22: You should have received a copy of the GNU General Public License
                     23: along with LON-CAPA; if not, write to the Free Software
                     24: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     25: 
                     26: /home/httpd/html/adm/gpl.txt
                     27: 
                     28: http://www.lon-capa.org/
                     29: 
                     30: -->
                     31: 
                     32: <piml>
                     33: <files>
                     34: <file>
1.54    ! raeburn    35: <perlscript mode="fg" dist="fedora9 fedora10 fedora11 fedora12 fedora13 fedora14 fedora15 fedora16 fedora17 fedora18 fedora19 fedora20 fedora21 fedora22 fedora 23 fedora24 fedora25 fedora26 fedora27 fedora28 fedora29 fedora30 fedora31 fedora32 fedora33 fedora34 fedora35 fedora36 fedora37 fedora38 rhes6 scientific6 centos6 oracle6 rhes7 scientific7 centos7 oracle7 rhes8 centos8 oracle8 rocky8 alma8 centos8-stream centos9-stream rhes9 oracle9 rocky9 alma9 sles11 sles12 sles15 suse11.1 suse11.2 suse11.3 suse11.4 suse12.1 suse12.2 suse12.3 suse13.1 suse13.2 debian5 debian6 ubuntu8 ubuntu10 ubuntu12 ubuntu14 ubuntu16 ubuntu18 ubuntu20 ubuntu22 ubuntu24">
1.1       raeburn    36:     my $picinspath = '/usr/share/texmf/tex/latex/picins'; 
                     37:     my $file = 'picins.sty';
                     38:     if (!-e "$picinspath/$file") {
                     39:         if (!-d $picinspath) {
                     40:             my @parts=split('/',$picinspath);
                     41:             my $filepath;
                     42:             foreach my $part (@parts) {
                     43:                 $filepath.= '/'.$part;
                     44:                 if (!-d $filepath) {
                     45:                     mkdir($filepath,0755);
                     46:                 }
                     47:             }
1.32      raeburn    48:         } else {
1.33      raeburn    49:             chmod(0755,$picinspath);
1.1       raeburn    50:         }
                     51:         if (-d $picinspath) {
1.12      raeburn    52:             my $srcurl = 'http://install.loncapa.org/ctan/tex-archive/macros/latex209/contrib/picins/picins.sty';
                     53:             system("/usr/bin/wget -O $picinspath/$file $srcurl 1>/dev/null 2>/dev/null");
                     54:             die("/usr/bin/wget -O $srcurl failed") if $?;
1.26      raeburn    55:             chmod(0644, "$picinspath/$file");
1.1       raeburn    56:             if (-e $picinspath.'/'.$file) {
1.52      raeburn    57:                 if ('<DIST />' eq 'ubuntu16' || '<DIST />' eq 'ubuntu18' || 
1.54    ! raeburn    58:                     '<DIST />' eq 'ubuntu20' || '<DIST />' eq 'ubuntu22' ||
        !            59:                     '<DIST />' eq 'ubuntu24') {
1.36      raeburn    60:                     system('/usr/bin/mktexlsr');
                     61:                     die("Can't run /usr/bin/mktexlsr") if $?;
                     62:                     print "$picinspath/$file created and /usr/bin/mktexlsr ran successfully.\n";
                     63:                 } else { 
                     64:                     system('/usr/bin/texconfig rehash  1>/dev/null 2>/dev/null');
                     65:                     die("Can't run /usr/bin/texconfig rehash") if $?;
                     66:                     print "$picinspath/$file created and /usr/bin/texconfig rehash ran successfully.\n";
                     67:                 }
1.32      raeburn    68:                 chmod(0644,"$picinspath/$file");
1.1       raeburn    69:             } else {
                     70:                 die("Can't find $picinspath/$file");
                     71:             }
                     72:         } else {
                     73:             die("Can't find $picinspath") if $?;
                     74:         }
                     75:     } else {
1.32      raeburn    76:         chmod(0755,$picinspath);
                     77:         chmod(0644,"$picinspath/$file");
1.1       raeburn    78:         print "No action required - $picinspath/$file already exists.\n";
                     79:     }
                     80: </perlscript>
                     81: </file>
                     82: </files>
                     83: </piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>