ENH: use gnu tar for cygwin
This commit is contained in:
parent
bc2accc65e
commit
c693a23a7d
|
@ -228,11 +228,18 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
|
||||||
std::auto_ptr<char> realNamePtr(realName);
|
std::auto_ptr<char> realNamePtr(realName);
|
||||||
strcpy(realName, outFileName);
|
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,
|
if (tar_open(&t, realName,
|
||||||
&gztype,
|
&gztype,
|
||||||
flags, 0644,
|
flags, 0644,
|
||||||
(this->GeneratorVerbose?TAR_VERBOSE:0)
|
options) == -1)
|
||||||
| 0) == -1)
|
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
|
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
|
||||||
<< strerror(errno) << std::endl);
|
<< strerror(errno) << std::endl);
|
||||||
|
|
|
@ -174,12 +174,19 @@ int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName,
|
||||||
char* realName = new char[ strlen(outFileName) + 1 ];
|
char* realName = new char[ strlen(outFileName) + 1 ];
|
||||||
std::auto_ptr<char> realNamePtr(realName);
|
std::auto_ptr<char> realNamePtr(realName);
|
||||||
strcpy(realName, outFileName);
|
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,
|
if (tar_open(&t, realName,
|
||||||
&compressType,
|
&compressType,
|
||||||
flags, 0644,
|
flags, 0644,
|
||||||
(this->GeneratorVerbose?TAR_VERBOSE:0)
|
options) == -1)
|
||||||
| 0) == -1)
|
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
|
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
|
||||||
<< strerror(errno) << std::endl);
|
<< strerror(errno) << std::endl);
|
||||||
|
|
|
@ -1685,11 +1685,18 @@ bool cmSystemTools::CreateTar(const char* outFileName,
|
||||||
char* realName = new char[ strlen(outFileName) + 1 ];
|
char* realName = new char[ strlen(outFileName) + 1 ];
|
||||||
std::auto_ptr<char> realNamePtr(realName);
|
std::auto_ptr<char> realNamePtr(realName);
|
||||||
strcpy(realName, outFileName);
|
strcpy(realName, outFileName);
|
||||||
|
int options = 0;
|
||||||
|
if(verbose)
|
||||||
|
{
|
||||||
|
options |= TAR_VERBOSE;
|
||||||
|
}
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
options |= TAR_GNU;
|
||||||
|
#endif
|
||||||
if (tar_open(&t, realName,
|
if (tar_open(&t, realName,
|
||||||
(gzip? &gztype : NULL),
|
(gzip? &gztype : NULL),
|
||||||
O_WRONLY | O_CREAT, 0644,
|
O_WRONLY | O_CREAT, 0644,
|
||||||
(verbose?TAR_VERBOSE:0)
|
options) == -1)
|
||||||
| 0) == -1)
|
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
|
cmSystemTools::Error("Problem with tar_open(): ", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue