Mac deploy tool: make dylibs writeable when copying into app bundle, so they can...
authorGavin Andresen <gavinandresen@gmail.com>
Mon, 6 Feb 2012 14:32:35 +0000 (09:32 -0500)
committerGavin Andresen <gavinandresen@gmail.com>
Mon, 6 Feb 2012 14:33:13 +0000 (09:33 -0500)
contrib/macdeploy/macdeployqtplus

index 914edb7..e159f9b 100755 (executable)
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import subprocess, sys, re, os, shutil, os.path
+import subprocess, sys, re, os, shutil, stat, os.path
 from time import sleep
 from argparse import ArgumentParser
 
@@ -256,7 +256,11 @@ def copyFramework(framework, path, verbose):
     if verbose >= 3:
         print "Copied:", fromPath
         print " to:", toPath
-    
+
+    permissions = os.stat(toPath)
+    if not permissions.st_mode & stat.S_IWRITE:
+      os.chmod(toPath, permissions.st_mode | stat.S_IWRITE)
+
     if not framework.isDylib(): # Copy resources for real frameworks
         fromResourcesDir = framework.sourceResourcesDirectory
         if os.path.exists(fromResourcesDir):