View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013826CMakeCMakepublic2013-01-01 14:282013-06-03 09:05
Reporterofir 
Assigned ToBrad King 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAnyOSLinuxOS Version
Product VersionCMake 2.8.10.1 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013826: Problem with creating installation directories conatining a colon (:)
DescriptionWhen running 'make install' with DESTDIR to a directory containing a colon, cmake won't create parent directories. If parent directories already exist everything works fine.
Steps To ReproduceWith any cmake project that has some install() command:

make install DESTDIR=aa/b:b
<error>
mkdir aa
make install DESTDIR=aa/b:b
<works>
Additional InformationThe MakeDirectory function in Source/kwsys/SystemTools.cxx parses the directory tree after the first colon it finds, probably to eliminate drive name in Windows environment, although no #ifdef is in sight.

Also, it seems that this code just below

  if(dir[dir.size()-1] == '/')
    {
    topdir = dir.substr(0, dir.size());
    }
  else
    {
    topdir = dir;
    }

does nothing.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0031958)
Brad King (manager)
2013-01-02 11:52

The SystemTools::MakeDirectory code was inherited long ago from another project and obviously wasn't reviewed in detail. The logic doesn't make sense. As you observe it looks like it's trying to handle Windows drive letters somehow but all it does is skip over slashes before the first ':'. Try this patch:

diff --git a/SystemTools.cxx b/SystemTools.cxx
index f915e56..9925640 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -622,11 +622,7 @@ bool SystemTools::MakeDirectory(const char* path)
     }
   SystemTools::ConvertToUnixSlashes(dir);
 
- kwsys_stl::string::size_type pos = dir.find(':');
- if(pos == kwsys_stl::string::npos)
- {
- pos = 0;
- }
+ kwsys_stl::string::size_type pos = 0;
   kwsys_stl::string topdir;
   while((pos = dir.find('/', pos)) != kwsys_stl::string::npos)
     {
@@ -634,14 +630,6 @@ bool SystemTools::MakeDirectory(const char* path)
     Mkdir(topdir.c_str());
     pos++;
     }
- if(dir[dir.size()-1] == '/')
- {
- topdir = dir.substr(0, dir.size());
- }
- else
- {
- topdir = dir;
- }
   if(Mkdir(topdir.c_str()) != 0)
     {
     // There is a bug in the Borland Run time library which makes MKDIR
--
1.7.10.4
(0031992)
Brad King (manager)
2013-01-07 09:57

Patch applied to KWSys upstream:

 http://public.kitware.com/gitweb?p=KWSys.git;a=commitdiff;h=cb5f835f [^]

and imported into CMake here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6969515b [^]
(0032003)
Brad King (manager)
2013-01-08 08:49

Dumb mistake in patch fixed here:

 http://public.kitware.com/gitweb?p=KWSys.git;a=commitdiff;h=34177aec [^]

and both patches re-imported into CMake here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=495fa24d [^]
(0033182)
Robert Maynard (manager)
2013-06-03 09:05

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-01-01 14:28 ofir New Issue
2013-01-02 11:52 Brad King Note Added: 0031958
2013-01-07 09:57 Brad King Note Added: 0031992
2013-01-07 09:57 Brad King Assigned To => Brad King
2013-01-07 09:57 Brad King Status new => resolved
2013-01-07 09:57 Brad King Resolution open => fixed
2013-01-07 09:57 Brad King Fixed in Version => CMake 2.8.11
2013-01-07 09:57 Brad King Target Version => CMake 2.8.11
2013-01-08 08:49 Brad King Note Added: 0032003
2013-06-03 09:05 Robert Maynard Note Added: 0033182
2013-06-03 09:05 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team