Merge topic 'CPack-fixSTGZpermission-bug13046'

4576f40 CPack STGZ put execute permission on all packages files (component case)
This commit is contained in:
Brad King 2012-03-19 14:41:56 -04:00 committed by CMake Topic Stage
commit 1df15c68d5
1 changed files with 18 additions and 7 deletions

View File

@ -54,21 +54,32 @@ int cmCPackSTGZGenerator::InitializeInternal()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackSTGZGenerator::PackageFiles() int cmCPackSTGZGenerator::PackageFiles()
{ {
bool retval = true;
if ( !this->Superclass::PackageFiles() ) if ( !this->Superclass::PackageFiles() )
{ {
return 0; return 0;
} }
return cmSystemTools::SetPermissions(packageFileNames[0].c_str(),
/* TGZ generator (our Superclass) may
* have generated several packages (component packaging)
* so we must iterate over generated packages.
*/
for (std::vector<std::string>::iterator it=packageFileNames.begin();
it != packageFileNames.end(); ++it)
{
retval &= cmSystemTools::SetPermissions((*it).c_str(),
#if defined( _MSC_VER ) || defined( __MINGW32__ ) #if defined( _MSC_VER ) || defined( __MINGW32__ )
S_IREAD | S_IWRITE | S_IEXEC S_IREAD | S_IWRITE | S_IEXEC
#elif defined( __BORLANDC__ ) #elif defined( __BORLANDC__ )
S_IRUSR | S_IWUSR | S_IXUSR S_IRUSR | S_IWUSR | S_IXUSR
#else #else
S_IRUSR | S_IWUSR | S_IXUSR | S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IWGRP | S_IXGRP | S_IRGRP | S_IWGRP | S_IXGRP |
S_IROTH | S_IWOTH | S_IXOTH S_IROTH | S_IWOTH | S_IXOTH
#endif #endif
); );
}
return retval;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------