diff options
author | Timothée Keller <timothee.keller@qt.io> | 2023-01-16 16:15:24 +0100 |
---|---|---|
committer | Timothée Keller <timothee.keller@qt.io> | 2023-03-24 10:09:56 +0100 |
commit | 4e5ced054d7a2400cf5b959bf2b71e8fd1a91761 (patch) | |
tree | f5888a00e359c4ae1cfbf91fbab1d3e64fc23f2a /src/tools/windeployqt/main.cpp | |
parent | 8902bc635629819a7fabb9a9aee22b2480684d42 (diff) |
Windeployqt: prevent directory creation for dryruns
Added a check for dryruns when creating directories, to properly
reflect expected behavior.
Pick-to: 6.5
Change-Id: I72063e4d32302d304f8174701e38e275b404706b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/tools/windeployqt/main.cpp')
-rw-r--r-- | src/tools/windeployqt/main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index ddd01724c0..bb661f6fcd 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -1494,7 +1494,7 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString> const QString targetPath = options.qmlDirectory.isEmpty() ? options.directory + QStringLiteral("/qml") : options.qmlDirectory; - if (!createDirectory(targetPath, errorMessage)) + if (!createDirectory(targetPath, errorMessage, options.dryRun)) return result; for (const QmlImportScanResult::Module &module : std::as_const(qmlScanResult.modules)) { const QString installPath = module.installPath(targetPath); @@ -1502,7 +1502,7 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString> std::wcout << "Installing: '" << module.name << "' from " << module.sourcePath << " to " << QDir::toNativeSeparators(installPath) << '\n'; - if (installPath != targetPath && !createDirectory(installPath, errorMessage)) + if (installPath != targetPath && !createDirectory(installPath, errorMessage, options.dryRun)) return result; unsigned updateFileFlags = options.updateFileFlags | SkipQmlDesignerSpecificsDirectories; @@ -1519,7 +1519,7 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString> } // optQuickImports if (options.translations) { - if (!options.dryRun && !createDirectory(options.translationsDirectory, errorMessage)) + if (!createDirectory(options.translationsDirectory, errorMessage, options.dryRun)) return result; if (!deployTranslations(qtpathsVariables.value(QStringLiteral("QT_INSTALL_TRANSLATIONS")), result.deployedQtLibraries, options.translationsDirectory, options, @@ -1567,7 +1567,7 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qtpathsVariables, const QString resourcesSourceDir = qtpathsVariables.value(QStringLiteral("QT_INSTALL_DATA")) + resourcesSubDir + u'/'; const QString resourcesTargetDir(options.directory + resourcesSubDir); - if (!createDirectory(resourcesTargetDir, errorMessage)) + if (!createDirectory(resourcesTargetDir, errorMessage, options.dryRun)) return false; for (auto installDataFile : installDataFiles) { if (!updateFile(resourcesSourceDir + QLatin1StringView(installDataFile), @@ -1584,7 +1584,7 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qtpathsVariables, } if (options.translations) { // Copy the whole translations directory. - return createDirectory(options.translationsDirectory, errorMessage) + return createDirectory(options.translationsDirectory, errorMessage, options.dryRun) && updateFile(translations.absoluteFilePath(), options.translationsDirectory, options.updateFileFlags, options.json, errorMessage); } @@ -1597,7 +1597,7 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qtpathsVariables, } const QString webEngineTranslationsDir = options.translationsDirectory + u'/' + translations.fileName(); - if (!createDirectory(webEngineTranslationsDir, errorMessage)) + if (!createDirectory(webEngineTranslationsDir, errorMessage, options.dryRun)) return false; return updateFile(enUSpak.absoluteFilePath(), webEngineTranslationsDir, options.updateFileFlags, options.json, errorMessage); @@ -1677,12 +1677,12 @@ int main(int argc, char **argv) } // Create directories - if (!createDirectory(options.directory, &errorMessage)) { + if (!createDirectory(options.directory, &errorMessage, options.dryRun)) { std::wcerr << errorMessage << '\n'; return 1; } if (!options.libraryDirectory.isEmpty() && options.libraryDirectory != options.directory - && !createDirectory(options.libraryDirectory, &errorMessage)) { + && !createDirectory(options.libraryDirectory, &errorMessage, options.dryRun)) { std::wcerr << errorMessage << '\n'; return 1; } |