summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-05-24 18:34:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-05-24 18:34:37 (GMT)
commita78acb2c82ee5eef46877146eaba962e9f3bb09f (patch)
treeec26efafdc9bf6420de6522e00594d2da34dd4ff
parentda1b6883253fc8426b41734e4b23d5839a510529 (diff)
parent0fb388c733e163e9e271f3f8f8abd386e0d63db1 (diff)
downloadCMake-a78acb2c82ee5eef46877146eaba962e9f3bb09f.zip
CMake-a78acb2c82ee5eef46877146eaba962e9f3bb09f.tar.gz
CMake-a78acb2c82ee5eef46877146eaba962e9f3bb09f.tar.bz2
Merge topic 'fix-cpack-osxx11-perms'
0fb388c Ensure executable files have executable permissions.
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 0e8cbc0..75ad640 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -21,6 +21,7 @@
#include <cmsys/SystemTools.hxx>
#include <cmsys/Glob.hxx>
+#include <sys/stat.h>
//----------------------------------------------------------------------
cmCPackOSXX11Generator::cmCPackOSXX11Generator()
@@ -135,6 +136,32 @@ int cmCPackOSXX11Generator::PackageFiles()
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 tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/hdiutilOutput.log";