When trying to install a plugin that creates new directories, I get this error:
lib/
lib/TWiki/
lib/TWiki/Plugins/
lib/TWiki/Plugins/TinyMCEPlugin.pm
Error: Failed to move file 'pub/TWiki/TinyMCEPlugin/' to /var/www/html/test-twiki/pub/TWiki/TinyMCEPlugin/: Is a directory
Software error:
Installation terminated at /var/www/html/test-twiki/lib/TWiki/Configure/UIs/EXTEND.pm line 149.
For help, please send mail to the webmaster ( svcpdcad@rtNOSPAM.ca.atitech.com), giving this error message and the time and date of the error.
The following patch fixes the issue. I'm sure the way I did it isn' t "the right way" but it's a starting point.
--- ../lib/TWiki/Configure/UIs/EXTEND.pm 2007-03-03 06:45:57.000000000 -0800
+++ /root/twiki/twiki/lib/TWiki/Configure/UIs/EXTEND.pm 2007-09-25 17:28:57.000000000 -0700
@@ -115,7 +115,7 @@
unless ($query->param('confirm')) {
foreach my $file (@names) {
my $ef = $this->_findTarget($file);
- if (-e $ef && !-d $ef) {
+ if (-e $ef && !-d $ef) {
my $mess = "Note: Existing $file overwritten.";
if (File::Copy::move($ef, "$ef.bak")) {
$mess .= " Backup saved in $ef.bak";
@@ -140,7 +140,12 @@
next unless -e "$dir/$file";
# Find where it is meant to go
my $ef = $this->_findTarget($file);
- if (-e $ef && !-d $ef && !-w $ef) {
+ if (-d "$dir/$file") {
+ if (system("mkdir -p $ef") != 0) {
+ print $this->ERROR("Failed to create directory $ef: $!");
+ die "Installation terminated";
+ }
+ } elsif (-e $ef && !-d $ef && !-w $ef) {
print $this->ERROR("No permission to write to $ef");
die "Installation terminated";
} elsif (!-d $ef) {
As an aside, the WYSIWYG does strange things with the <blockquote> tags if you edit and save this topic.
--
TWiki:Main/BuckGolemon
- 12 Nov 2007
Use verbatim style for embedded code.
This is already fixed in 420. Note that we don't use system calls, to try and make it as portable as possible.
CC