Repository: mesos
Updated Branches:
  refs/heads/master 1cdd962bc -> 7ee317f8a


Windows: Fixed CopyFetcherPluginTest.FetchExistingFile.

The copy fetcher was using a command that doesn't exist on
Windows.  This commit replaces `cp -a ...` with `cmd /c copy /Y ...`.

Review: https://reviews.apache.org/r/58247/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cf5e7f94
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cf5e7f94
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cf5e7f94

Branch: refs/heads/master
Commit: cf5e7f942d1a8651bcf169ebcd5e6057b28c5ebf
Parents: 1cdd962
Author: Jeff Coffler <[email protected]>
Authored: Thu Apr 6 18:06:49 2017 -0700
Committer: Joseph Wu <[email protected]>
Committed: Fri Apr 7 12:55:46 2017 -0700

----------------------------------------------------------------------
 src/uri/fetchers/copy.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cf5e7f94/src/uri/fetchers/copy.cpp
----------------------------------------------------------------------
diff --git a/src/uri/fetchers/copy.cpp b/src/uri/fetchers/copy.cpp
index 86605a0..5e14705 100644
--- a/src/uri/fetchers/copy.cpp
+++ b/src/uri/fetchers/copy.cpp
@@ -95,10 +95,17 @@ Future<Nothing> CopyFetcherPlugin::fetch(
 
   VLOG(1) << "Copying '" << uri.path() << "' to '" << directory << "'";
 
+#ifndef __WINDOWS__
+  const char* copyCommand = "cp";
   const vector<string> argv = {"cp", "-a", uri.path(), directory};
+#else // __WINDOWS__
+  const char* copyCommand = os::Shell::name;
+  const vector<string> argv =
+    {os::Shell::arg0, os::Shell::arg1, "copy", "/Y", uri.path(), directory};
+#endif // __WINDOWS__
 
   Try<Subprocess> s = subprocess(
-      "cp",
+      copyCommand,
       argv,
       Subprocess::PATH(os::DEV_NULL),
       Subprocess::PIPE(),

Reply via email to