Merge topic 'fix-cpack-osxx11-perms'
0fb388c
Ensure executable files have executable permissions.
This commit is contained in:
commit
a78acb2c82
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <cmsys/SystemTools.hxx>
|
#include <cmsys/SystemTools.hxx>
|
||||||
#include <cmsys/Glob.hxx>
|
#include <cmsys/Glob.hxx>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
cmCPackOSXX11Generator::cmCPackOSXX11Generator()
|
cmCPackOSXX11Generator::cmCPackOSXX11Generator()
|
||||||
|
@ -135,6 +136,32 @@ int cmCPackOSXX11Generator::PackageFiles()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Two of the files need to have execute permission, so ensure they do:
|
||||||
|
std::string runTimeScript = dir;
|
||||||
|
runTimeScript += "/";
|
||||||
|
runTimeScript += "RuntimeScript";
|
||||||
|
|
||||||
|
std::string appScriptName = appdir;
|
||||||
|
appScriptName += "/";
|
||||||
|
appScriptName += this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
|
|
||||||
|
mode_t mode;
|
||||||
|
if (cmsys::SystemTools::GetPermissions(runTimeScript.c_str(), mode))
|
||||||
|
{
|
||||||
|
mode |= (S_IXUSR | S_IXGRP | S_IXOTH);
|
||||||
|
cmsys::SystemTools::SetPermissions(runTimeScript.c_str(), mode);
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Setting: " << runTimeScript
|
||||||
|
<< " to permission: " << mode << std::endl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmsys::SystemTools::GetPermissions(appScriptName.c_str(), mode))
|
||||||
|
{
|
||||||
|
mode |= (S_IXUSR | S_IXGRP | S_IXOTH);
|
||||||
|
cmsys::SystemTools::SetPermissions(appScriptName.c_str(), mode);
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Setting: " << appScriptName
|
||||||
|
<< " to permission: " << mode << std::endl);
|
||||||
|
}
|
||||||
|
|
||||||
std::string output;
|
std::string output;
|
||||||
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
|
||||||
tmpFile += "/hdiutilOutput.log";
|
tmpFile += "/hdiutilOutput.log";
|
||||||
|
|
Loading…
Reference in New Issue