You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2013/04/16 19:28:32 UTC

svn commit: r1468520 - /incubator/mesos/trunk/src/launcher/launcher.cpp

Author: vinodkone
Date: Tue Apr 16 17:28:32 2013
New Revision: 1468520

URL: http://svn.apache.org/r1468520
Log:
Added support for bzip2 and XZ (LZMA) in executor launcher.

From: Brenden Matthews <br...@diddyinc.com>
Review: https://reviews.apache.org/r/10491

Modified:
    incubator/mesos/trunk/src/launcher/launcher.cpp

Modified: incubator/mesos/trunk/src/launcher/launcher.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/launcher/launcher.cpp?rev=1468520&r1=1468519&r2=1468520&view=diff
==============================================================================
--- incubator/mesos/trunk/src/launcher/launcher.cpp (original)
+++ incubator/mesos/trunk/src/launcher/launcher.cpp Tue Apr 16 17:28:32 2013
@@ -303,16 +303,28 @@ int ExecutorLauncher::fetchExecutors()
     // Extract any .tgz, tar.gz, tar.bz2 or zip files.
     if (strings::endsWith(resource, ".tgz") ||
         strings::endsWith(resource, ".tar.gz")) {
-      string command = "tar zxf '" + resource + "'";
-      cout << "Extracting resource: " + command << endl;
+      string command = "tar xzf '" + resource + "'";
+      cout << "Extracting resource: " << command << endl;
       int code = os::system(command);
       if (code != 0) {
         cerr << "Failed to extract resource: tar exit code " << code << endl;
         return -1;
       }
-    } else if (strings::endsWith(resource, ".tar.bz2")) {
-      string command = "tar jxf '" + resource + "'";
-      cout << "Extracting resource: " + command << endl;
+    } else if (strings::endsWith(resource, ".tbz2") ||
+               strings::endsWith(resource, ".tar.bz2")) {
+      string command = "tar xjf '" + resource + "'";
+      cout << "Extracting resource: " << command << endl;
+      int code = os::system(command);
+      if (code != 0) {
+        cerr << "Failed to extract resource: tar exit code " << code << endl;
+        return -1;
+      }
+    } else if (strings::endsWith(resource, ".txz") ||
+               strings::endsWith(resource, ".tar.xz")) {
+      // If you want to use XZ on Mac OS, you can try the packages here:
+      // http://macpkg.sourceforge.net/
+      string command = "tar xJf '" + resource + "'";
+      cout << "Extracting resource: " << command << endl;
       int code = os::system(command);
       if (code != 0) {
         cerr << "Failed to extract resource: tar exit code " << code << endl;
@@ -320,7 +332,7 @@ int ExecutorLauncher::fetchExecutors()
       }
     } else if (strings::endsWith(resource, ".zip")) {
       string command = "unzip '" + resource + "'";
-      cout << "Extracting resource: " + command << endl;
+      cout << "Extracting resource: " << command << endl;
       int code = os::system(command);
       if (code != 0) {
         cerr << "Failed to extract resource: unzip exit code " << code << endl;