[PATCH] windows: Fix creation of /Temp/V2V directory (RHBZ#868073).
From: "Richard W.M. Jones" <rjones@redhat.com> case_sensitive_path was not defined when called on a path where the final element doesn't exist. In libguestfs >= 1.16.29 it was changed to return non-NULL if the final element doesn't exist so that creation of new files works. --- lib/Sys/VirtConvert/Converter/Windows.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/Sys/VirtConvert/Converter/Windows.pm b/lib/Sys/VirtConvert/Converter/Windows.pm index ce89a67..d4885be 100644 --- a/lib/Sys/VirtConvert/Converter/Windows.pm +++ b/lib/Sys/VirtConvert/Converter/Windows.pm @@ -470,12 +470,8 @@ sub _upload_files foreach my $d ('Temp', 'V2V') { $path .= '/'.$d; - eval { $path = $g->case_sensitive_path($path) }; - - # case_sensitive_path will fail if the path doesn't exist - if ($@) { - $g->mkdir($path); - } + $path = $g->case_sensitive_path($path); + $g->mkdir_p($path); } foreach my $file (@fb_files) { -- 1.7.11.4
I didn't actually test that patch, but I did test the attached program. It should print: Does /Temp/V2V exist? no Does /Temp/V2V exist? yes Does /Temp/V2V exist? yes Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
participants (1)
-
Richard W.M. Jones