only call mkdir on !empty stuff that does not exist.

removes systrace warnings. reported by ajacoutout.
This commit is contained in:
espie 2007-06-16 13:01:37 +00:00
parent ce4da48631
commit 12c720e6cc
2 changed files with 21 additions and 10 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.10 2007/06/09 09:09:44 espie Exp $
# $OpenBSD: Makefile,v 1.11 2007/06/16 13:01:37 espie Exp $
HOMEPAGE= http://www.cmake.org/
CATEGORIES= devel
COMMENT= portable build system
DISTNAME= cmake-2.4.6
PKGNAME= ${DISTNAME}p5
PKGNAME= ${DISTNAME}p6
MASTER_SITES= ${HOMEPAGE}files/v2.4/
MAINTAINER= Marc Espie <espie@openbsd.org>

View File

@ -1,7 +1,18 @@
$OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp $
$OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.5 2007/06/16 13:01:37 espie Exp $
--- Source/kwsys/SystemTools.cxx.orig Wed Jan 10 18:59:15 2007
+++ Source/kwsys/SystemTools.cxx Sun Mar 18 13:52:03 2007
@@ -923,13 +923,14 @@ char* SystemTools::AppendStrings(const char* str1, con
+++ Source/kwsys/SystemTools.cxx Sat Jun 16 14:59:50 2007
@@ -361,7 +361,9 @@ bool SystemTools::MakeDirectory(const char* path)
while((pos = dir.find('/', pos)) != kwsys_stl::string::npos)
{
topdir = dir.substr(0, pos);
- Mkdir(topdir.c_str());
+ if (pos > 0 && !SystemTools::FileIsDirectory(topdir.c_str())) {
+ Mkdir(topdir.c_str());
+ }
pos++;
}
if(dir[dir.size()-1] == '/')
@@ -923,13 +925,14 @@ char* SystemTools::AppendStrings(const char* str1, con
return SystemTools::DuplicateString(str1);
}
size_t len1 = strlen(str1);
@ -19,7 +30,7 @@ $OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp
return newstr;
}
@@ -950,14 +951,15 @@ char* SystemTools::AppendStrings(
@@ -950,14 +953,15 @@ char* SystemTools::AppendStrings(
}
size_t len1 = strlen(str1), len2 = strlen(str2);
@ -39,7 +50,7 @@ $OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp
return newstr;
}
@@ -1125,8 +1127,10 @@ char* SystemTools::DuplicateString(const char* str)
@@ -1125,8 +1129,10 @@ char* SystemTools::DuplicateString(const char* str)
{
if (str)
{
@ -52,7 +63,7 @@ $OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp
}
return NULL;
}
@@ -1801,7 +1805,7 @@ bool SystemTools::ConvertDateMacroString(const char *s
@@ -1801,7 +1807,7 @@ bool SystemTools::ConvertDateMacroString(const char *s
static char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
char buffer[12];
@ -61,7 +72,7 @@ $OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp
buffer[3] = 0;
char *ptr = strstr(month_names, buffer);
@@ -1852,7 +1856,7 @@ bool SystemTools::ConvertTimeStampMacroString(const ch
@@ -1852,7 +1858,7 @@ bool SystemTools::ConvertTimeStampMacroString(const ch
static char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
char buffer[27];
@ -70,7 +81,7 @@ $OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.4 2007/03/20 11:23:10 espie Exp
buffer[7] = 0;
char *ptr = strstr(month_names, buffer + 4);
@@ -3291,12 +3295,12 @@ bool SystemTools::GetShortPath(const char* path, kwsys
@@ -3291,12 +3297,12 @@ bool SystemTools::GetShortPath(const char* path, kwsys
// if the path passed in has quotes around it, first remove the quotes
if (path[0] == '"' && path[strlen(path)-1] == '"')
{