[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm imsimportdocs.pm
raeburn
raeburn at source.lon-capa.org
Sun Nov 5 15:04:31 EST 2017
raeburn Sun Nov 5 20:04:31 2017 EDT
Modified files:
/loncom/imspackages imsimport.pm imsimportdocs.pm
Log:
- Replace use of system() with File::Path::remove_tree().
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.47 loncom/imspackages/imsimport.pm:1.48
--- loncom/imspackages/imsimport.pm:1.47 Tue Jun 9 21:22:51 2015
+++ loncom/imspackages/imsimport.pm Sun Nov 5 20:04:30 2017
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimport.pm,v 1.47 2015/06/09 21:22:51 damieng Exp $
+# $Id: imsimport.pm,v 1.48 2017/11/05 20:04:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,6 +38,7 @@
use Apache::lonlocal;
use Apache::lonupload;
use File::Basename();
+use File::Path();
use LONCAPA;
# ---------------------------------------------------------------- Jscript One
@@ -640,7 +641,7 @@
);
my $londocroot = $r->dir_config('lonDocRoot');
if ($destdir =~ m{^\Q$londocroot/priv/$udom/$uname/$dirpath\E}) {
- system (" rm -r -f $destdir/temp");
+ &File::Path::remove_tree("$destdir/temp",{ safe => 1 });
}
} elsif ($manifest_result eq 'nomanifest') {
$r->print(
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.35 loncom/imspackages/imsimportdocs.pm:1.36
--- loncom/imspackages/imsimportdocs.pm:1.35 Sun Nov 5 20:00:48 2017
+++ loncom/imspackages/imsimportdocs.pm Sun Nov 5 20:04:30 2017
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimportdocs.pm,v 1.35 2017/11/05 20:00:48 raeburn Exp $
+# $Id: imsimportdocs.pm,v 1.36 2017/11/05 20:04:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@
use LONCAPA::map();
use lib '/home/httpd/lib/perl/';
use LONCAPA;
+use File::Path();
use strict;
@@ -544,7 +545,7 @@
}
}
if ($tempdir =~ m/^\/home\/httpd\/perl\/tmp\/$crs\/\d{10}/) {
- system("rm -r -f $tempdir");
+ &File::Path::remove_tree($tempdir,{ safe => 1 });
}
# All done, display success message
More information about the LON-CAPA-cvs
mailing list