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