You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2013/05/29 19:40:42 UTC

[04/35] Updated libprocess to use '3rdparty' instead of 'third_party'.

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/3rdparty/stout/tests/os_tests.cpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/3rdparty/stout/tests/os_tests.cpp b/third_party/libprocess/3rdparty/stout/tests/os_tests.cpp
new file mode 100644
index 0000000..047778d
--- /dev/null
+++ b/third_party/libprocess/3rdparty/stout/tests/os_tests.cpp
@@ -0,0 +1,208 @@
+#include <gtest/gtest.h>
+
+#include <gmock/gmock.h>
+
+#include <cstdlib> // For rand.
+#include <string>
+
+#include <stout/foreach.hpp>
+#include <stout/gtest.hpp>
+#include <stout/hashset.hpp>
+#include <stout/os.hpp>
+#include <stout/stopwatch.hpp>
+#include <stout/try.hpp>
+#include <stout/uuid.hpp>
+
+using std::string;
+
+
+static hashset<string> listfiles(const string& directory)
+{
+  hashset<string> fileset;
+  foreach (const string& file, os::ls(directory)) {
+    fileset.insert(file);
+  }
+  return fileset;
+}
+
+
+class OsTest : public ::testing::Test
+{
+protected:
+  virtual void SetUp()
+  {
+    Try<string> mkdtemp = os::mkdtemp();
+    ASSERT_SOME(mkdtemp);
+    tmpdir = mkdtemp.get();
+  }
+
+  virtual void TearDown()
+  {
+    ASSERT_SOME(os::rmdir(tmpdir));
+  }
+
+  string tmpdir;
+};
+
+
+TEST_F(OsTest, rmdir)
+{
+  const hashset<string> EMPTY;
+
+  hashset<string> expectedListing = EMPTY;
+  EXPECT_EQ(expectedListing, listfiles(tmpdir));
+
+  os::mkdir(tmpdir + "/a/b/c");
+  os::mkdir(tmpdir + "/a/b/d");
+  os::mkdir(tmpdir + "/e/f");
+
+  expectedListing = EMPTY;
+  expectedListing.insert("a");
+  expectedListing.insert("e");
+  EXPECT_EQ(expectedListing, listfiles(tmpdir));
+
+  expectedListing = EMPTY;
+  expectedListing.insert("b");
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a"));
+
+  expectedListing = EMPTY;
+  expectedListing.insert("c");
+  expectedListing.insert("d");
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b"));
+
+  expectedListing = EMPTY;
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b/c"));
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b/d"));
+
+  expectedListing.insert("f");
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/e"));
+
+  expectedListing = EMPTY;
+  EXPECT_EQ(expectedListing, listfiles(tmpdir + "/e/f"));
+}
+
+
+TEST_F(OsTest, nonblock)
+{
+  int pipes[2];
+  ASSERT_NE(-1, pipe(pipes));
+
+  Try<bool> isNonBlock = false;
+
+  isNonBlock = os::isNonblock(pipes[0]);
+  ASSERT_SOME(isNonBlock);
+  EXPECT_FALSE(isNonBlock.get());
+
+  ASSERT_SOME(os::nonblock(pipes[0]));
+
+  isNonBlock = os::isNonblock(pipes[0]);
+  ASSERT_SOME(isNonBlock);
+  EXPECT_TRUE(isNonBlock.get());
+
+  close(pipes[0]);
+  close(pipes[1]);
+
+  EXPECT_ERROR(os::nonblock(pipes[0]));
+  EXPECT_ERROR(os::nonblock(pipes[0]));
+}
+
+
+TEST_F(OsTest, touch)
+{
+  const string& testfile  = tmpdir + "/" + UUID::random().toString();
+
+  ASSERT_SOME(os::touch(testfile));
+  ASSERT_TRUE(os::exists(testfile));
+}
+
+
+TEST_F(OsTest, readWriteString)
+{
+  const string& testfile  = tmpdir + "/" + UUID::random().toString();
+  const string& teststr = "test";
+
+  ASSERT_SOME(os::write(testfile, teststr));
+
+  Try<string> readstr = os::read(testfile);
+
+  ASSERT_SOME(readstr);
+  EXPECT_EQ(teststr, readstr.get());
+}
+
+
+TEST_F(OsTest, find)
+{
+  const string& testdir = tmpdir + "/" + UUID::random().toString();
+  const string& subdir = testdir + "/test1";
+  ASSERT_SOME(os::mkdir(subdir)); // Create the directories.
+
+  // Now write some files.
+  const string& file1 = testdir + "/file1.txt";
+  const string& file2 = subdir + "/file2.txt";
+  const string& file3 = subdir + "/file3.jpg";
+
+  ASSERT_SOME(os::touch(file1));
+  ASSERT_SOME(os::touch(file2));
+  ASSERT_SOME(os::touch(file3));
+
+  // Find "*.txt" files.
+  Try<std::list<string> > result = os::find(testdir, ".txt");
+  ASSERT_SOME(result);
+
+  hashset<string> files;
+  foreach (const string& file, result.get()) {
+    files.insert(file);
+  }
+
+  ASSERT_EQ(2u, files.size());
+  ASSERT_TRUE(files.contains(file1));
+  ASSERT_TRUE(files.contains(file2));
+}
+
+
+TEST_F(OsTest, uname)
+{
+  Try<os::UTSInfo> info = os::uname();
+
+  ASSERT_SOME(info);
+#ifdef __linux__
+  EXPECT_EQ(info.get().sysname, "Linux");
+#endif
+#ifdef __APPLE__
+  EXPECT_EQ(info.get().sysname, "Darwin");
+#endif
+}
+
+
+TEST_F(OsTest, sysname)
+{
+  Try<string> name = os::sysname();
+
+  ASSERT_SOME(name);
+#ifdef __linux__
+  EXPECT_EQ(name.get(), "Linux");
+#endif
+#ifdef __APPLE__
+  EXPECT_EQ(name.get(), "Darwin");
+#endif
+}
+
+
+TEST_F(OsTest, release)
+{
+  Try<os::Release> info = os::release();
+
+  ASSERT_SOME(info);
+}
+
+
+TEST_F(OsTest, sleep)
+{
+  Duration duration = Milliseconds(10);
+  Stopwatch stopwatch;
+  stopwatch.start();
+  ASSERT_SOME(os::sleep(duration));
+  ASSERT_LE(duration, stopwatch.elapsed());
+
+  ASSERT_ERROR(os::sleep(Milliseconds(-10)));
+}

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/3rdparty/stout/tests/proc_tests.cpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/3rdparty/stout/tests/proc_tests.cpp b/third_party/libprocess/3rdparty/stout/tests/proc_tests.cpp
new file mode 100644
index 0000000..2305ef5
--- /dev/null
+++ b/third_party/libprocess/3rdparty/stout/tests/proc_tests.cpp
@@ -0,0 +1,162 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <unistd.h> // For getpid, getppid.
+
+#include <gmock/gmock.h>
+
+#include <set>
+
+#include <stout/gtest.hpp>
+#include <stout/proc.hpp>
+#include <stout/try.hpp>
+
+using proc::CPU;
+using proc::SystemStatus;
+using proc::ProcessStatus;
+
+using std::set;
+
+
+TEST(ProcTest, pids)
+{
+  Try<set<pid_t> > pids = proc::pids();
+
+  ASSERT_SOME(pids);
+  EXPECT_NE(0u, pids.get().size());
+  EXPECT_EQ(1u, pids.get().count(getpid()));
+  EXPECT_EQ(1u, pids.get().count(1));
+}
+
+
+TEST(ProcTest, children)
+{
+  Try<set<pid_t> > children = proc::children(getpid());
+
+  ASSERT_SOME(children);
+  EXPECT_EQ(0u, children.get().size());
+
+  // Use pipes to determine the pids of the child and grandchild.
+  int childPipes[2];
+  int grandchildPipes[2];
+  ASSERT_NE(-1, pipe(childPipes));
+  ASSERT_NE(-1, pipe(grandchildPipes));
+
+  pid_t childPid;
+  pid_t grandchildPid;
+  pid_t pid = fork();
+  ASSERT_NE(-1, pid);
+
+  if (pid > 0) {
+    // In parent process.
+    close(childPipes[1]);
+    close(grandchildPipes[1]);
+
+    // Get the pids via the pipes.
+    ASSERT_NE(
+        -1,
+        read(childPipes[0], &childPid, sizeof(childPid)));
+    ASSERT_NE(
+        -1,
+        read(grandchildPipes[0], &grandchildPid, sizeof(grandchildPid)));
+
+    close(childPipes[0]);
+    close(grandchildPipes[0]);
+  } else {
+    // In child process.
+    close(childPipes[0]);
+    close(grandchildPipes[0]);
+
+    // Double fork!
+    if ((pid = fork()) == -1) {
+      perror("Failed to fork a grand child process");
+      abort();
+    }
+
+    if (pid > 0) {
+      // Still in child process.
+      pid = getpid();
+      if (write(childPipes[1], &pid, sizeof(pid)) != sizeof(pid)) {
+        perror("Failed to write PID on pipe");
+        abort();
+      }
+
+      close(childPipes[1]);
+
+      while (true); // Keep waiting until we get a signal.
+    } else {
+      // In grandchild process.
+      pid = getpid();
+      if (write(grandchildPipes[1], &pid, sizeof(pid)) != sizeof(pid)) {
+        perror("Failed to write PID on pipe");
+        abort();
+      }
+
+      close(grandchildPipes[1]);
+
+      while (true); // Keep waiting until we get a signal.
+    }
+  }
+
+  // Ensure the non-recursive children does not include the
+  // grandchild.
+  children = proc::children(getpid(), false);
+
+  ASSERT_SOME(children);
+  EXPECT_EQ(1u, children.get().size());
+  EXPECT_EQ(1u, children.get().count(childPid));
+
+  children = proc::children(getpid());
+
+  ASSERT_SOME(children);
+  EXPECT_EQ(2u, children.get().size());
+  EXPECT_EQ(1u, children.get().count(childPid));
+  EXPECT_EQ(1u, children.get().count(grandchildPid));
+
+  // Cleanup by killing the descendants.
+  EXPECT_EQ(0, kill(grandchildPid, SIGKILL));
+  EXPECT_EQ(0, kill(childPid, SIGKILL));
+}
+
+
+TEST(ProcTest, cpus)
+{
+  Try<std::list<CPU> > cpus = proc::cpus();
+
+  ASSERT_SOME(cpus);
+  EXPECT_LE(1u, cpus.get().size());
+}
+
+
+TEST(ProcTest, SystemStatus)
+{
+  Try<SystemStatus> status = proc::status();
+
+  ASSERT_SOME(status);
+  EXPECT_NE(0u, status.get().btime);
+}
+
+
+TEST(ProcTest, ProcessStatus)
+{
+  Try<ProcessStatus> status = proc::status(getpid());
+
+  ASSERT_SOME(status);
+  EXPECT_EQ(getpid(), status.get().pid);
+  EXPECT_EQ(getppid(), status.get().ppid);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/3rdparty/stout/tests/strings_tests.cpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/3rdparty/stout/tests/strings_tests.cpp b/third_party/libprocess/3rdparty/stout/tests/strings_tests.cpp
new file mode 100644
index 0000000..7ec9446
--- /dev/null
+++ b/third_party/libprocess/3rdparty/stout/tests/strings_tests.cpp
@@ -0,0 +1,255 @@
+#include <gtest/gtest.h>
+
+#include <gmock/gmock.h>
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <stout/format.hpp>
+#include <stout/gtest.hpp>
+#include <stout/strings.hpp>
+#include <stout/try.hpp>
+
+using std::map;
+using std::string;
+using std::vector;
+
+
+TEST(StringsTest, Format)
+{
+  Try<std::string> result = strings::format("%s %s", "hello", "world");
+  ASSERT_SOME(result);
+  EXPECT_EQ("hello world", result.get());
+
+  result = strings::format("hello %d", 42);
+  ASSERT_SOME(result);
+  EXPECT_EQ("hello 42", result.get());
+
+  result = strings::format("hello %s", "fourty-two");
+  ASSERT_SOME(result);
+  EXPECT_EQ("hello fourty-two", result.get());
+
+  string hello = "hello";
+
+  result = strings::format("%s %s", hello, "fourty-two");
+  ASSERT_SOME(result);
+  EXPECT_EQ("hello fourty-two", result.get());
+}
+
+
+TEST(StringsTest, Remove)
+{
+  EXPECT_EQ("heo word", strings::remove("hello world", "l"));
+  EXPECT_EQ("hel world", strings::remove("hello world", "lo"));
+  EXPECT_EQ("home/", strings::remove("/home/", "/", strings::PREFIX));
+  EXPECT_EQ("/home", strings::remove("/home/", "/", strings::SUFFIX));
+}
+
+
+TEST(StringsTest, Replace)
+{
+  EXPECT_EQ("hello*", strings::replace("hello/", "/", "*"));
+  EXPECT_EQ("*hello", strings::replace("/hello", "/", "*"));
+  EXPECT_EQ("*hello*world*", strings::replace("/hello/world/", "/", "*"));
+  EXPECT_EQ("*", strings::replace("/", "/", "*"));
+  EXPECT_EQ("hello world", strings::replace("hello world", "/", "*"));
+  EXPECT_EQ("***1***2***3***", strings::replace("/1/2/3/", "/", "***"));
+  EXPECT_EQ("123", strings::replace("/1/2/3/", "/", ""));
+  EXPECT_EQ("/1/2/3**", strings::replace("***1***2***3**", "***", "/"));
+  EXPECT_EQ("/1/2/3/", strings::replace("/1/2/3/", "", "*"));
+}
+
+
+TEST(StringsTest, Trim)
+{
+  EXPECT_EQ("", strings::trim("", " "));
+  EXPECT_EQ("", strings::trim("    ", " "));
+  EXPECT_EQ("hello world", strings::trim("hello world", " "));
+  EXPECT_EQ("hello world", strings::trim("  hello world", " "));
+  EXPECT_EQ("hello world", strings::trim("hello world  ", " "));
+  EXPECT_EQ("hello world", strings::trim("  hello world  ", " "));
+  EXPECT_EQ("hello world", strings::trim(" \t hello world\t  ", " \t"));
+  EXPECT_EQ("hello world", strings::trim(" \t hello world\t \n\r "));
+}
+
+
+TEST(StringsTest, Tokenize)
+{
+  vector<string> tokens = strings::tokenize("hello world,  what's up?", " ");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("hello",  tokens[0]);
+  EXPECT_EQ("world,", tokens[1]);
+  EXPECT_EQ("what's", tokens[2]);
+  EXPECT_EQ("up?",    tokens[3]);
+}
+
+
+TEST(StringsTest, TokenizeStringWithDelimsAtStart)
+{
+  vector<string> tokens = strings::tokenize("  hello world,  what's up?", " ");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("hello",  tokens[0]);
+  EXPECT_EQ("world,", tokens[1]);
+  EXPECT_EQ("what's", tokens[2]);
+  EXPECT_EQ("up?",    tokens[3]);
+}
+
+
+TEST(StringsTest, TokenizeStringWithDelimsAtEnd)
+{
+  vector<string> tokens = strings::tokenize("hello world,  what's up?  ", " ");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("hello",  tokens[0]);
+  EXPECT_EQ("world,", tokens[1]);
+  EXPECT_EQ("what's", tokens[2]);
+  EXPECT_EQ("up?",    tokens[3]);
+}
+
+
+TEST(StringsTest, TokenizeStringWithDelimsAtStartAndEnd)
+{
+  vector<string> tokens = strings::tokenize("  hello world,  what's up?  ", " ");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("hello",  tokens[0]);
+  EXPECT_EQ("world,", tokens[1]);
+  EXPECT_EQ("what's", tokens[2]);
+  EXPECT_EQ("up?",    tokens[3]);
+}
+
+
+TEST(StringsTest, TokenizeWithMultipleDelims)
+{
+  vector<string> tokens = strings::tokenize("hello\tworld,  \twhat's up?",
+                                            " \t");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("hello",  tokens[0]);
+  EXPECT_EQ("world,", tokens[1]);
+  EXPECT_EQ("what's", tokens[2]);
+  EXPECT_EQ("up?",    tokens[3]);
+}
+
+
+TEST(StringsTest, TokenizeEmptyString)
+{
+  vector<string> tokens = strings::tokenize("", " ");
+  ASSERT_EQ(0u, tokens.size());
+}
+
+
+TEST(StringsTest, TokenizeDelimOnlyString)
+{
+  vector<string> tokens = strings::tokenize("   ", " ");
+  ASSERT_EQ(0u, tokens.size());
+}
+
+
+TEST(StringsTest, SplitEmptyString)
+{
+  vector<string> tokens = strings::split("", ",");
+  ASSERT_EQ(1u, tokens.size());
+  EXPECT_EQ("", tokens[0]);
+}
+
+
+TEST(StringsTest, SplitDelimOnlyString)
+{
+  vector<string> tokens = strings::split(",,,", ",");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("", tokens[0]);
+  EXPECT_EQ("", tokens[1]);
+  EXPECT_EQ("", tokens[2]);
+  EXPECT_EQ("", tokens[3]);
+}
+
+
+TEST(StringsTest, Split)
+{
+  vector<string> tokens = strings::split("foo,bar,,baz", ",");
+  ASSERT_EQ(4u, tokens.size());
+  EXPECT_EQ("foo", tokens[0]);
+  EXPECT_EQ("bar", tokens[1]);
+  EXPECT_EQ("",    tokens[2]);
+  EXPECT_EQ("baz", tokens[3]);
+}
+
+
+TEST(StringsTest, SplitStringWithDelimsAtStart)
+{
+  vector<string> tokens = strings::split(",,foo,bar,,baz", ",");
+  ASSERT_EQ(6u, tokens.size());
+  EXPECT_EQ("",    tokens[0]);
+  EXPECT_EQ("",    tokens[1]);
+  EXPECT_EQ("foo", tokens[2]);
+  EXPECT_EQ("bar", tokens[3]);
+  EXPECT_EQ("",    tokens[4]);
+  EXPECT_EQ("baz", tokens[5]);
+}
+
+
+TEST(StringsTest, SplitStringWithDelimsAtEnd)
+{
+  vector<string> tokens = strings::split("foo,bar,,baz,,", ",");
+  ASSERT_EQ(6u, tokens.size());
+  EXPECT_EQ("foo", tokens[0]);
+  EXPECT_EQ("bar", tokens[1]);
+  EXPECT_EQ("",    tokens[2]);
+  EXPECT_EQ("baz", tokens[3]);
+  EXPECT_EQ("",    tokens[4]);
+  EXPECT_EQ("",    tokens[5]);
+}
+
+
+TEST(StringsTest, SplitStringWithDelimsAtStartAndEnd)
+{
+  vector<string> tokens = strings::split(",,foo,bar,,", ",");
+  ASSERT_EQ(6u, tokens.size());
+  EXPECT_EQ("",    tokens[0]);
+  EXPECT_EQ("",    tokens[1]);
+  EXPECT_EQ("foo", tokens[2]);
+  EXPECT_EQ("bar", tokens[3]);
+  EXPECT_EQ("",    tokens[4]);
+  EXPECT_EQ("",    tokens[5]);
+}
+
+
+TEST(StringsTest, SplitWithMultipleDelims)
+{
+  vector<string> tokens = strings::split("foo.bar,.,.baz.", ",.");
+  ASSERT_EQ(7u, tokens.size());
+  EXPECT_EQ("foo", tokens[0]);
+  EXPECT_EQ("bar", tokens[1]);
+  EXPECT_EQ("",    tokens[2]);
+  EXPECT_EQ("",    tokens[3]);
+  EXPECT_EQ("",    tokens[4]);
+  EXPECT_EQ("baz", tokens[5]);
+  EXPECT_EQ("",    tokens[6]);
+}
+
+
+TEST(StringsTest, Pairs)
+{
+  map<string, vector<string> > pairs = strings::pairs("one=1,two=2", ",", "=");
+  ASSERT_EQ(2u, pairs.size());
+  ASSERT_EQ(1u, pairs.count("one"));
+  ASSERT_EQ(1u, pairs["one"].size());
+  EXPECT_EQ("1", pairs["one"].front());
+  ASSERT_EQ(1u, pairs.count("two"));
+  ASSERT_EQ(1u, pairs["two"].size());
+  EXPECT_EQ("2", pairs["two"].front());
+}
+
+
+TEST(StringsTest, StartsWith)
+{
+  EXPECT_TRUE(strings::startsWith("hello world", "hello"));
+  EXPECT_FALSE(strings::startsWith("hello world", "no"));
+  EXPECT_FALSE(strings::startsWith("hello world", "ello"));
+}
+
+
+TEST(StringsTest, Contains)
+{
+  EXPECT_TRUE(strings::contains("hello world", "world"));
+  EXPECT_FALSE(strings::contains("hello world", "no"));
+}

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/3rdparty/stout/tests/uuid_tests.cpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/3rdparty/stout/tests/uuid_tests.cpp b/third_party/libprocess/3rdparty/stout/tests/uuid_tests.cpp
new file mode 100644
index 0000000..ad1d986
--- /dev/null
+++ b/third_party/libprocess/3rdparty/stout/tests/uuid_tests.cpp
@@ -0,0 +1,37 @@
+#include <gtest/gtest.h>
+
+#include <gmock/gmock.h>
+
+#include <string>
+
+#include <stout/uuid.hpp>
+
+using std::string;
+
+
+TEST(UUIDTest, test)
+{
+  UUID uuid1 = UUID::random();
+  UUID uuid2 = UUID::fromBytes(uuid1.toBytes());
+  UUID uuid3 = uuid2;
+
+  EXPECT_EQ(uuid1, uuid2);
+  EXPECT_EQ(uuid2, uuid3);
+  EXPECT_EQ(uuid1, uuid3);
+
+  string bytes1 = uuid1.toBytes();
+  string bytes2 = uuid2.toBytes();
+  string bytes3 = uuid3.toBytes();
+
+  EXPECT_EQ(bytes1, bytes2);
+  EXPECT_EQ(bytes2, bytes3);
+  EXPECT_EQ(bytes1, bytes3);
+
+  string string1 = uuid1.toString();
+  string string2 = uuid2.toString();
+  string string3 = uuid3.toString();
+
+  EXPECT_EQ(string1, string2);
+  EXPECT_EQ(string2, string3);
+  EXPECT_EQ(string1, string3);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/3rdparty/versions.am
----------------------------------------------------------------------
diff --git a/third_party/libprocess/3rdparty/versions.am b/third_party/libprocess/3rdparty/versions.am
new file mode 100644
index 0000000..0d05698
--- /dev/null
+++ b/third_party/libprocess/3rdparty/versions.am
@@ -0,0 +1,11 @@
+# This automake utility file is included from 3rdparty/Makefile.am
+# and src/Makefile.am, so we can update the version numbers of
+# third_party packages in exactly one place.
+
+BOOST_VERSION = 1.53.0
+GLOG_VERSION = 0.3.1
+GMOCK_VERSION = 1.6.0
+GPERFTOOLS_VERSION = 2.0
+LIBEV_VERSION = 4.15
+PROTOBUF_VERSION = 2.4.1
+RY_HTTP_PARSER_VERSION = 1c3624a

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/Makefile.am
----------------------------------------------------------------------
diff --git a/third_party/libprocess/Makefile.am b/third_party/libprocess/Makefile.am
index c1db145..b6b8abd 100644
--- a/third_party/libprocess/Makefile.am
+++ b/third_party/libprocess/Makefile.am
@@ -1,22 +1,22 @@
-# Makefile for libprocess. Note that third_party needs to be built
-# first (see third_party/Makefile.am).
+# Makefile for libprocess. Note that 3rdparty needs to be built
+# first (see 3rdparty/Makefile.am).
 
 ACLOCAL_AMFLAGS = -I m4
 
 AUTOMAKE_OPTIONS = foreign
 
-SUBDIRS = third_party .
+SUBDIRS = 3rdparty .
 
-include third_party/versions.am
+include 3rdparty/versions.am
 
-STOUT = third_party/stout
-BOOST = third_party/boost-$(BOOST_VERSION)
-GLOG = third_party/glog-$(GLOG_VERSION)
-GMOCK = third_party/gmock-$(GMOCK_VERSION)
-GPERFTOOLS = third_party/gperftools-$(GPERFTOOLS_VERSION)
+STOUT = 3rdparty/stout
+BOOST = 3rdparty/boost-$(BOOST_VERSION)
+GLOG = 3rdparty/glog-$(GLOG_VERSION)
+GMOCK = 3rdparty/gmock-$(GMOCK_VERSION)
+GPERFTOOLS = 3rdparty/gperftools-$(GPERFTOOLS_VERSION)
 GTEST = $(GMOCK)/gtest
-RY_HTTP_PARSER = third_party/ry-http-parser-$(RY_HTTP_PARSER_VERSION)
-LIBEV = third_party/libev-$(LIBEV_VERSION)
+RY_HTTP_PARSER = 3rdparty/ry-http-parser-$(RY_HTTP_PARSER_VERSION)
+LIBEV = 3rdparty/libev-$(LIBEV_VERSION)
 
 
 # Library. It is not installable presently because most people link
@@ -48,7 +48,7 @@ libprocess_la_CPPFLAGS =		\
 
 libprocess_la_LIBADD =			\
   $(GLOG)/libglog.la			\
-  third_party/libry_http_parser.la	\
+  3rdparty/libry_http_parser.la	\
   $(LIBEV)/libev.la
 
 if HAS_GPERFTOOLS
@@ -111,7 +111,7 @@ tests_CPPFLAGS =			\
   -I$(GMOCK)/include			\
   $(libprocess_la_CPPFLAGS)
 
-tests_LDADD = third_party/libgmock.la libprocess.la
+tests_LDADD = 3rdparty/libgmock.la libprocess.la
 
 TESTS = tests
 

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/third_party/libprocess/configure.ac b/third_party/libprocess/configure.ac
index efa7783..d3b86a3 100644
--- a/third_party/libprocess/configure.ac
+++ b/third_party/libprocess/configure.ac
@@ -35,18 +35,18 @@ LT_OUTPUT
 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], [CFLAGS="-g"])
 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], [CXXFLAGS="-g"])
 
-# Save the configure arguments so we can pass them to any third_party
+# Save the configure arguments so we can pass them to any third-party
 # libraries that we might run configure on (see
-# third_party/Makefile.am). One downside of our strategy for shipping
-# and building third_party libraries is that we can't expose options
-# from nested third_party configure scripts.
+# 3rdparty/Makefile.am). One downside of our strategy for shipping
+# and building third-party libraries is that we can't expose options
+# from nested third-party configure scripts.
 CONFIGURE_ARGS="$ac_configure_args"
 AC_SUBST(CONFIGURE_ARGS)
 
-AC_CONFIG_SUBDIRS([third_party/stout])
+AC_CONFIG_SUBDIRS([3rdparty/stout])
 
 AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([third_party/Makefile])
+AC_CONFIG_FILES([3rdparty/Makefile])
 
 AC_ARG_ENABLE([install],
               AS_HELP_STRING([--enable-install],

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/Makefile.am
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/Makefile.am b/third_party/libprocess/third_party/Makefile.am
deleted file mode 100644
index 2f0567b..0000000
--- a/third_party/libprocess/third_party/Makefile.am
+++ /dev/null
@@ -1,170 +0,0 @@
-# This Makefile is for building third_party packages from
-# tarballs. For autotools-based packages, we configure each of the
-# packages to build static PIC binaries which we can safely link into
-# a shared libmesos, and build it in-place without installing it (even
-# if one runs 'make install' in this directory). Non-autotools based
-# packages may be special cases; this Makefile is responsible for
-# passing any special make or configure flags that might be required.
-
-SUBDIRS = stout
-
-BUILT_SOURCES = # Initialized to enable using +=.
-
-# We need to add '--srcdir=.' needed because 'make distcheck' adds
-#  '--srcdir=...' when configuring.
-CONFIGURE_ARGS = @CONFIGURE_ARGS@ --enable-shared=no --with-pic --srcdir=.
-
-include versions.am
-
-STOUT = stout
-BOOST = boost-$(BOOST_VERSION)
-GLOG = glog-$(GLOG_VERSION)
-GMOCK = gmock-$(GMOCK_VERSION)
-GPERFTOOLS = gperftools-$(GPERFTOOLS_VERSION)
-GTEST = $(GMOCK)/gtest
-RY_HTTP_PARSER = ry-http-parser-$(RY_HTTP_PARSER_VERSION)
-LIBEV = libev-$(LIBEV_VERSION)
-PROTOBUF = protobuf-$(PROTOBUF_VERSION)
-
-
-EXTRA_DIST =			\
-  $(BOOST).tar.gz		\
-  $(GLOG).tar.gz		\
-  $(GMOCK).tar.gz		\
-  $(GPERFTOOLS).tar.gz		\
-  $(LIBEV).tar.gz		\
-  $(LIBEV).patch		\
-  $(PROTOBUF).tar.gz		\
-  $(RY_HTTP_PARSER).tar.gz
-
-CLEAN_EXTRACTED =	\
-  $(BOOST)		\
-  $(GLOG)		\
-  $(GMOCK)		\
-  $(GPERFTOOLS)		\
-  $(LIBEV)		\
-  $(PROTOBUF)		\
-  $(RY_HTTP_PARSER)
-
-
-# This is where the magic happens: we use stamp files as dependencies
-# which cause the packages to get extracted as necessary. We also
-# apply any patches as appropriate.
-%-stamp: %.tar.gz
-	gzip -d -c $^ | tar xf -
-	test ! -e $(srcdir)/$*.patch || patch -d $* -p1 <$(srcdir)/$*.patch
-	touch $@
-
-
-# Convenience library for Ryan Dahl's HTTP parser.
-noinst_LTLIBRARIES = libry_http_parser.la
-nodist_libry_http_parser_la_SOURCES = $(RY_HTTP_PARSER)/http_parser.c
-libry_http_parser_la_CPPFLAGS = -I$(RY_HTTP_PARSER)
-
-# We list the sources in BUILT_SOURCES to make sure that the package
-# gets unarchived first.
-BUILT_SOURCES += $(nodist_libry_http_parser_la_SOURCES)
-
-
-# Convenience library for gmock/gtest.
-check_LTLIBRARIES = libgmock.la
-nodist_libgmock_la_SOURCES =		\
-  $(GTEST)/src/gtest-all.cc		\
-  $(GMOCK)/src/gmock-all.cc
-libgmock_la_CPPFLAGS =			\
-  -I$(GTEST)/include -I$(GTEST)		\
-  -I$(GMOCK)/include -I$(GMOCK)
-
-# We list the sources in BUILT_SOURCES to make sure that the package
-# gets unarchived first.
-BUILT_SOURCES += $(nodist_libgmock_la_SOURCES)
-
-$(GMOCK)/src/gmock-all.cc: $(GMOCK)-stamp
-$(GTEST)/src/gtest-all.cc: $(GMOCK)-stamp
-
-
-$(BOOST)/boost: $(BOOST)-stamp
-
-$(GLOG)/libglog.la: $(GLOG)-stamp
-	cd $(GLOG) && ./configure $(CONFIGURE_ARGS) && \
-          $(MAKE) $(AM_MAKEFLAGS)
-
-if HAS_GPERFTOOLS
-$(GPERFTOOLS)/libprofiler.la: $(GPERFTOOLS)-build-stamp
-
-$(GPERFTOOLS)-build-stamp: $(GPERFTOOLS)-stamp
-	cd $(GPERFTOOLS) && ./configure  $(CONFIGURE_ARGS) && \
-	  $(MAKE) $(AM_MAKEFLAGS)
-	touch $@
-endif
-
-$(LIBEV)/libev.la: $(LIBEV)-stamp
-	cd $(LIBEV) && ./configure $(CONFIGURE_ARGS) && \
-          $(MAKE) $(AM_MAKEFLAGS)
-
-$(PROTOBUF)/src/protoc $(PROTOBUF)/src/libprotobuf.la: $(PROTOBUF)-build-stamp
-
-$(PROTOBUF)-build-stamp: $(PROTOBUF)-stamp
-	cd $(PROTOBUF) && ./configure $(CONFIGURE_ARGS) && \
-          $(MAKE) $(AM_MAKEFLAGS)
-	touch $@
-
-$(RY_HTTP_PARSER)/http_parser.c: $(RY_HTTP_PARSER)-stamp
-
-
-# Tests for stout.
-check_PROGRAMS = stout-tests
-
-stout_tests_SOURCES =				\
-  $(STOUT)/tests/bytes_tests.cpp		\
-  $(STOUT)/tests/duration_tests.cpp		\
-  $(STOUT)/tests/error_tests.cpp		\
-  $(STOUT)/tests/flags_tests.cpp		\
-  $(STOUT)/tests/gzip_tests.cpp			\
-  $(STOUT)/tests/hashset_tests.cpp		\
-  $(STOUT)/tests/json_tests.cpp			\
-  $(STOUT)/tests/main.cpp			\
-  $(STOUT)/tests/multimap_tests.cpp		\
-  $(STOUT)/tests/none_tests.cpp			\
-  $(STOUT)/tests/os_tests.cpp			\
-  $(STOUT)/tests/strings_tests.cpp		\
-  $(STOUT)/tests/uuid_tests.cpp
-
-if OS_LINUX
-  stout_tests_SOURCES += $(STOUT)/tests/proc_tests.cpp
-endif
-
-stout_tests_CPPFLAGS =				\
-  -I$(srcdir)/$(STOUT)/include			\
-  -I$(BOOST)					\
-  -I$(GLOG)/src					\
-  -I$(GTEST)/include				\
-  -I$(GMOCK)/include				\
-  -I$(PROTOBUF)/src				\
-  $(AM_CPPFLAGS)
-
-stout_tests_LDADD =			\
-  libgmock.la				\
-  $(GLOG)/libglog.la			\
-  $(PROTOBUF)/src/libprotobuf.la
-
-TESTS = stout-tests
-
-# Dependencies for all-local.
-ALL_LOCAL =				\
-  $(STOUT)/Makefile			\
-  $(BOOST)-stamp			\
-  $(GLOG)/libglog.la			\
-  $(LIBEV)/libev.la			\
-  $(PROTOBUF)/src/libprotobuf.la	\
-  $(PROTOBUF)/src/protoc
-
-if HAS_GPERFTOOLS
- ALL_LOCAL += $(GPERFTOOLS)/libprofiler.la
-endif
-
-all-local: $(ALL_LOCAL)
-
-clean-local:
-	rm -r -f $(CLEAN_EXTRACTED)
-	rm -f *-stamp

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/boost-1.53.0.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/boost-1.53.0.tar.gz b/third_party/libprocess/third_party/boost-1.53.0.tar.gz
deleted file mode 100644
index 770d837..0000000
Binary files a/third_party/libprocess/third_party/boost-1.53.0.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/glog-0.3.1.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/glog-0.3.1.tar.gz b/third_party/libprocess/third_party/glog-0.3.1.tar.gz
deleted file mode 100644
index 19b4b94..0000000
Binary files a/third_party/libprocess/third_party/glog-0.3.1.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/gmock-1.6.0.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/gmock-1.6.0.tar.gz b/third_party/libprocess/third_party/gmock-1.6.0.tar.gz
deleted file mode 100644
index d45d989..0000000
Binary files a/third_party/libprocess/third_party/gmock-1.6.0.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/gperftools-2.0.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/gperftools-2.0.tar.gz b/third_party/libprocess/third_party/gperftools-2.0.tar.gz
deleted file mode 100644
index 13b03ca..0000000
Binary files a/third_party/libprocess/third_party/gperftools-2.0.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/libev-4.15.patch
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/libev-4.15.patch b/third_party/libprocess/third_party/libev-4.15.patch
deleted file mode 100644
index 2b94532..0000000
--- a/third_party/libprocess/third_party/libev-4.15.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -rupN libev-4.15/ev.h libev-4.15-patched/ev.h
---- libev-4.15/ev.h	2013-03-01 03:05:29.000000000 -0800
-+++ libev-4.15-patched/ev.h	2013-05-20 16:01:47.000000000 -0700
-@@ -121,7 +121,7 @@ EV_CPP(extern "C" {)
- # ifdef _WIN32
- #  define EV_CHILD_ENABLE 0
- # else
--#  define EV_CHILD_ENABLE EV_FEATURE_WATCHERS
-+#  define EV_CHILD_ENABLE 0
- #endif
- #endif

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/libev-4.15.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/libev-4.15.tar.gz b/third_party/libprocess/third_party/libev-4.15.tar.gz
deleted file mode 100644
index 4c282b5..0000000
Binary files a/third_party/libprocess/third_party/libev-4.15.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/protobuf-2.4.1.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/protobuf-2.4.1.tar.gz b/third_party/libprocess/third_party/protobuf-2.4.1.tar.gz
deleted file mode 100644
index 38ec4de..0000000
Binary files a/third_party/libprocess/third_party/protobuf-2.4.1.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/ry-http-parser-1c3624a.tar.gz
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/ry-http-parser-1c3624a.tar.gz b/third_party/libprocess/third_party/ry-http-parser-1c3624a.tar.gz
deleted file mode 100644
index b811b63..0000000
Binary files a/third_party/libprocess/third_party/ry-http-parser-1c3624a.tar.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/LICENSE
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/LICENSE b/third_party/libprocess/third_party/stout/LICENSE
deleted file mode 100644
index f433b1a..0000000
--- a/third_party/libprocess/third_party/stout/LICENSE
+++ /dev/null
@@ -1,177 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/Makefile.am b/third_party/libprocess/third_party/stout/Makefile.am
deleted file mode 100644
index fdd3482..0000000
--- a/third_party/libprocess/third_party/stout/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-# Makefile for stout.
-
-ACLOCAL_AMFLAGS = -I m4
-
-AUTOMAKE_OPTIONS = foreign
-
-EXTRA_DIST =					\
-  include/stout/bytes.hpp			\
-  include/stout/cache.hpp			\
-  include/stout/duration.hpp			\
-  include/stout/error.hpp			\
-  include/stout/exit.hpp			\
-  include/stout/fatal.hpp			\
-  include/stout/flags.hpp			\
-  include/stout/flags/flag.hpp			\
-  include/stout/flags/flags.hpp			\
-  include/stout/flags/loader.hpp		\
-  include/stout/flags/parse.hpp			\
-  include/stout/foreach.hpp			\
-  include/stout/format.hpp			\
-  include/stout/fs.hpp				\
-  include/stout/gtest.hpp			\
-  include/stout/gzip.hpp			\
-  include/stout/hashmap.hpp			\
-  include/stout/hashset.hpp			\
-  include/stout/json.hpp			\
-  include/stout/lambda.hpp			\
-  include/stout/multihashmap.hpp		\
-  include/stout/multimap.hpp			\
-  include/stout/net.hpp				\
-  include/stout/none.hpp			\
-  include/stout/nothing.hpp			\
-  include/stout/numify.hpp			\
-  include/stout/option.hpp			\
-  include/stout/os.hpp				\
-  include/stout/owned.hpp			\
-  include/stout/path.hpp			\
-  include/stout/preprocessor.hpp		\
-  include/stout/proc.hpp			\
-  include/stout/protobuf.hpp			\
-  include/stout/result.hpp			\
-  include/stout/stopwatch.hpp			\
-  include/stout/stringify.hpp			\
-  include/stout/strings.hpp			\
-  include/stout/try.hpp				\
-  include/stout/utils.hpp			\
-  include/stout/uuid.hpp			\
-  tests/bytes_tests.cpp				\
-  tests/duration_tests.cpp			\
-  tests/error_tests.cpp				\
-  tests/flags_tests.cpp				\
-  tests/gzip_tests.cpp				\
-  tests/hashset_tests.cpp			\
-  tests/json_tests.cpp				\
-  tests/main.cpp				\
-  tests/multimap_tests.cpp			\
-  tests/none_tests.cpp				\
-  tests/os_tests.cpp				\
-  tests/proc_tests.cpp				\
-  tests/strings_tests.cpp			\
-  tests/uuid_tests.cpp

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/README
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/README b/third_party/libprocess/third_party/stout/README
deleted file mode 100644
index 685a4ae..0000000
--- a/third_party/libprocess/third_party/stout/README
+++ /dev/null
@@ -1,32 +0,0 @@
-Stout is a header-only C++ library.
-
-No action is needed if you would like to use this library in your
-project. Simply add the include folder to your include path during
-compilation.
-
-Depending on which headers you'd like to use, you may require the
-following third party libraries:
-
-  - Boost
-  - Google's glog (this dependency will be removed in the future).
-  - Google's protobuf.
-  - Google's gmock/gtest.
-
-
-Building Tests
-==============
-
-We'll assume you've got a distribution of gmock and have already built
-a static archive called libgmock.a (see gmock's README to learn
-how). We'll also assume the Boost and glog headers can be found via
-the include paths and libglog.* can be found via the library search
-paths. You can then build the tests via:
-
-$ g++ -I${STOUT}/include -I$(GMOCK)/gtest/include -I$(GMOCK)/include \
-  ${STOUT}/tests/tests.cpp libgmock.a -lglog -o tests
-
-Note that if you want to test the gzip headers you'll need to define
-HAVE_LIBZ and link against libz:
-
-$ g++ -I${STOUT}/include -I$(GMOCK)/gtest/include -I$(GMOCK)/include \
-  -DHAVE_LIBZ ${STOUT}/tests/tests.cpp libgmock.a -lglog -lz -o tests

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/bootstrap
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/bootstrap b/third_party/libprocess/third_party/stout/bootstrap
deleted file mode 100755
index 89b9bc8..0000000
--- a/third_party/libprocess/third_party/stout/bootstrap
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Make sure that we are in the right directory.
-if test ! -f configure.ac; then
-    cat >&2 <<__EOF__
-You must run bootstrap from the root of the distribution.
-__EOF__
-    exit 1
-fi
-
-autoreconf --install -Wall --verbose "${@}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/configure.ac
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/configure.ac b/third_party/libprocess/third_party/stout/configure.ac
deleted file mode 100644
index 86e1ff3..0000000
--- a/third_party/libprocess/third_party/stout/configure.ac
+++ /dev/null
@@ -1,14 +0,0 @@
-# Generated with autoscan, then modified appropriately.
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.61])
-AC_INIT([stout], [0.1.0])
-
-AC_LANG([C++])
-
-# Initialize automake.
-AM_INIT_AUTOMAKE([1.10])
-
-AC_CONFIG_FILES([Makefile])
-
-AC_OUTPUT

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/bytes.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/bytes.hpp b/third_party/libprocess/third_party/stout/include/stout/bytes.hpp
deleted file mode 100644
index 754fbb2..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/bytes.hpp
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef __STOUT_BYTES_HPP__
-#define __STOUT_BYTES_HPP__
-
-#include <ctype.h> // For 'isdigit'.
-#include <stdint.h>
-
-#include <iomanip>
-#include <iostream>
-#include <string>
-
-#include "numify.hpp"
-#include "strings.hpp"
-#include "try.hpp"
-
-
-class Bytes
-{
-public:
-  static Try<Bytes> parse(const std::string& s)
-  {
-    size_t index = 0;
-
-    while (index < s.size()) {
-      if (isdigit(s[index])) {
-        index++;
-        continue;
-      } else if (s[index] == '.') {
-        return Error("Fractional bytes '" + s + "'");
-      }
-
-      Try<uint64_t> value = numify<uint64_t>(s.substr(0, index));
-
-      if (value.isError()) {
-        return Error(value.error());
-      }
-
-      const std::string& unit = strings::upper(s.substr(index));
-
-      if (unit == "B") {
-        return Bytes(value.get(), BYTES);
-      } else if (unit == "KB") {
-        return Bytes(value.get(), KILOBYTES);
-      } else if (unit == "MB") {
-        return Bytes(value.get(), MEGABYTES);
-      } else if (unit == "GB") {
-        return Bytes(value.get(), GIGABYTES);
-      } else if (unit == "TB") {
-        return Bytes(value.get(), TERABYTES);
-      } else {
-        return Error("Unknown bytes unit '" + unit + "'");
-      }
-    }
-    return Error("Invalid bytes '" + s + "'");
-  }
-
-  Bytes(uint64_t bytes = 0) : value(bytes) {}
-  Bytes(uint64_t _value, uint64_t _unit) : value(_value * _unit) {}
-
-  // TODO(bmahler): Consider killing kilobytes to terabyte helpers, given
-  // they implicitly lose precision if not careful.
-  uint64_t bytes()     const { return value; }
-  uint64_t kilobytes() const { return value / KILOBYTES; }
-  uint64_t megabytes() const { return value / MEGABYTES; }
-  uint64_t gigabytes() const { return value / GIGABYTES; }
-  uint64_t terabytes() const { return value / TERABYTES; }
-
-  bool operator <  (const Bytes& that) const { return value <  that.value; }
-  bool operator <= (const Bytes& that) const { return value <= that.value; }
-  bool operator >  (const Bytes& that) const { return value >  that.value; }
-  bool operator >= (const Bytes& that) const { return value >= that.value; }
-  bool operator == (const Bytes& that) const { return value == that.value; }
-  bool operator != (const Bytes& that) const { return value != that.value; }
-
-  Bytes& operator += (const Bytes& that)
-  {
-    value += that.value;
-    return *this;
-  }
-
-  Bytes& operator -= (const Bytes& that)
-  {
-    value -= that.value;
-    return *this;
-  }
-
-protected:
-  static const uint64_t BYTES = 1;
-  static const uint64_t KILOBYTES = 1024 * BYTES;
-  static const uint64_t MEGABYTES = 1024 * KILOBYTES;
-  static const uint64_t GIGABYTES = 1024 * MEGABYTES;
-  static const uint64_t TERABYTES = 1024 * GIGABYTES;
-
-private:
-  uint64_t value;
-};
-
-
-class Kilobytes : public Bytes
-{
-public:
-  explicit Kilobytes(uint64_t value) : Bytes(value, KILOBYTES) {}
-};
-
-
-class Megabytes : public Bytes
-{
-public:
-  explicit Megabytes(uint64_t value) : Bytes(value, MEGABYTES) {}
-};
-
-
-class Gigabytes : public Bytes
-{
-public:
-  explicit Gigabytes(uint64_t value) : Bytes(value, GIGABYTES) {}
-};
-
-
-class Terabytes : public Bytes
-{
-public:
-  explicit Terabytes(uint64_t value) : Bytes(value, TERABYTES) {}
-};
-
-
-inline std::ostream& operator << (std::ostream& stream, const Bytes& bytes)
-{
-  // Only raise the unit when there is no loss of information.
-  if (bytes.bytes() == 0) {
-    return stream << bytes.bytes() << "B";
-  } else if (bytes.bytes() % 1024 != 0) {
-    return stream << bytes.bytes() << "B";
-  } else if (bytes.kilobytes() % 1024 != 0) {
-    return stream << bytes.kilobytes() << "KB";
-  } else if (bytes.megabytes() % 1024 != 0) {
-    return stream << bytes.megabytes() << "MB";
-  } else if (bytes.gigabytes() % 1024 != 0) {
-    return stream << bytes.gigabytes() << "GB";
-  } else {
-    return stream << bytes.terabytes() << "TB";
-  }
-}
-
-
-inline Bytes operator + (const Bytes& lhs, const Bytes& rhs)
-{
-  Bytes sum = lhs;
-  sum += rhs;
-  return sum;
-}
-
-
-inline Bytes operator - (const Bytes& lhs, const Bytes& rhs)
-{
-  Bytes diff = lhs;
-  diff -= rhs;
-  return diff;
-}
-
-#endif // __STOUT_BYTES_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/cache.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/cache.hpp b/third_party/libprocess/third_party/stout/include/stout/cache.hpp
deleted file mode 100644
index 653507c..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/cache.hpp
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef __STOUT_CACHE_HPP__
-#define __STOUT_CACHE_HPP__
-
-#include <functional>
-#include <iostream>
-#include <list>
-#include <map>
-
-#include <tr1/functional>
-#include <tr1/unordered_map>
-
-#include "none.hpp"
-#include "option.hpp"
-
-// Forward declaration.
-template <typename Key, typename Value>
-class cache;
-
-// Outputs the key/value pairs from least to most-recently used.
-template <typename Key, typename Value>
-std::ostream& operator << (
-    std::ostream& stream,
-    const cache<Key, Value>& c);
-
-
-// Provides a least-recently used (LRU) cache of some predefined
-// capacity. A "write" and a "read" both count as uses.
-template <typename Key, typename Value>
-class cache
-{
-public:
-  typedef std::list<Key> list;
-  typedef std::tr1::unordered_map<
-    Key, std::pair<Value, typename list::iterator> > map;
-
-  explicit cache(int _capacity) : capacity(_capacity) {}
-
-  void put(const Key& key, const Value& value)
-  {
-    typename map::iterator i = values.find(key);
-    if (i == values.end()) {
-      insert(key, value);
-    } else {
-      (*i).second.first = value;
-      use(i);
-    }
-  }
-
-  Option<Value> get(const Key& key)
-  {
-    typename map::iterator i = values.find(key);
-
-    if (i != values.end()) {
-      use(i);
-      return (*i).second.first;
-    }
-
-    return None();
-  }
-
-private:
-  // Not copyable, not assignable.
-  cache(const cache&);
-  cache& operator = (const cache&);
-
-  // Give the operator access to our internals.
-  friend std::ostream& operator << <>(
-      std::ostream& stream,
-      const cache<Key, Value>& c);
-
-  // Insert key/value into the cache.
-  void insert(const Key& key, const Value& value)
-  {
-    if (keys.size() == capacity) {
-      evict();
-    }
-
-    // Get a "pointer" into the lru list for efficient update.
-    typename list::iterator i = keys.insert(keys.end(), key);
-
-    // Save key/value and "pointer" into lru list.
-    values.insert(std::make_pair(key, std::make_pair(value, i)));
-  }
-
-  // Updates the LRU ordering in the cache for the given iterator.
-  void use(const typename map::iterator& i)
-  {
-    // Move the "pointer" to the end of the lru list.
-    keys.splice(keys.end(), keys, (*i).second.second);
-
-    // Now update the "pointer" so we can do this again.
-    (*i).second.second = --keys.end();
-  }
-
-  // Evict the least-recently used element from the cache.
-  void evict()
-  {
-    const typename map::iterator& i = values.find(keys.front());
-    CHECK(i != values.end());
-    values.erase(i);
-    keys.pop_front();
-  }
-
-  // Size of the cache.
-  int capacity;
-
-  // Cache of values and "pointers" into the least-recently used list.
-  map values;
-
-  // Keys ordered by least-recently used.
-  list keys;
-};
-
-
-template <typename Key, typename Value>
-std::ostream& operator << (
-    std::ostream& stream,
-    const cache<Key, Value>& c)
-{
-  typename cache<Key, Value>::list::const_iterator i1;
-  for (i1 = c.keys.begin(); i1 != c.keys.end(); i1++) {
-    stream << *i1 << ": ";
-    typename cache<Key, Value>::map::const_iterator i2;
-    i2 = c.values.find(*i1);
-    CHECK(i2 != c.values.end());
-    stream << *i2 << std::endl;
-  }
-  return stream;
-}
-
-#endif // __STOUT_CACHE_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/duration.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/duration.hpp b/third_party/libprocess/third_party/stout/include/stout/duration.hpp
deleted file mode 100644
index 47e85ff..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/duration.hpp
+++ /dev/null
@@ -1,297 +0,0 @@
-#ifndef __STOUT_DURATION_HPP__
-#define __STOUT_DURATION_HPP__
-
-#include <ctype.h> // For 'isdigit'.
-#include <limits.h> // For 'LLONG_(MAX|MIN)'
-
-#include <iomanip>
-#include <iostream>
-#include <string>
-
-#include "error.hpp"
-#include "numify.hpp"
-#include "try.hpp"
-
-class Duration
-{
-public:
-  static Try<Duration> parse(const std::string& s)
-  {
-    // TODO(benh): Support negative durations (i.e., starts with '-').
-    size_t index = 0;
-    while (index < s.size()) {
-      if (isdigit(s[index]) || s[index] == '.') {
-        index++;
-        continue;
-      }
-
-      Try<double> value = numify<double>(s.substr(0, index));
-
-      if (value.isError()) {
-        return Error(value.error());
-      }
-
-      const std::string& unit = s.substr(index);
-
-      if (unit == "ns") {
-        return Duration(value.get(), NANOSECONDS);
-      } else if (unit == "us") {
-        return Duration(value.get(), MICROSECONDS);
-      } else if (unit == "ms") {
-        return Duration(value.get(), MILLISECONDS);
-      } else if (unit == "secs") {
-        return Duration(value.get(), SECONDS);
-      } else if (unit == "mins") {
-        return Duration(value.get(), MINUTES);
-      } else if (unit == "hrs") {
-        return Duration(value.get(), HOURS);
-      } else if (unit == "days") {
-        return Duration(value.get(), DAYS);
-      } else if (unit == "weeks") {
-        return Duration(value.get(), WEEKS);
-      } else {
-        return Error("Unknown duration unit '" + unit + "'");
-      }
-    }
-    return Error("Invalid duration '" + s + "'");
-  }
-
-  static Try<Duration> create(double seconds);
-
-  Duration() : nanos(0) {}
-
-  int64_t ns() const   { return nanos; }
-  double us() const    { return static_cast<double>(nanos) / MICROSECONDS; }
-  double ms() const    { return static_cast<double>(nanos) / MILLISECONDS; }
-  double secs() const  { return static_cast<double>(nanos) / SECONDS; }
-  double mins() const  { return static_cast<double>(nanos) / MINUTES; }
-  double hrs() const   { return static_cast<double>(nanos) / HOURS; }
-  double days() const  { return static_cast<double>(nanos) / DAYS; }
-  double weeks() const { return static_cast<double>(nanos) / WEEKS; }
-
-  bool operator <  (const Duration& d) const { return nanos <  d.nanos; }
-  bool operator <= (const Duration& d) const { return nanos <= d.nanos; }
-  bool operator >  (const Duration& d) const { return nanos >  d.nanos; }
-  bool operator >= (const Duration& d) const { return nanos >= d.nanos; }
-  bool operator == (const Duration& d) const { return nanos == d.nanos; }
-  bool operator != (const Duration& d) const { return nanos != d.nanos; }
-
-  Duration& operator += (const Duration& that)
-  {
-    nanos += that.nanos;
-    return *this;
-  }
-
-  Duration& operator -= (const Duration& that)
-  {
-    nanos -= that.nanos;
-    return *this;
-  }
-
-  Duration& operator *= (double multiplier)
-  {
-    nanos = static_cast<int64_t>(nanos * multiplier);
-    return *this;
-  }
-
-  Duration& operator /= (double divisor)
-  {
-    nanos = static_cast<int64_t>(nanos / divisor);
-    return *this;
-  }
-
-  Duration operator + (const Duration& that) const
-  {
-    Duration sum = *this;
-    sum += that;
-    return sum;
-  }
-
-  Duration operator - (const Duration& that) const
-  {
-    Duration diff = *this;
-    diff -= that;
-    return diff;
-  }
-
-  Duration operator * (double multiplier) const
-  {
-    Duration product = *this;
-    product *= multiplier;
-    return product;
-  }
-
-  Duration operator / (double divisor) const
-  {
-    Duration quotient = *this;
-    quotient /= divisor;
-    return quotient;
-  }
-
-  // TODO(xujyan): Use constexpr for the following variables after
-  // switching to C++11.
-  // A constant holding the maximum value a Duration can have.
-  static Duration max();
-  // A constant holding the minimum (negative) value a Duration can
-  // have.
-  static Duration min();
-  // A constant holding a Duration of a "zero" value.
-  static Duration zero() { return Duration(); }
-
-protected:
-  static const int64_t NANOSECONDS  = 1;
-  static const int64_t MICROSECONDS = 1000 * NANOSECONDS;
-  static const int64_t MILLISECONDS = 1000 * MICROSECONDS;
-  static const int64_t SECONDS      = 1000 * MILLISECONDS;
-  static const int64_t MINUTES      = 60 * SECONDS;
-  static const int64_t HOURS        = 60 * MINUTES;
-  static const int64_t DAYS         = 24 * HOURS;
-  static const int64_t WEEKS        = 7 * DAYS;
-
-  // For the Seconds, Minutes, Hours, Days & Weeks constructor.
-  Duration(int32_t value, int64_t unit)
-    : nanos(value * unit) {}
-
-  // For the Nanoseconds, Microseconds, Milliseconds constructor.
-  Duration(int64_t value, int64_t unit)
-    : nanos(value * unit) {}
-
-private:
-  // Used only by "parse".
-  Duration(double value, int64_t unit)
-    : nanos(static_cast<int64_t>(value * unit)) {}
-
-  int64_t nanos;
-};
-
-
-class Nanoseconds : public Duration
-{
-public:
-  explicit Nanoseconds(int64_t nanoseconds)
-    : Duration(nanoseconds, NANOSECONDS) {}
-
-  Nanoseconds(const Duration& d) : Duration(d) {}
-};
-
-
-class Microseconds : public Duration
-{
-public:
-  explicit Microseconds(int64_t microseconds)
-    : Duration(microseconds, MICROSECONDS) {}
-
-  Microseconds(const Duration& d) : Duration(d) {}
-};
-
-
-class Milliseconds : public Duration
-{
-public:
-  explicit Milliseconds(int64_t milliseconds)
-    : Duration(milliseconds, MILLISECONDS) {}
-
-  Milliseconds(const Duration& d) : Duration(d) {}
-};
-
-
-class Seconds : public Duration
-{
-public:
-  explicit Seconds(int64_t seconds)
-    : Duration(seconds, SECONDS) {}
-
-  Seconds(const Duration& d) : Duration(d) {}
-};
-
-
-class Minutes : public Duration
-{
-public:
-  explicit Minutes(int32_t minutes)
-    : Duration(minutes, MINUTES) {}
-
-  Minutes(const Duration& d) : Duration(d) {}
-};
-
-
-class Hours : public Duration
-{
-public:
-  explicit Hours(int32_t hours)
-    : Duration(hours, HOURS) {}
-
-  Hours(const Duration& d) : Duration(d) {}
-};
-
-
-class Days : public Duration
-{
-public:
-  explicit Days(int32_t days)
-    : Duration(days, DAYS) {}
-
-  Days(const Duration& d) : Duration(d) {}
-};
-
-
-class Weeks : public Duration
-{
-public:
-  explicit Weeks(int32_t value) : Duration(value, WEEKS) {}
-
-  Weeks(const Duration& d) : Duration(d) {}
-};
-
-
-inline std::ostream& operator << (
-    std::ostream& stream,
-    const Duration& duration)
-{
-  long precision = stream.precision();
-
-  // Output the duration in full double precision.
-  stream.precision(std::numeric_limits<double>::digits10);
-
-  if (duration < Microseconds(1)) {
-    stream << duration.ns() << "ns";
-  } else if (duration < Milliseconds(1)) {
-    stream << duration.us() << "us";
-  } else if (duration < Seconds(1)) {
-    stream << duration.ms() << "ms";
-  } else if (duration < Minutes(1)) {
-    stream << duration.secs() << "secs";
-  } else if (duration < Hours(1)) {
-    stream << duration.mins() << "mins";
-  } else if (duration < Days(1)) {
-    stream << duration.hrs() << "hrs";
-  } else if (duration < Weeks(1)) {
-    stream << duration.days() << "days";
-  } else {
-    stream << duration.weeks() << "weeks";
-  }
-
-  // Return the stream to original formatting state.
-  stream.precision(precision);
-
-  return stream;
-}
-
-
-inline Try<Duration> Duration::create(double seconds)
-{
-  if (seconds * SECONDS > LLONG_MAX) {
-    return Error("Argument larger than the maximum number of seconds that "
-                 "a Duration can represent due to int64_t's size limit.");
-  }
-
-  return Nanoseconds(static_cast<int64_t>(seconds * SECONDS));
-}
-
-
-inline Duration Duration::max() { return Nanoseconds(LLONG_MAX); }
-
-
-inline Duration Duration::min() { return Nanoseconds(LLONG_MIN); }
-
-#endif // __STOUT_DURATION_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/error.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/error.hpp b/third_party/libprocess/third_party/stout/include/stout/error.hpp
deleted file mode 100644
index 97a5cec..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/error.hpp
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef __STOUT_ERROR_HPP__
-#define __STOUT_ERROR_HPP__
-
-#include <errno.h>
-#include <string.h> // For strerror.
-
-#include <string>
-
-#include "result.hpp"
-#include "try.hpp"
-
-// An "error" type that is implicitly convertible to a Try<T> or
-// Result<T> for any T (effectively "syntactic sugar" to make code
-// more readable). The implementation uses cast operators to perform
-// the conversions instead of adding constructors to Try/Result
-// directly. One could imagine revisiting that decision for C++11
-// because the use of rvalue reference could eliminate some
-// unnecessary copies. However, performance is not critical since
-// Error should not get called very often in practice (if so, it's
-// probably being used for things that aren't really errors or there
-// is a more serious problem during execution).
-
-class Error
-{
-public:
-  explicit Error(const std::string& _message) : message(_message) {}
-
-  template <typename T>
-  operator Try<T> () const
-  {
-    return Try<T>::error(message);
-  }
-
-  // Give the compiler some help for nested Try<T>. For example,
-  // enable converting Error to an Option<Try<T>>. Note that this will
-  // bind to the innermost Try<T>.
-  template <template <typename> class S, typename T>
-  operator S<Try<T> > () const
-  {
-    return S<Try<T> >(Try<T>::error(message));
-  }
-
-  template <typename T>
-  operator Result<T> () const
-  {
-    return Result<T>::error(message);
-  }
-
-  // Give the compiler some help for nested Result<T>. For example,
-  // enable converting Error to an Option<Result<T>>. Note that this
-  // will bind to the innermost Result<T>.
-  template <template <typename> class S, typename T>
-  operator S<Result<T> > () const
-  {
-    return S<Result<T> >(Result<T>::error(message));
-  }
-
-  const std::string message;
-};
-
-
-class ErrnoError : public Error
-{
-public:
-  ErrnoError()
-    : Error(std::string(strerror(errno))) {}
-
-  ErrnoError(const std::string& message)
-    : Error(message + ": " + std::string(strerror(errno))) {}
-};
-
-#endif // __STOUT_ERROR_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/exit.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/exit.hpp b/third_party/libprocess/third_party/stout/include/stout/exit.hpp
deleted file mode 100644
index e8da726..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/exit.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __STOUT_EXIT_HPP__
-#define __STOUT_EXIT_HPP__
-
-#include <stdlib.h>
-
-#include <iostream> // For std::cerr.
-#include <ostream>
-#include <sstream>
-#include <string>
-
-// Exit takes an exit status and provides a stream for output prior to
-// exiting. This is like glog's LOG(FATAL) or CHECK, except that it
-// does _not_ print a stack trace.
-//
-// Ex: EXIT(1) << "Cgroups are not present in this system.";
-#define EXIT(status) __Exit(status).stream()
-
-struct __Exit
-{
-  __Exit(int _status) : status(_status) {}
-
-  ~__Exit()
-  {
-    std::cerr << out.str() << std::endl;
-    exit(status);
-  }
-
-  std::ostream& stream()
-  {
-    return out;
-  }
-
-  std::ostringstream out;
-  const int status;
-};
-
-#endif // __STOUT_EXIT_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/fatal.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/fatal.hpp b/third_party/libprocess/third_party/stout/include/stout/fatal.hpp
deleted file mode 100644
index eabee3e..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/fatal.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef __STOUT_FATAL_HPP__
-#define __STOUT_FATAL_HPP__
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-
-/*
- * Like the non-debug version except includes the file name and line
- * number in the output.
- */
-#define fatal(fmt...) __fatal(__FILE__, __LINE__, fmt)
-inline void __fatal(const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  fprintf(stderr, " (%s:%u)\n", file, line);
-  fflush(stderr);
-  va_end(args);
-  exit(1);
-}
-
-
-/*
- * Like the non-debug version except includes the file name and line
- * number in the output.
- */
-#define fatalerror(fmt...) __fatalerror(__FILE__, __LINE__, fmt)
-inline void __fatalerror(const char *file, int line, const char *fmt, ...)
-{
-  va_list args;
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  fprintf(stderr, " (%s:%u): ", file, line);
-  perror(NULL);
-  fflush(stderr);
-  va_end(args);
-  exit(1);
-}
-
-#endif // __STOUT_FATAL_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/flags.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/flags.hpp b/third_party/libprocess/third_party/stout/include/stout/flags.hpp
deleted file mode 100644
index 0efd079..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/flags.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __STOUT_FLAGS_HPP__
-#define __STOUT_FLAGS_HPP__
-
-#include <stout/flags/flags.hpp>
-
-// An abstraction for application/library "flags". An example is
-// probably best:
-//  -------------------------------------------------------------
-// class MyFlags : public virtual FlagsBase // Use 'virtual' for composition!
-// {
-// public:
-//   Flags()
-//   {
-//     add(&debug,
-//         "debug",
-//         "Help string for debug",
-//         false);
-//
-//     add(&name,
-//         "name",
-//         "Help string for name");
-//   }
-
-//   bool debug;
-//   Option<string> name;
-// };
-//
-// ...
-//
-// map<string, Option<string> > values;
-// values["no-debug"] = None();                       // --no-debug
-// values["debug"] = None();                          // --debug
-// values["debug"] = Option<string>::some("true");    // --debug=true
-// values["debug"] = Option<string>::some("false");   // --debug=false
-// values["name"] = Option<string>::some("frank");    // --name=frank
-//
-// MyFlags flags;
-// flags.load(values);
-// flags.name.isSome() ...
-// flags.debug ...
-//  -------------------------------------------------------------
-//
-// You can also compose flags provided that each has used "virtual
-// inheritance":
-//  -------------------------------------------------------------
-// Flags<MyFlags1, MyFlags2> flags;
-// flags.add(...); // Any other flags you want to throw in there.
-// flags.load(values);
-// flags.flag_from_myflags1 ...
-// flags.flag_from_myflags2 ...
-//  -------------------------------------------------------------
-//
-// "Fail early, fail often":
-//
-// You can not add duplicate flags, this is checked for you at compile
-// time for composite flags (e.g., Flag<MyFlags1, MyFlags2>) and also
-// checked at runtime for any other flags added via inheritance or
-// Flags::add(...).
-//
-// Flags that can not be loaded (e.g., attempting to use the 'no-'
-// prefix for a flag that is not boolean) will print a message to
-// standard error and abort the process.
-
-// TODO(benh): Provide a boolean which specifies whether or not to
-// abort on duplicates or load errors.
-
-// TODO(benh): Make prefix for environment variables configurable
-// (e.g., "MESOS_").
-
-#endif // __STOUT_FLAGS_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/flags/flag.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/flags/flag.hpp b/third_party/libprocess/third_party/stout/include/stout/flags/flag.hpp
deleted file mode 100644
index d31c984..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/flags/flag.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __STOUT_FLAGS_FLAG_HPP__
-#define __STOUT_FLAGS_FLAG_HPP__
-
-#include <string>
-
-#include <tr1/functional>
-
-#include <stout/nothing.hpp>
-#include <stout/try.hpp>
-
-namespace flags {
-
-// Forward declaration.
-class FlagsBase;
-
-struct Flag
-{
-  std::string name;
-  std::string help;
-  bool boolean;
-  std::tr1::function<Try<Nothing>(FlagsBase*, const std::string&)> loader;
-};
-
-} // namespace flags {
-
-#endif // __STOUT_FLAGS_FLAG_HPP__

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/bc531d3c/third_party/libprocess/third_party/stout/include/stout/flags/flags.hpp
----------------------------------------------------------------------
diff --git a/third_party/libprocess/third_party/stout/include/stout/flags/flags.hpp b/third_party/libprocess/third_party/stout/include/stout/flags/flags.hpp
deleted file mode 100644
index 77d36e6..0000000
--- a/third_party/libprocess/third_party/stout/include/stout/flags/flags.hpp
+++ /dev/null
@@ -1,481 +0,0 @@
-#ifndef __STOUT_FLAGS_FLAGS_HPP__
-#define __STOUT_FLAGS_FLAGS_HPP__
-
-#include <stdlib.h> // For abort.
-
-#include <map>
-#include <string>
-#include <typeinfo> // For typeid.
-
-#include <tr1/functional>
-
-#include <stout/error.hpp>
-#include <stout/exit.hpp>
-#include <stout/foreach.hpp>
-#include <stout/none.hpp>
-#include <stout/nothing.hpp>
-#include <stout/option.hpp>
-#include <stout/os.hpp>
-#include <stout/stringify.hpp>
-#include <stout/strings.hpp>
-#include <stout/try.hpp>
-
-#include <stout/flags/flag.hpp>
-#include <stout/flags/loader.hpp>
-#include <stout/flags/parse.hpp>
-
-namespace flags {
-
-class FlagsBase
-{
-public:
-  virtual ~FlagsBase() {}
-
-  // Load any flags from the environment given the variable prefix,
-  // i.e., given prefix 'STOUT_' will load a flag named 'foo' via
-  // environment variables 'STOUT_foo' or 'STOUT_FOO'.
-  virtual Try<Nothing> load(
-      const std::string& prefix,
-      bool unknowns = false);
-
-  // Load any flags from the environment given the variable prefix
-  // (see above) followed by loading from the command line (via 'argc'
-  // and 'argv'). If 'unknowns' is true then we'll ignore unknown
-  // flags we see while loading. If 'duplicates' is true then we'll
-  // ignore any duplicates we see while loading.
-  virtual Try<Nothing> load(
-      const Option<std::string>& prefix,
-      int argc,
-      char** argv,
-      bool unknowns = false,
-      bool duplicates = false);
-
-  Try<Nothing> load(
-      const std::string& prefix,
-      int argc,
-      char** argv,
-      bool unknowns = false,
-      bool duplicates = false);
-
-  virtual Try<Nothing> load(
-      const std::map<std::string, Option<std::string> >& values,
-      bool unknowns = false);
-
-  virtual Try<Nothing> load(
-      const std::map<std::string, std::string>& values,
-      bool unknowns = false);
-
-  // Returns a string describing the flags.
-  std::string usage() const;
-
-  typedef std::map<std::string, Flag>::const_iterator const_iterator;
-
-  const_iterator begin() const { return flags.begin(); }
-  const_iterator end() const { return flags.end(); }
-
-  template <typename T1, typename T2>
-  void add(T1* t1,
-           const std::string& name,
-           const std::string& help,
-           const T2& t2);
-
-  template <typename T>
-  void add(Option<T>* option,
-           const std::string& name,
-           const std::string& help);
-
-protected:
-  template <typename Flags, typename T1, typename T2>
-  void add(T1 Flags::*t1,
-           const std::string& name,
-           const std::string& help,
-           const T2& t2);
-
-  template <typename Flags, typename T>
-  void add(Option<T> Flags::*option,
-           const std::string& name,
-           const std::string& help);
-
-  void add(const Flag& flag);
-
-private:
-  std::map<std::string, Flag> flags;
-};
-
-
-// Need to declare/define some explicit subclasses of FlagsBase so
-// that we can overload the 'Flags::operator FlagsN () const'
-// functions for each possible type.
-class _Flags1 : public virtual FlagsBase {};
-class _Flags2 : public virtual FlagsBase {};
-class _Flags3 : public virtual FlagsBase {};
-class _Flags4 : public virtual FlagsBase {};
-class _Flags5 : public virtual FlagsBase {};
-
-
-// TODO(benh): Add some "type constraints" for template paramters to
-// make sure they are all of type FlagsBase.
-template <typename Flags1 = _Flags1,
-          typename Flags2 = _Flags2,
-          typename Flags3 = _Flags3,
-          typename Flags4 = _Flags4,
-          typename Flags5 = _Flags5>
-class Flags : public virtual Flags1,
-              public virtual Flags2,
-              public virtual Flags3,
-              public virtual Flags4,
-              public virtual Flags5 {};
-
-
-template <typename T1, typename T2>
-void FlagsBase::add(
-    T1* t1,
-    const std::string& name,
-    const std::string& help,
-    const T2& t2)
-{
-  *t1 = t2; // Set the default.
-
-  Flag flag;
-  flag.name = name;
-  flag.help = help;
-  flag.boolean = typeid(T1) == typeid(bool);
-  flag.loader = std::tr1::bind(
-      &Loader<T1>::load,
-      t1,
-      std::tr1::function<Try<T1>(const std::string&)>(
-          std::tr1::bind(&parse<T1>, std::tr1::placeholders::_1)),
-      name,
-      std::tr1::placeholders::_2); // Use _2 because ignore FlagsBase*.
-
-  // Update the help string to include the default value.
-  flag.help += help.size() > 0 && help.find_last_of("\n\r") != help.size() - 1
-    ? " (default: " // On same line, add space.
-    : "(default: "; // On newline.
-  flag.help += stringify(t2);
-  flag.help += ")";
-
-  FlagsBase::add(flag);
-}
-
-
-template <typename T>
-void FlagsBase::add(
-    Option<T>* option,
-    const std::string& name,
-    const std::string& help)
-{
-  Flag flag;
-  flag.name = name;
-  flag.help = help;
-  flag.boolean = typeid(T) == typeid(bool);
-  flag.loader = std::tr1::bind(
-      &OptionLoader<T>::load,
-      option,
-      std::tr1::function<Try<T>(const std::string&)>(
-          std::tr1::bind(&parse<T>, std::tr1::placeholders::_1)),
-      name,
-      std::tr1::placeholders::_2); // Use _2 because ignore FlagsBase*.
-
-  FlagsBase::add(flag);
-}
-
-
-template <typename Flags, typename T1, typename T2>
-void FlagsBase::add(
-    T1 Flags::*t1,
-    const std::string& name,
-    const std::string& help,
-    const T2& t2)
-{
-  Flags* flags = dynamic_cast<Flags*>(this);
-  if (flags == NULL) {
-    std::cerr << "Attempted to add flag '" << name
-              << "' with incompatible type" << std::endl;
-    abort();
-  } else {
-    flags->*t1 = t2; // Set the default.
-  }
-
-  Flag flag;
-  flag.name = name;
-  flag.help = help;
-  flag.boolean = typeid(T1) == typeid(bool);
-  flag.loader = std::tr1::bind(
-      &MemberLoader<Flags, T1>::load,
-      std::tr1::placeholders::_1,
-      t1,
-      std::tr1::function<Try<T1>(const std::string&)>(
-          std::tr1::bind(&parse<T1>, std::tr1::placeholders::_1)),
-      name,
-      std::tr1::placeholders::_2);
-
-  // Update the help string to include the default value.
-  flag.help += help.size() > 0 && help.find_last_of("\n\r") != help.size() - 1
-    ? " (default: " // On same line, add space.
-    : "(default: "; // On newline.
-  flag.help += stringify(t2);
-  flag.help += ")";
-
-  add(flag);
-}
-
-
-template <typename Flags, typename T>
-void FlagsBase::add(
-    Option<T> Flags::*option,
-    const std::string& name,
-    const std::string& help)
-{
-  Flags* flags = dynamic_cast<Flags*>(this);
-  if (flags == NULL) {
-    std::cerr << "Attempted to add flag '" << name
-              << "' with incompatible type" << std::endl;
-    abort();
-  }
-
-  Flag flag;
-  flag.name = name;
-  flag.help = help;
-  flag.boolean = typeid(T) == typeid(bool);
-  flag.loader = std::tr1::bind(
-      &OptionMemberLoader<Flags, T>::load,
-      std::tr1::placeholders::_1,
-      option,
-      std::tr1::function<Try<T>(const std::string&)>(
-          std::tr1::bind(&parse<T>, std::tr1::placeholders::_1)),
-      name,
-      std::tr1::placeholders::_2);
-
-  add(flag);
-}
-
-
-inline void FlagsBase::add(const Flag& flag)
-{
-  if (flags.count(flag.name) > 0) {
-    EXIT(1) << "Attempted to add duplicate flag '" << flag.name << "'";
-  } else if (flag.name.find("no-") == 0) {
-    EXIT(1) << "Attempted to add flag '" << flag.name
-            << "' that starts with the reserved 'no-' prefix";
-  }
-
-  flags[flag.name] = flag;
-}
-
-
-// Extract environment variable "flags" with the specified prefix.
-inline std::map<std::string, Option<std::string> > extract(
-    const std::string& prefix)
-{
-  char** environ = os::environ();
-
-  std::map<std::string, Option<std::string> > values;
-
-  for (int i = 0; environ[i] != NULL; i++) {
-    std::string variable = environ[i];
-    if (variable.find(prefix) == 0) {
-      size_t eq = variable.find_first_of("=");
-      if (eq == std::string::npos) {
-        continue; // Not expecting a missing '=', but ignore anyway.
-      }
-      std::string name = variable.substr(prefix.size(), eq - prefix.size());
-      name = strings::lower(name); // Allow PREFIX_NAME or PREFIX_name.
-      std::string value = variable.substr(eq + 1);
-      values[name] = Option<std::string>::some(value);
-    }
-  }
-
-  return values;
-}
-
-
-inline Try<Nothing> FlagsBase::load(
-    const std::string& prefix,
-    bool unknowns)
-{
-  return load(extract(prefix), unknowns);
-}
-
-
-inline Try<Nothing> FlagsBase::load(
-    const Option<std::string>& prefix,
-    int argc,
-    char** argv,
-    bool unknowns,
-    bool duplicates)
-{
-  std::map<std::string, Option<std::string> > values;
-
-  if (prefix.isSome()) {
-    values = extract(prefix.get());
-  }
-
-  // Read flags from the command line.
-  for (int i = 1; i < argc; i++) {
-    const std::string arg(argv[i]);
-
-    std::string name;
-    Option<std::string> value = None();
-    if (arg.find("--") == 0) {
-      size_t eq = arg.find_first_of("=");
-      if (eq == std::string::npos && arg.find("--no-") == 0) { // --no-name
-        name = arg.substr(2);
-      } else if (eq == std::string::npos) {                    // --name
-        name = arg.substr(2);
-      } else {                                                 // --name=value
-        name = arg.substr(2, eq - 2);
-        value = arg.substr(eq + 1);
-      }
-    }
-    name = strings::lower(name);
-
-    if (!duplicates) {
-      if (values.count(name) > 0 ||
-          (name.find("no-") == 0 && values.count(name.substr(3)) > 0)) {
-        return Error("Duplicate flag '" + name + "' on command line");
-      }
-    }
-
-    values[name] = value;
-  }
-
-  return load(values, unknowns);
-}
-
-
-inline Try<Nothing> FlagsBase::load(
-    const std::string& prefix,
-    int argc,
-    char** argv,
-    bool unknowns,
-    bool duplicates)
-{
-  return load(Option<std::string>::some(prefix),
-              argc,
-              argv,
-              unknowns,
-              duplicates);
-}
-
-
-inline Try<Nothing> FlagsBase::load(
-    const std::map<std::string, Option<std::string> >& values,
-    bool unknowns)
-{
-  std::map<std::string, Option<std::string> >::const_iterator iterator;
-
-  for (iterator = values.begin(); iterator != values.end(); ++iterator) {
-    const std::string& name = iterator->first;
-    const Option<std::string>& value = iterator->second;
-
-    if (flags.count(name) > 0) {
-      if (value.isSome()) {                        // --name=value
-        if (flags[name].boolean && value.get() == "") {
-          flags[name].loader(this, "true"); // Should never fail.
-        } else {
-          Try<Nothing> loader = flags[name].loader(this, value.get());
-          if (loader.isError()) {
-            return Error(
-                "Failed to load flag '" + name + "': " + loader.error());
-          }
-        }
-      } else {                                     // --name
-        if (flags[name].boolean) {
-          flags[name].loader(this, "true"); // Should never fail.
-        } else {
-          return Error(
-              "Failed to load non-boolean flag '" + name + "': Missing value");
-        }
-      }
-    } else if (name.find("no-") == 0) {
-      if (flags.count(name.substr(3)) > 0) {       // --no-name
-        if (flags[name.substr(3)].boolean) {
-          if (value.isNone() || value.get() == "") {
-            flags[name.substr(3)].loader(this, "false"); // Should never fail.
-          } else {
-            return Error(
-                "Failed to load boolean flag '" + name.substr(3) +
-                "' via '" + name + "' with value '" + value.get() + "'");
-          }
-        } else {
-          return Error(
-              "Failed to load non-boolean flag '" + name.substr(3) +
-              "' via '" + name + "'");
-        }
-      } else {
-        return Error(
-            "Failed to load unknown flag '" + name.substr(3) +
-            "' via '" + name + "'");
-      }
-    } else if (!unknowns) {
-      return Error("Failed to load unknown flag '" + name + "'");
-    }
-  }
-
-  return Nothing();
-}
-
-
-inline Try<Nothing> FlagsBase::load(
-    const std::map<std::string, std::string>& _values,
-    bool unknowns)
-{
-  std::map<std::string, Option<std::string> > values;
-  std::map<std::string, std::string>::const_iterator iterator;
-  for (iterator = _values.begin(); iterator != _values.end(); ++iterator) {
-    const std::string& name = iterator->first;
-    const std::string& value = iterator->second;
-    values[name] = Option<std::string>::some(value);
-  }
-  return load(values, unknowns);
-}
-
-
-inline std::string FlagsBase::usage() const
-{
-  const int PAD = 5;
-
-  std::string usage;
-
-  std::map<std::string, std::string> col1; // key -> col 1 string
-
-  // Construct string for the first column and store width of column.
-  size_t width = 0;
-
-  foreachvalue (const flags::Flag& flag, *this) {
-    if (flag.boolean) {
-      col1[flag.name] = "  --[no-]" + flag.name;
-    } else {
-      col1[flag.name] = "  --" + flag.name + "=VALUE";
-    }
-    width = std::max(width, col1[flag.name].size());
-  }
-
-  foreachvalue (const flags::Flag& flag, *this) {
-    std::string line = col1[flag.name];
-
-    std::string pad(PAD + width - line.size(), ' ');
-    line += pad;
-
-    size_t pos1 = 0, pos2 = 0;
-    pos2 = flag.help.find_first_of("\n\r", pos1);
-    line += flag.help.substr(pos1, pos2 - pos1) + "\n";
-    usage += line;
-
-    while (pos2 != std::string::npos) {  // Handle multi-line help strings.
-      line = "";
-      pos1 = pos2 + 1;
-      std::string pad2(PAD + width, ' ');
-      line += pad2;
-      pos2 = flag.help.find_first_of("\n\r", pos1);
-      line += flag.help.substr(pos1, pos2 - pos1) + "\n";
-      usage += line;
-    }
-  }
-  return usage;
-}
-
-} // namespace flags {
-
-#endif // __STOUT_FLAGS_FLAGS_HPP__