Annotation of doc/loncapafiles/removenolongerused.piml, revision 1.17

1.17    ! raeburn     1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
        !             2:         "http://lpml.sourceforge.net/DTD/piml.dtd">
        !             3: <!-- removenolongerused.piml -->
        !             4: 
        !             5: <!-- $Id: removenolongerused.piml,v 1.17 2024/07/08 11:55:00 raeburn 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: -->
1.1       raeburn    30: <piml>
                     31: <targetroot>/</targetroot>
                     32: <files>
                     33: <file>
                     34: <target dist="default"></target>
                     35: <perlscript mode="fg">
                     36: 
1.2       raeburn    37: use File::Path();
1.1       raeburn    38: 
                     39: my @rcgifs = qw(anno.gif anot.gif anot2.gif back.gif bchat.gif bkm.gif blog.gif brws.gif catalog.gif ccat.gif ccrs.gif chrt.gif clst.gif com.gif conf.gif courses.gif cprv.gif cstr.gif del.gif docs.gif egrd.gif enrl.gif eval.gif fdbk.gif forw.gif grds.gif grps.gif keys.gif ledsend.gif list.gif logout.gif mail.gif mcrs.gif mrk.gif nav.gif new.gif parm.gif pcsrt.gif pcstr.gif pdfupload.gif pgrd.gif port.gif pparm.gif pref.gif prt.gif pub.gif rcrs.gif reload.gif remotebg.gif res.gif roles.gif rsrv.gif rtrv.gif sbkm.gif sctr.gif spacer.gif sprs.gif src.gif srvr.gif stat.gif subm.gif title.gif vbkm.gif);
                     40: 
                     41: my %paths = (
                     42:               'londaemons' =&gt; '/home/httpd/perl',
                     43:               'apache'     =&gt; '/home/httpd/lib/perl/Apache',
                     44:               'londocroot' =&gt; '/home/httpd/html',
                     45:               'rcgifs'     =&gt; '/home/httpd/html/res/adm/pages',
1.9       raeburn    46:               'debug'      =&gt; '/home/httpd/perl/debug',
1.1       raeburn    47:             );
                     48:  
                     49: my %files = (
1.5       raeburn    50:               'londaemons' =&gt; ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'],
1.1       raeburn    51:               'apache'     =&gt; ['londropadd.pm','lonconstruct.pm',
1.6       raeburn    52:                                'lonremote.pm','admbookmarks.pm','lonassignments.pm'],
1.1       raeburn    53:               'londocroot' =&gt; ['adm/rat/extpickcode.html',
                     54:                                'adm/rat/extpickframe.html',
                     55:                                'res/adm/pages/imgmaps.html',
                     56:                                'res/adm/pages/menu.html',
1.7       raeburn    57:                                'res/adm/pages/homeworkmenu.html',
                     58:                                'adm/help/gif/vbkm.gif',
1.14      raeburn    59:                                'adm/help/eps/vbkm.eps',
                     60:                                'adm/jQuery/js/jquery-1.3.2.min.js',
                     61:                                'adm/jQuery/js/jquery-1.6.2.min.js',
                     62:                                'adm/jQuery/js/jquery-1.11.3.min.js',
1.16      raeburn    63:                                'adm/jQuery/js/jquery-3.2.1.min.js',
1.14      raeburn    64:                                'adm/jQuery/js/jquery-ui-1.7.2.custom.min.js',
                     65:                                'adm/jQuery/js/jquery-ui-1.8.16.custom.min.js',
                     66:                                'adm/jQuery/js/jquery-ui-1.11.4.custom.min.js',
1.16      raeburn    67:                                'adm/jQuery/js/jquery-ui-1.12.1.custom.min.js',
1.14      raeburn    68:                                'adm/jQuery/css/smoothness/jquery-ui-1.7.2.custom.css',
                     69:                                'adm/jQuery/css/smoothness/jquery-ui-1.8.16.custom.css',
1.15      raeburn    70:                                'adm/jQuery/js/css/smoothness/jquery-ui-1.11.4.custom.css',
1.16      raeburn    71:                                'adm/jQuery/js/css/smoothness/jquery-ui-1.12.1.custom.min.css',
1.15      raeburn    72:                                'adm/reactionresponse/reaction_frame.html',
                     73:                                'adm/reactionresponse/reaction_window.html'],
1.9       raeburn    74:               'debug'      =&gt; ['archive_coursedata_tables.pl'],
1.1       raeburn    75:             );
                     76: 
                     77: my %dirs = (
1.10      raeburn    78:               'londocroot' =&gt; ['adm/lonLCDfont',
                     79:                                   'htmlarea',
1.12      raeburn    80:                                   'res/adm/pages/bookmarkmenu',
1.13      raeburn    81:                                   'res/adm/pages/reactionresponse',
1.14      raeburn    82:                                   'adm/jsMath',
                     83:                                   'adm/jQuery/css/ui-lightness'],
1.1       raeburn    84:            );
                     85: 
                     86: my %multis = (
1.8       raeburn    87:                 'rcgifs'     =&gt; \@rcgifs,
1.1       raeburn    88:              ); 
                     89: my @filestodelete = ();
                     90: my @dirstodelete = ();
                     91: my @multistodelete = ();
                     92: my @gifstodelete = ();
                     93: foreach my $key (sort(keys(%files))) {
                     94:     if ($paths{$key} ne '') {
                     95:         if (ref($files{$key}) eq 'ARRAY') {
                     96:             foreach my $file (@{$files{$key}}) {
1.10      raeburn    97:                 if (($file ne '') && (-f $paths{$key}.'/'.$file)) {
1.1       raeburn    98:                     push(@filestodelete,$paths{$key}.'/'.$file);
                     99:                 }
                    100:             }
                    101:         }
                    102:     }
                    103: }
                    104: 
                    105: foreach my $key (sort(keys(%dirs))) {
                    106:     if ($paths{$key} ne '') {
                    107:         if (ref($dirs{$key}) eq 'ARRAY') {
                    108:             foreach my $dir (@{$dirs{$key}}) {
1.10      raeburn   109:                 if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) {
1.1       raeburn   110:                     push(@dirstodelete,$paths{$key}.'/'.$dir);
                    111:                 }
                    112:             }
                    113:         }
                    114:     }
                    115: }
                    116: 
                    117: foreach my $key (sort(keys(%multis))) {
                    118:     if ($paths{$key} ne '') {
                    119:         if (ref($multis{$key}) eq 'ARRAY') {
                    120:             foreach my $file (@{$dirs{$key}}) {
                    121:                 if (-f $paths{$key}.'/'.$file) {
                    122:                     push(@multistodelete,$paths{$key}.'/'.$file);
                    123:                     push(@gifstodelete,$file);
                    124:                 }
                    125:             }
                    126:         }
                    127:     }
                    128: }
                    129: 
                    130: if (@dirstodelete > 0) {
                    131:     print "\nThe following directories were installed for an earlier version of LON-CAPA, and are no longer needed. It is recommended that you delete them. For each one, enter Y if you would the directory to be deleted.\n\n";
                    132:     foreach my $dir (@dirstodelete) {
1.2       raeburn   133:         next if (($dir =~/\*/) || ($dir eq '') || ($dir eq '/'));  
1.1       raeburn   134:         print "$dir  -- delete? Enter: Y or N:\n";
                    135:         my $choice=&lt;&gt;;
                    136:         chomp($choice);
1.3       raeburn   137:         $choice =~ s/\s+//g;
1.2       raeburn   138:         if ($choice eq 'Y') {
1.11      raeburn   139:             File::Path::rmtree($dir);
1.1       raeburn   140:         }
                    141:     }
                    142: }
                    143: 
                    144: if (@filestodelete > 0) {
                    145:    print "\nThe following files were installed for an earlier version of LON-CAPA, and are no longer needed. It is recommended that you delete them. For each one, enter Y if you would the file to be deleted.\n\n";
                    146:     foreach my $file (@filestodelete) {
1.2       raeburn   147:         next if (($file =~/\*/) || ($file eq '') || ($file eq '/'));
1.1       raeburn   148:         print "$file -- remove? Enter? Y or N:\n";
                    149:         my $choice=&lt;&gt;;
                    150:         chomp($choice);
1.2       raeburn   151:         $choice =~ s/\s+//g;
                    152:         if ($choice eq 'Y') {
1.1       raeburn   153:             unlink($file);
                    154:         }
                    155:     }
                    156: }
                    157: 
                    158: if (@multistodelete > 0) {
                    159:     my $num = scalar(@multistodelete);
                    160:     print "\nThe following $num gif image files were installed in $paths{rcgifs}/ for use with the LON-CAPA Remote Control (available in an earlier version of LON-CAPA), and now no longer used:\n".join(' ',@gifstodelete)."\n".
                    161:           "Enter Y if you would all $num files to be deleted.\n\n".
                    162:           "Remove? Y or N:\n";
                    163:     my $choice=&lt;&gt;;
                    164:     chomp($choice);
1.2       raeburn   165:     $choice =~ s/\s+//g;
                    166:     if ($choice eq 'Y') {
1.1       raeburn   167:         foreach my $item (@multistodelete) {
1.8       raeburn   168:             next if (($item =~/\*/) || ($item eq '') || ($item eq '/'));
1.1       raeburn   169:             unlink($item);
                    170:         }
                    171:     }
                    172: }
                    173: 
                    174: </perlscript>
                    175: </file>
                    176: </files>
                    177: </piml>

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