From 7ed6da23127c77036b6f033144b8b8853f12d52c Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 4 Jan 2012 09:41:10 -0800 Subject: [PATCH] Ensure framework binaries are writable when copied by macdeployqt The macdeployqt tool doesn't make sure that the Qt framework binaries it copies into a mac app bundle are writable, thus changing the install names fails. This patch ensures that the binaries it copies are writable by the user --- tools/macdeployqt/shared/shared.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp index 156f1de..da879bb 100644 --- a/tools/macdeployqt/shared/shared.cpp +++ b/tools/macdeployqt/shared/shared.cpp @@ -93,6 +93,17 @@ bool copyFilePrintStatus(const QString &from, const QString &to) if (QFile::copy(from, to)) { LogNormal() << " copied:" << from; LogNormal() << " to" << to; + + QFile toFile(to); + if(!(toFile.permissions() & QFile::WriteOwner) ) + { + if(!toFile.setPermissions(toFile.permissions() | QFile::WriteOwner)) + { + LogError() << "Failed to set u+w permissions on target file: " << to; + return false; + } + } + return true; } else { LogError() << "file copy failed from" << from; -- 1.7.8.2