[LON-CAPA-cvs] cvs: loncom(version_2_11_X) / lond
raeburn
raeburn at source.lon-capa.org
Sat Aug 6 16:05:02 EDT 2016
raeburn Sat Aug 6 20:05:02 2016 EDT
Modified files: (Branch: version_2_11_X)
/loncom lond
Log:
- For 2.11
- Backport 1.520
Index: loncom/lond
diff -u loncom/lond:1.489.2.18 loncom/lond:1.489.2.19
--- loncom/lond:1.489.2.18 Sun Jun 14 00:46:35 2015
+++ loncom/lond Sat Aug 6 20:05:01 2016
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.489.2.18 2015/06/14 00:46:35 raeburn Exp $
+# $Id: lond,v 1.489.2.19 2016/08/06 20:05:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,7 +61,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.489.2.18 $'; #' stupid emacs
+my $VERSION='$Revision: 1.489.2.19 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -2445,11 +2445,20 @@
if (-e $file) {
#
# If the file is a regular file unlink is fine...
- # However it's possible the client wants a dir.
- # removed, in which case rmdir is more approprate:
+ # However it's possible the client wants a dir
+ # removed, in which case rmdir is more appropriate
+ # Note: rmdir will only remove an empty directory.
#
if (-f $file){
unlink($file);
+ # for html files remove the associated .bak file
+ # which may have been created by the editor.
+ if ($ufile =~ m{^((docs|supplemental)/(?:\d+|default)/\d+(?:|/.+)/)[^/]+\.x?html?$}i) {
+ my $path = $1;
+ if (-e $file.'.bak') {
+ unlink($file.'.bak');
+ }
+ }
} elsif(-d $file) {
rmdir($file);
}
More information about the LON-CAPA-cvs
mailing list