Annotation of doc/loncapafiles/removenolongerused.piml, revision 1.1.2.12
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',
28: 'adm/jQuery/js/jquery-ui-1.7.2.custom.min.js',
29: 'adm/jQuery/js/jquery-ui-1.8.16.custom.min.js',
30: 'adm/jQuery/js/jquery-ui-1.11.4.custom.min.js',
31: 'adm/jQuery/css/smoothness/jquery-ui-1.7.2.custom.css',
32: 'adm/jQuery/css/smoothness/jquery-ui-1.8.16.custom.css',
1.1.2.12! raeburn 33: 'adm/jQuery/js/css/smoothness/jquery-ui-1.11.4.custom.css',
! 34: 'adm/reactionresponse/reaction_frame.html',
! 35: 'adm/reactionresponse/reaction_window.html'],
1.1.2.7 raeburn 36: 'debug' => ['archive_coursedata_tables.pl'],
1.1 raeburn 37: );
38:
39: my %dirs = (
1.1.2.7 raeburn 40: 'londocroot' => ['htmlarea',
1.1.2.9 raeburn 41: 'res/adm/pages/bookmarkmenu',
42: 'res/adm/pages/reactionresponse',
1.1.2.11 raeburn 43: 'adm/jsMath',
44: 'adm/jQuery/css/ui-lightness'],
1.1 raeburn 45: );
46:
47: my @filestodelete = ();
48: my @dirstodelete = ();
49: foreach my $key (sort(keys(%files))) {
50: if ($paths{$key} ne '') {
51: if (ref($files{$key}) eq 'ARRAY') {
52: foreach my $file (@{$files{$key}}) {
1.1.2.7 raeburn 53: if (($file ne '') && (-f $paths{$key}.'/'.$file)) {
1.1 raeburn 54: push(@filestodelete,$paths{$key}.'/'.$file);
55: }
56: }
57: }
58: }
59: }
60:
61: foreach my $key (sort(keys(%dirs))) {
62: if ($paths{$key} ne '') {
63: if (ref($dirs{$key}) eq 'ARRAY') {
64: foreach my $dir (@{$dirs{$key}}) {
1.1.2.7 raeburn 65: if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) {
1.1 raeburn 66: push(@dirstodelete,$paths{$key}.'/'.$dir);
67: }
68: }
69: }
70: }
71: }
72:
73: if (@dirstodelete > 0) {
74: 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";
75: foreach my $dir (@dirstodelete) {
1.1.2.2 raeburn 76: next if (($dir =~/\*/) || ($dir eq '') || ($dir eq '/'));
1.1 raeburn 77: print "$dir -- delete? Enter: Y or N:\n";
78: my $choice=<>;
79: chomp($choice);
1.1.2.2 raeburn 80: $choice =~ s/\s+//g;
81: if ($choice eq 'Y') {
1.1.2.8 raeburn 82: File::Path::rmtree($dir);
1.1 raeburn 83: }
84: }
85: }
86:
87: if (@filestodelete > 0) {
88: 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";
89: foreach my $file (@filestodelete) {
1.1.2.2 raeburn 90: next if (($file =~/\*/) || ($file eq '') || ($file eq '/'));
1.1 raeburn 91: print "$file -- remove? Enter? Y or N:\n";
92: my $choice=<>;
93: chomp($choice);
1.1.2.2 raeburn 94: $choice =~ s/\s+//g;
95: if ($choice eq 'Y') {
1.1 raeburn 96: unlink($file);
97: }
98: }
99: }
100:
101: </perlscript>
102: </file>
103: </files>
104: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>