Annotation of doc/loncapafiles/removenolongerused.piml, revision 1.1.2.13
1.1 raeburn 1: <piml>
2: <targetroot>/</targetroot>
3: <files>
4: <file>
5: <target dist="default"></target>
6: <perlscript mode="fg">
7:
1.1.2.2 raeburn 8: use File::Path();
1.1 raeburn 9:
10: my %paths = (
11: 'londaemons' => '/home/httpd/perl',
12: 'apache' => '/home/httpd/lib/perl/Apache',
13: 'londocroot' => '/home/httpd/html',
1.1.2.7 raeburn 14: 'debug' => '/home/httpd/perl/debug',
1.1 raeburn 15: );
16:
17: my %files = (
1.1.2.4 raeburn 18: 'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'],
1.1 raeburn 19: 'apache' => ['londropadd.pm','lonconstruct.pm',
1.1.2.5 raeburn 20: 'admbookmarks.pm','lonassignments.pm'],
1.1 raeburn 21: 'londocroot' => ['adm/rat/extpickcode.html',
1.1.2.6 raeburn 22: 'adm/rat/extpickframe.html',
23: 'adm/help/gif/vbkm.gif',
1.1.2.11 raeburn 24: 'adm/help/eps/vbkm.eps',
25: 'adm/jQuery/js/jquery-1.3.2.min.js',
26: 'adm/jQuery/js/jquery-1.6.2.min.js',
27: 'adm/jQuery/js/jquery-1.11.3.min.js',
1.1.2.13! raeburn 28: 'adm/jQuery/js/jquery-3.2.1.min.js',
1.1.2.11 raeburn 29: 'adm/jQuery/js/jquery-ui-1.7.2.custom.min.js',
30: 'adm/jQuery/js/jquery-ui-1.8.16.custom.min.js',
31: 'adm/jQuery/js/jquery-ui-1.11.4.custom.min.js',
1.1.2.13! raeburn 32: 'adm/jQuery/js/jquery-ui-1.12.1.custom.min.js',
1.1.2.11 raeburn 33: 'adm/jQuery/css/smoothness/jquery-ui-1.7.2.custom.css',
34: 'adm/jQuery/css/smoothness/jquery-ui-1.8.16.custom.css',
1.1.2.12 raeburn 35: 'adm/jQuery/js/css/smoothness/jquery-ui-1.11.4.custom.css',
1.1.2.13! raeburn 36: 'adm/jQuery/js/css/smoothness/jquery-ui-1.12.1.custom.min.css',
1.1.2.12 raeburn 37: 'adm/reactionresponse/reaction_frame.html',
38: 'adm/reactionresponse/reaction_window.html'],
1.1.2.7 raeburn 39: 'debug' => ['archive_coursedata_tables.pl'],
1.1 raeburn 40: );
41:
42: my %dirs = (
1.1.2.7 raeburn 43: 'londocroot' => ['htmlarea',
1.1.2.9 raeburn 44: 'res/adm/pages/bookmarkmenu',
45: 'res/adm/pages/reactionresponse',
1.1.2.11 raeburn 46: 'adm/jsMath',
47: 'adm/jQuery/css/ui-lightness'],
1.1 raeburn 48: );
49:
50: my @filestodelete = ();
51: my @dirstodelete = ();
52: foreach my $key (sort(keys(%files))) {
53: if ($paths{$key} ne '') {
54: if (ref($files{$key}) eq 'ARRAY') {
55: foreach my $file (@{$files{$key}}) {
1.1.2.7 raeburn 56: if (($file ne '') && (-f $paths{$key}.'/'.$file)) {
1.1 raeburn 57: push(@filestodelete,$paths{$key}.'/'.$file);
58: }
59: }
60: }
61: }
62: }
63:
64: foreach my $key (sort(keys(%dirs))) {
65: if ($paths{$key} ne '') {
66: if (ref($dirs{$key}) eq 'ARRAY') {
67: foreach my $dir (@{$dirs{$key}}) {
1.1.2.7 raeburn 68: if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) {
1.1 raeburn 69: push(@dirstodelete,$paths{$key}.'/'.$dir);
70: }
71: }
72: }
73: }
74: }
75:
76: if (@dirstodelete > 0) {
77: 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";
78: foreach my $dir (@dirstodelete) {
1.1.2.2 raeburn 79: next if (($dir =~/\*/) || ($dir eq '') || ($dir eq '/'));
1.1 raeburn 80: print "$dir -- delete? Enter: Y or N:\n";
81: my $choice=<>;
82: chomp($choice);
1.1.2.2 raeburn 83: $choice =~ s/\s+//g;
84: if ($choice eq 'Y') {
1.1.2.8 raeburn 85: File::Path::rmtree($dir);
1.1 raeburn 86: }
87: }
88: }
89:
90: if (@filestodelete > 0) {
91: 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";
92: foreach my $file (@filestodelete) {
1.1.2.2 raeburn 93: next if (($file =~/\*/) || ($file eq '') || ($file eq '/'));
1.1 raeburn 94: print "$file -- remove? Enter? Y or N:\n";
95: my $choice=<>;
96: chomp($choice);
1.1.2.2 raeburn 97: $choice =~ s/\s+//g;
98: if ($choice eq 'Y') {
1.1 raeburn 99: unlink($file);
100: }
101: }
102: }
103:
104: </perlscript>
105: </file>
106: </files>
107: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>