[Cmake-commits] CMake branch, next, updated. v3.0.1-5183-g8cd8f3c

Brad King brad.king at kitware.com
Mon Sep 8 08:34:25 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  8cd8f3cf2ae8541b3d49e4c8b5f83d8d215de0d9 (commit)
       via  c2ad11ebb8da5004b729c988137a9d25e6178b90 (commit)
       via  7c7b247ec65e2f0a25c7b79ae247e808e10706d6 (commit)
       via  1251c1c8c50fccbd73b48cf8b13b3432845fc320 (commit)
       via  c4f447aec9f94684aacd2f55eb961237b31351e8 (commit)
       via  1fa2f43c2b9f2d5148f10b3a74d18e2ff79ed70c (commit)
       via  ff1fddb0bf40b8a7170d54ccdc9420c2d7190472 (commit)
      from  32480abdc3be86fedbfd3c5eff3994e9631c2e71 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8cd8f3cf2ae8541b3d49e4c8b5f83d8d215de0d9
commit 8cd8f3cf2ae8541b3d49e4c8b5f83d8d215de0d9
Merge: 32480ab c2ad11e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 8 08:34:24 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 8 08:34:24 2014 -0400

    Merge topic 'update-kwsys' into next
    
    c2ad11eb Merge branch 'upstream-kwsys' into update-kwsys
    7c7b247e KWSys 2014-09-05 (93eb1a1f)
    1251c1c8 CMake Nightly Date Stamp
    c4f447ae CMake Nightly Date Stamp
    1fa2f43c CMake Nightly Date Stamp
    ff1fddb0 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2ad11ebb8da5004b729c988137a9d25e6178b90
commit c2ad11ebb8da5004b729c988137a9d25e6178b90
Merge: 1251c1c 7c7b247
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 8 08:35:18 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 8 08:35:18 2014 -0400

    Merge branch 'upstream-kwsys' into update-kwsys


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c7b247ec65e2f0a25c7b79ae247e808e10706d6
commit 7c7b247ec65e2f0a25c7b79ae247e808e10706d6
Author:     KWSys Robot <kwrobot at kitware.com>
AuthorDate: Fri Sep 5 22:51:00 2014 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 8 08:35:13 2014 -0400

    KWSys 2014-09-05 (93eb1a1f)
    
    Extract upstream KWSys using the following shell commands.
    
    $ git archive --prefix=upstream-kwsys/ 93eb1a1f | tar x
    $ git shortlog --no-merges --abbrev=8 --format='%h %s' 32023afd..93eb1a1f
    Clinton Stimpson (1):
          93eb1a1f SystemTools: Improve RelativePath() to handle ./ ../ and //
    
    Change-Id: I4cc94e6c2678adf0c3adc54a5ae8613531cbc395

diff --git a/SystemTools.cxx b/SystemTools.cxx
index e34bb43..87fdfbe 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -3425,9 +3425,12 @@ kwsys_stl::string SystemTools::RelativePath(const kwsys_stl::string& local, cons
     return "";
     }
 
+  kwsys_stl::string l = SystemTools::CollapseFullPath(local);
+  kwsys_stl::string r = SystemTools::CollapseFullPath(remote);
+
   // split up both paths into arrays of strings using / as a separator
-  kwsys_stl::vector<kwsys::String> localSplit = SystemTools::SplitString(local, '/', true);
-  kwsys_stl::vector<kwsys::String> remoteSplit = SystemTools::SplitString(remote, '/', true);
+  kwsys_stl::vector<kwsys::String> localSplit = SystemTools::SplitString(l, '/', true);
+  kwsys_stl::vector<kwsys::String> remoteSplit = SystemTools::SplitString(r, '/', true);
   kwsys_stl::vector<kwsys::String> commonPath; // store shared parts of path in this array
   kwsys_stl::vector<kwsys::String> finalPath;  // store the final relative path here
   // count up how many matching directory names there are from the start
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 04ab4fc..a7cfa0d 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -562,6 +562,33 @@ static bool CheckEnvironmentOperations()
   return res;
 }
 
+
+static bool CheckRelativePath(
+  const kwsys_stl::string& local,
+  const kwsys_stl::string& remote,
+  const kwsys_stl::string& expected)
+{
+  kwsys_stl::string result = kwsys::SystemTools::RelativePath(local, remote);
+  if(expected != result)
+    {
+    kwsys_ios::cerr << "RelativePath(" << local << ", " << remote
+      << ")  yielded " << result << " instead of " << expected << kwsys_ios::endl;
+    return false;
+    }
+  return true;
+}
+
+static bool CheckRelativePaths()
+{
+  bool res = true;
+  res &= CheckRelativePath("/usr/share", "/bin/bash", "../../bin/bash");
+  res &= CheckRelativePath("/usr/./share/", "/bin/bash", "../../bin/bash");
+  res &= CheckRelativePath("/usr//share/", "/bin/bash", "../../bin/bash");
+  res &= CheckRelativePath("/usr/share/../bin/", "/bin/bash", "../../bin/bash");
+  res &= CheckRelativePath("/usr/share", "/usr/share//bin", "bin");
+  return res;
+}
+
 //----------------------------------------------------------------------------
 int testSystemTools(int, char*[])
 {
@@ -593,5 +620,7 @@ int testSystemTools(int, char*[])
 
   res &= CheckEnvironmentOperations();
 
+  res &= CheckRelativePaths();
+
   return res ? 0 : 1;
 }

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeVersion.cmake        |    2 +-
 Source/kwsys/SystemTools.cxx     |    7 +++++--
 Source/kwsys/testSystemTools.cxx |   29 +++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list