Annotation of doc/loncapafiles/removenolongerused.piml, revision 1.16
1.1 raeburn 1: <piml>
2: <targetroot>/</targetroot>
3: <files>
4: <file>
5: <target dist="default"></target>
6: <perlscript mode="fg">
7:
1.2 raeburn 8: use File::Path();
1.1 raeburn 9:
10: 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);
11:
12: my %paths = (
13: 'londaemons' => '/home/httpd/perl',
14: 'apache' => '/home/httpd/lib/perl/Apache',
15: 'londocroot' => '/home/httpd/html',
16: 'rcgifs' => '/home/httpd/html/res/adm/pages',
1.9 raeburn 17: 'debug' => '/home/httpd/perl/debug',
1.1 raeburn 18: );
19:
20: my %files = (
1.5 raeburn 21: 'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'],
1.1 raeburn 22: 'apache' => ['londropadd.pm','lonconstruct.pm',
1.6 raeburn 23: 'lonremote.pm','admbookmarks.pm','lonassignments.pm'],
1.1 raeburn 24: 'londocroot' => ['adm/rat/extpickcode.html',
25: 'adm/rat/extpickframe.html',
26: 'res/adm/pages/imgmaps.html',
27: 'res/adm/pages/menu.html',
1.7 raeburn 28: 'res/adm/pages/homeworkmenu.html',
29: 'adm/help/gif/vbkm.gif',
1.14 raeburn 30: 'adm/help/eps/vbkm.eps',
31: 'adm/jQuery/js/jquery-1.3.2.min.js',
32: 'adm/jQuery/js/jquery-1.6.2.min.js',
33: 'adm/jQuery/js/jquery-1.11.3.min.js',
1.16 ! raeburn 34: 'adm/jQuery/js/jquery-3.2.1.min.js',
1.14 raeburn 35: 'adm/jQuery/js/jquery-ui-1.7.2.custom.min.js',
36: 'adm/jQuery/js/jquery-ui-1.8.16.custom.min.js',
37: 'adm/jQuery/js/jquery-ui-1.11.4.custom.min.js',
1.16 ! raeburn 38: 'adm/jQuery/js/jquery-ui-1.12.1.custom.min.js',
1.14 raeburn 39: 'adm/jQuery/css/smoothness/jquery-ui-1.7.2.custom.css',
40: 'adm/jQuery/css/smoothness/jquery-ui-1.8.16.custom.css',
1.15 raeburn 41: 'adm/jQuery/js/css/smoothness/jquery-ui-1.11.4.custom.css',
1.16 ! raeburn 42: 'adm/jQuery/js/css/smoothness/jquery-ui-1.12.1.custom.min.css',
1.15 raeburn 43: 'adm/reactionresponse/reaction_frame.html',
44: 'adm/reactionresponse/reaction_window.html'],
1.9 raeburn 45: 'debug' => ['archive_coursedata_tables.pl'],
1.1 raeburn 46: );
47:
48: my %dirs = (
1.10 raeburn 49: 'londocroot' => ['adm/lonLCDfont',
50: 'htmlarea',
1.12 raeburn 51: 'res/adm/pages/bookmarkmenu',
1.13 raeburn 52: 'res/adm/pages/reactionresponse',
1.14 raeburn 53: 'adm/jsMath',
54: 'adm/jQuery/css/ui-lightness'],
1.1 raeburn 55: );
56:
57: my %multis = (
1.8 raeburn 58: 'rcgifs' => \@rcgifs,
1.1 raeburn 59: );
60: my @filestodelete = ();
61: my @dirstodelete = ();
62: my @multistodelete = ();
63: my @gifstodelete = ();
64: foreach my $key (sort(keys(%files))) {
65: if ($paths{$key} ne '') {
66: if (ref($files{$key}) eq 'ARRAY') {
67: foreach my $file (@{$files{$key}}) {
1.10 raeburn 68: if (($file ne '') && (-f $paths{$key}.'/'.$file)) {
1.1 raeburn 69: push(@filestodelete,$paths{$key}.'/'.$file);
70: }
71: }
72: }
73: }
74: }
75:
76: foreach my $key (sort(keys(%dirs))) {
77: if ($paths{$key} ne '') {
78: if (ref($dirs{$key}) eq 'ARRAY') {
79: foreach my $dir (@{$dirs{$key}}) {
1.10 raeburn 80: if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) {
1.1 raeburn 81: push(@dirstodelete,$paths{$key}.'/'.$dir);
82: }
83: }
84: }
85: }
86: }
87:
88: foreach my $key (sort(keys(%multis))) {
89: if ($paths{$key} ne '') {
90: if (ref($multis{$key}) eq 'ARRAY') {
91: foreach my $file (@{$dirs{$key}}) {
92: if (-f $paths{$key}.'/'.$file) {
93: push(@multistodelete,$paths{$key}.'/'.$file);
94: push(@gifstodelete,$file);
95: }
96: }
97: }
98: }
99: }
100:
101: if (@dirstodelete > 0) {
102: 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";
103: foreach my $dir (@dirstodelete) {
1.2 raeburn 104: next if (($dir =~/\*/) || ($dir eq '') || ($dir eq '/'));
1.1 raeburn 105: print "$dir -- delete? Enter: Y or N:\n";
106: my $choice=<>;
107: chomp($choice);
1.3 raeburn 108: $choice =~ s/\s+//g;
1.2 raeburn 109: if ($choice eq 'Y') {
1.11 raeburn 110: File::Path::rmtree($dir);
1.1 raeburn 111: }
112: }
113: }
114:
115: if (@filestodelete > 0) {
116: 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";
117: foreach my $file (@filestodelete) {
1.2 raeburn 118: next if (($file =~/\*/) || ($file eq '') || ($file eq '/'));
1.1 raeburn 119: print "$file -- remove? Enter? Y or N:\n";
120: my $choice=<>;
121: chomp($choice);
1.2 raeburn 122: $choice =~ s/\s+//g;
123: if ($choice eq 'Y') {
1.1 raeburn 124: unlink($file);
125: }
126: }
127: }
128:
129: if (@multistodelete > 0) {
130: my $num = scalar(@multistodelete);
131: 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".
132: "Enter Y if you would all $num files to be deleted.\n\n".
133: "Remove? Y or N:\n";
134: my $choice=<>;
135: chomp($choice);
1.2 raeburn 136: $choice =~ s/\s+//g;
137: if ($choice eq 'Y') {
1.1 raeburn 138: foreach my $item (@multistodelete) {
1.8 raeburn 139: next if (($item =~/\*/) || ($item eq '') || ($item eq '/'));
1.1 raeburn 140: unlink($item);
141: }
142: }
143: }
144:
145: </perlscript>
146: </file>
147: </files>
148: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>