summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-07-31 02:51:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-07-31 02:51:21 (GMT)
commitc693a23a7d62c4db4303c3b755167bbc6a079a14 (patch)
tree379c4dbc4be91e6f662e164f1ed15a3761d1a34e
parentbc2accc65eb9c0808c78cd6c38a9349525600940 (diff)
downloadCMake-c693a23a7d62c4db4303c3b755167bbc6a079a14.zip
CMake-c693a23a7d62c4db4303c3b755167bbc6a079a14.tar.gz
CMake-c693a23a7d62c4db4303c3b755167bbc6a079a14.tar.bz2
ENH: use gnu tar for cygwin
-rw-r--r--Source/CPack/cmCPackTGZGenerator.cxx15
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.cxx13
-rw-r--r--Source/cmSystemTools.cxx11
3 files changed, 30 insertions, 9 deletions
diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx
index cafb0f5..4d5c470 100644
--- a/Source/CPack/cmCPackTGZGenerator.cxx
+++ b/Source/CPack/cmCPackTGZGenerator.cxx
@@ -228,11 +228,18 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName);
int flags = O_WRONLY | O_CREAT;
+ int options = 0;
+ if(this->GeneratorVerbose)
+ {
+ options |= TAR_VERBOSE;
+ }
+#ifdef __CYGWIN__
+ options |= TAR_GNU;
+#endif
if (tar_open(&t, realName,
- &gztype,
- flags, 0644,
- (this->GeneratorVerbose?TAR_VERBOSE:0)
- | 0) == -1)
+ &gztype,
+ flags, 0644,
+ options) == -1)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
<< strerror(errno) << std::endl);
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index b73e553..67a6a83 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -174,12 +174,19 @@ int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName,
char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName);
- int flags = O_WRONLY | O_CREAT;
+ int flags = O_WRONLY | O_CREAT;
+ int options = 0;
+ if(this->GeneratorVerbose)
+ {
+ options |= TAR_VERBOSE;
+ }
+#ifdef __CYGWIN__
+ options |= TAR_GNU;
+#endif
if (tar_open(&t, realName,
&compressType,
flags, 0644,
- (this->GeneratorVerbose?TAR_VERBOSE:0)
- | 0) == -1)
+ options) == -1)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
<< strerror(errno) << std::endl);
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5712291..d736fa2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1685,11 +1685,18 @@ bool cmSystemTools::CreateTar(const char* outFileName,
char* realName = new char[ strlen(outFileName) + 1 ];
std::auto_ptr<char> realNamePtr(realName);
strcpy(realName, outFileName);
+ int options = 0;
+ if(verbose)
+ {
+ options |= TAR_VERBOSE;
+ }
+#ifdef __CYGWIN__
+ options |= TAR_GNU;
+#endif
if (tar_open(&t, realName,
(gzip? &gztype : NULL),
O_WRONLY | O_CREAT, 0644,
- (verbose?TAR_VERBOSE:0)
- | 0) == -1)
+ options) == -1)
{
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
return false;