summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-10-31 13:10:33 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-08-03 08:01:30 +0000
commitaabba72f7965e06e2e6ed960d8cf8078249dac8c (patch)
tree768cc4525b4c687dd3d722a28feddf9a030ee1e5
parentabb279ecda2b967343f55b581afd5f7428315900 (diff)
macdeployqt: Don't copy .prl files into the Resources folder
Since the prl files are now in the Resources folder for a framework, then we should avoid copying these as they are not needed in the deployed framework. Change-Id: I0c728a647784b3d770bdd289c6deb8ff3d5ec9bd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 819983972f3e8d7062c94d073b83ee7821a188ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/macdeployqt/shared/shared.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index a81a2f0d9..d75112643 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -640,7 +640,8 @@ QStringList getBinaryDependencies(const QString executablePath,
}
// copies everything _inside_ sourcePath to destinationPath
-bool recursiveCopy(const QString &sourcePath, const QString &destinationPath)
+bool recursiveCopy(const QString &sourcePath, const QString &destinationPath,
+ const QRegularExpression &ignoreRegExp = QRegularExpression())
{
if (!QDir(sourcePath).exists())
return false;
@@ -649,7 +650,10 @@ bool recursiveCopy(const QString &sourcePath, const QString &destinationPath)
LogNormal() << "copy:" << sourcePath << destinationPath;
QStringList files = QDir(sourcePath).entryList(QStringList() << "*", QDir::Files | QDir::NoDotAndDotDot);
+ const bool hasValidRegExp = ignoreRegExp.isValid();
foreach (QString file, files) {
+ if (hasValidRegExp && ignoreRegExp.match(file).hasMatch())
+ continue;
const QString fileSourcePath = sourcePath + "/" + file;
const QString fileDestinationPath = destinationPath + "/" + file;
copyFilePrintStatus(fileSourcePath, fileDestinationPath);
@@ -782,7 +786,9 @@ QString copyFramework(const FrameworkInfo &framework, const QString path)
// Copy Resouces/, Libraries/ and Helpers/
const QString resourcesSourcePath = framework.frameworkPath + "/Resources";
const QString resourcesDestianationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Resources";
- recursiveCopy(resourcesSourcePath, resourcesDestianationPath);
+ // Ignore *.prl files that are in the Resources directory
+ recursiveCopy(resourcesSourcePath, resourcesDestianationPath,
+ QRegularExpression("\\A(?:[^/]*\\.prl)\\z"));
const QString librariesSourcePath = framework.frameworkPath + "/Libraries";
const QString librariesDestianationPath = frameworkDestinationDirectory + "/Versions/" + framework.version + "/Libraries";
bool createdLibraries = recursiveCopy(librariesSourcePath, librariesDestianationPath);