[Cmake-commits] CMake branch, master, updated. v3.14.0-437-g23a84ac

Kitware Robot kwrobot at kitware.com
Wed Mar 20 11:33:09 EDT 2019


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, master has been updated
       via  23a84ac99006043338ce41bf68314e31ababf6dc (commit)
       via  b52d9d69603fa430750fe3528aef2400f5edcda2 (commit)
       via  a13a5c948e3e530716efaae0f56d9d9766c5d315 (commit)
      from  51f3a76ab23fda217e61f0d2a53272836897717f (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23a84ac99006043338ce41bf68314e31ababf6dc
commit 23a84ac99006043338ce41bf68314e31ababf6dc
Merge: 51f3a76 b52d9d6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 20 15:32:01 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 20 11:32:12 2019 -0400

    Merge topic 'dedup-path-normalization'
    
    b52d9d6960 cmSystemTools: Drop unused CollapseCombinedPath method
    a13a5c948e Replace use of CollapseCombinedPath with CollapseFullPath
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: Sebastian Holtermann <sebholt at xwmw.org>
    Merge-request: !3117


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b52d9d69603fa430750fe3528aef2400f5edcda2
commit b52d9d69603fa430750fe3528aef2400f5edcda2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 19 10:00:08 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 19 10:00:08 2019 -0400

    cmSystemTools: Drop unused CollapseCombinedPath method
    
    All call sites have been converted to `CollapseFullPath`, so the
    now-unused `CollapseCombinedPath` can be removed.
    
    Fixes: #19050

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d762106..1e30912 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1510,36 +1510,6 @@ std::string cmSystemTools::ForceToRelativePath(std::string const& local_path,
   return relative;
 }
 
-std::string cmSystemTools::CollapseCombinedPath(std::string const& dir,
-                                                std::string const& file)
-{
-  if (dir.empty() || dir == ".") {
-    return file;
-  }
-
-  std::vector<std::string> dirComponents;
-  std::vector<std::string> fileComponents;
-  cmSystemTools::SplitPath(dir, dirComponents);
-  cmSystemTools::SplitPath(file, fileComponents);
-
-  if (fileComponents.empty()) {
-    return dir;
-  }
-  if (!fileComponents[0].empty()) {
-    // File is not a relative path.
-    return file;
-  }
-
-  std::vector<std::string>::iterator i = fileComponents.begin() + 1;
-  while (i != fileComponents.end() && *i == ".." && dirComponents.size() > 1) {
-    ++i;                      // Remove ".." file component.
-    dirComponents.pop_back(); // Remove last dir component.
-  }
-
-  dirComponents.insert(dirComponents.end(), i, fileComponents.end());
-  return cmSystemTools::JoinPath(dirComponents);
-}
-
 #ifdef CMAKE_BUILD_WITH_CMAKE
 bool cmSystemTools::UnsetEnv(const char* value)
 {
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 60e8c18..b5f65c7 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -374,12 +374,6 @@ public:
   static std::string ForceToRelativePath(std::string const& local_path,
                                          std::string const& remote_path);
 
-  /** Joins two paths while collapsing x/../ parts
-   * For example CollapseCombinedPath("a/b/c", "../../d") results in "a/d"
-   */
-  static std::string CollapseCombinedPath(std::string const& dir,
-                                          std::string const& file);
-
 #ifdef CMAKE_BUILD_WITH_CMAKE
   /** Remove an environment variable */
   static bool UnsetEnv(const char* value);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a13a5c948e3e530716efaae0f56d9d9766c5d315
commit a13a5c948e3e530716efaae0f56d9d9766c5d315
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 19 09:56:04 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 19 09:57:23 2019 -0400

    Replace use of CollapseCombinedPath with CollapseFullPath
    
    `CollapseCombinedPath` was introduced by commit 551d3343cd (cmDependsC:
    Collapse relative include paths, 2013-06-19, v2.8.12~237^2) where the
    existing `CollapseFullPath` should have been used instead.  Then its use
    proliferated slightly.  Since `CollapseCombinedPath` is less widely used
    and less robust (see issue #19049), use `CollapseFullPath` everywhere
    instead.
    
    Issue: #19050

diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 635de49..cfb5efd 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -195,7 +195,7 @@ bool DebGenerator::generateDataTar() const
       // XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
       // should not add XXX/application
       orderedFiles.insert(currentPath);
-      currentPath = cmSystemTools::CollapseCombinedPath(currentPath, "..");
+      currentPath = cmSystemTools::CollapseFullPath("..", currentPath);
     }
   }
 
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index fcf8af1..dd8127d 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -325,8 +325,7 @@ int cmCPackFreeBSDGenerator::PackageFiles()
                              ONE_PACKAGE_PER_COMPONENT);
   }
 
-  std::string output_dir =
-    cmSystemTools::CollapseCombinedPath(toplevel, "../");
+  std::string output_dir = cmSystemTools::CollapseFullPath("../", toplevel);
   pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(),
                            manifestname.c_str(), nullptr);
 
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 58b4ebb..7b78767 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -150,7 +150,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
             // Construct the name of the file as if it were in the current
             // include directory.  Avoid using a leading "./".
             std::string tmpPath =
-              cmSystemTools::CollapseCombinedPath(iPath, current.FileName);
+              cmSystemTools::CollapseFullPath(current.FileName, iPath);
 
             // Look for the file in this location.
             if (cmSystemTools::FileExists(tmpPath, true)) {
@@ -362,7 +362,7 @@ void cmDependsC::Scan(std::istream& is, const std::string& directory,
         // must check for the file in the directory containing the
         // file we are scanning.
         entry.QuotedLocation =
-          cmSystemTools::CollapseCombinedPath(directory, entry.FileName);
+          cmSystemTools::CollapseFullPath(entry.FileName, directory);
       }
 
       // Queue the file if it has not yet been encountered and it
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 9f8f12b..c73ec70 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -287,7 +287,7 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLine(std::ostream& fout,
     if (l.compare(0, 2, "-l") == 0) {
       fout << "    \"" << l << "\"" << std::endl;
     } else {
-      std::string rl = cmSystemTools::CollapseCombinedPath(cbd, l);
+      std::string rl = cmSystemTools::CollapseFullPath(l, cbd);
       fout << "    -l\"" << rl << "\"" << std::endl;
     }
   }
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 4f1d06a..dba9afa 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -185,8 +185,7 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
     }
   } else {
     std::string tryPath;
-    /* CollapseCombinedPath will check if ts is an absolute path */
-    tryPath = cmSystemTools::CollapseCombinedPath(tsd, ts);
+    tryPath = cmSystemTools::CollapseFullPath(ts, tsd);
     if (!cmSystemTools::FileExists(tryPath)) {
       std::string msg = "GHS toolset \"" + tryPath + "\" not found.";
       cmSystemTools::Error(msg);
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 022947f..87ef112 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -309,7 +309,7 @@ void cmQtAutoGen::RccListConvertFullPath(std::string const& qrcFileDir,
                                          std::vector<std::string>& files)
 {
   for (std::string& entry : files) {
-    std::string tmp = cmSystemTools::CollapseCombinedPath(qrcFileDir, entry);
+    std::string tmp = cmSystemTools::CollapseFullPath(entry, qrcFileDir);
     entry = std::move(tmp);
   }
 }
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index af50c1d..a1abd3f 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -158,11 +158,11 @@ std::string cmQtAutoGenerator::FileSystem::GetRealPath(
   return cmSystemTools::GetRealPath(filename);
 }
 
-std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath(
-  std::string const& dir, std::string const& file)
+std::string cmQtAutoGenerator::FileSystem::CollapseFullPath(
+  std::string const& file, std::string const& dir)
 {
   std::lock_guard<std::mutex> lock(Mutex_);
-  return cmSystemTools::CollapseCombinedPath(dir, file);
+  return cmSystemTools::CollapseFullPath(file, dir);
 }
 
 void cmQtAutoGenerator::FileSystem::SplitPath(
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 6771dd8..b55bebc 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -77,9 +77,9 @@ public:
     // -- Paths
     /// @brief Wrapper for cmSystemTools::GetRealPath
     std::string GetRealPath(std::string const& filename);
-    /// @brief Wrapper for cmSystemTools::CollapseCombinedPath
-    std::string CollapseCombinedPath(std::string const& dir,
-                                     std::string const& file);
+    /// @brief Wrapper for cmSystemTools::CollapseFullPath
+    std::string CollapseFullPath(std::string const& file,
+                                 std::string const& dir);
     /// @brief Wrapper for cmSystemTools::SplitPath
     void SplitPath(const std::string& p, std::vector<std::string>& components,
                    bool expand_home_dir = true);
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index b02cd44..cb6f7ea 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -27,7 +27,7 @@
 std::string cmQtAutoGeneratorMocUic::BaseSettingsT::AbsoluteBuildPath(
   std::string const& relativePath) const
 {
-  return FileSys->CollapseCombinedPath(AutogenBuildDir, relativePath);
+  return FileSys->CollapseFullPath(relativePath, AutogenBuildDir);
 }
 
 /**

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

Summary of changes:
 Source/CPack/cmCPackDebGenerator.cxx     |  2 +-
 Source/CPack/cmCPackFreeBSDGenerator.cxx |  3 +--
 Source/cmDependsC.cxx                    |  4 ++--
 Source/cmGhsMultiTargetGenerator.cxx     |  2 +-
 Source/cmGlobalGhsMultiGenerator.cxx     |  3 +--
 Source/cmQtAutoGen.cxx                   |  2 +-
 Source/cmQtAutoGenerator.cxx             |  6 +++---
 Source/cmQtAutoGenerator.h               |  6 +++---
 Source/cmQtAutoGeneratorMocUic.cxx       |  2 +-
 Source/cmSystemTools.cxx                 | 30 ------------------------------
 Source/cmSystemTools.h                   |  6 ------
 11 files changed, 14 insertions(+), 52 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list