]> granicus.if.org Git - postgresql/commitdiff
Avoid use of mixed slash style paths in arguments to xcopy in MSVC builds.
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 8 Apr 2011 02:17:06 +0000 (22:17 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 8 Apr 2011 02:17:06 +0000 (22:17 -0400)
Some versions of xcopy, notably on Windows 7 don't like it. Backpatch
to 8.3, where we first used xcopy.

src/tools/msvc/Install.pm

index e1747c4fda00a6d9b5efd4e4d9670276b7c6d91a..f1028b737414b4f57e8bbed14633a6b522d0de5f 100644 (file)
@@ -479,15 +479,17 @@ sub CopyIncludeFiles
     my $D;
     opendir($D, 'src/include') || croak "Could not opendir on src/include!\n";
 
+       # some xcopy progs don't like mixed slash style paths
+       (my $ctarget = $target) =~ s!/!\\!g;
     while (my $d = readdir($D))
     {
         next if ($d =~ /^\./);
         next if ($d eq '.git');
         next if ($d eq 'CVS');
-        next unless (-d 'src/include/' . $d);
+        next unless (-d "src/include/$d");
 
-        EnsureDirectories($target . '/include/server', $d);
-        system("xcopy /s /i /q /r /y src\\include\\$d\\*.h \"$target\\include\\server\\$d\\\"")
+        EnsureDirectories("$target/include/server/$d");
+        system(qq{xcopy /s /i /q /r /y src\\include\\$d\\*.h "$ctarget\\include\\server\\$d\\"})
           && croak("Failed to copy include directory $d\n");
     }
     closedir($D);