mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-30 03:34:34 +00:00
Merge pull request #810 from QuasarApp/allow_hiden_files
Added support of hiden files
This commit is contained in:
commit
ae74b8f133
@ -28,7 +28,7 @@ bool Deb::deployTemplate(PackageControl &pkg) {
|
|||||||
QuasarAppUtils::Params::log("Using custom template for debian pacakge: " + customTemplate,
|
QuasarAppUtils::Params::log("Using custom template for debian pacakge: " + customTemplate,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
auto availablePacakages = QDir(customTemplate).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
auto availablePacakages = QDir(customTemplate).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto& pkg: availablePacakages) {
|
for (const auto& pkg: availablePacakages) {
|
||||||
pakcagesTemplates.insert(pkg.fileName(), pkg.absoluteFilePath());
|
pakcagesTemplates.insert(pkg.fileName(), pkg.absoluteFilePath());
|
||||||
|
@ -108,7 +108,7 @@ bool iDistribution::unpackDir(const QString &resource,
|
|||||||
|
|
||||||
|
|
||||||
QDir res(resource);
|
QDir res(resource);
|
||||||
auto list = res.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries);
|
auto list = res.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto & item :list) {
|
for (const auto & item :list) {
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ bool QIF::deployTemplate(PackageControl &pkg) {
|
|||||||
QuasarAppUtils::Params::log("Using custom template for installer: " + customTemplate,
|
QuasarAppUtils::Params::log("Using custom template for installer: " + customTemplate,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
auto availablePacakages = QDir(customTemplate + "/packages").entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
auto availablePacakages = QDir(customTemplate + "/packages").entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto& pkg: availablePacakages) {
|
for (const auto& pkg: availablePacakages) {
|
||||||
pakcagesTemplates.insert(pkg.fileName(), pkg.absoluteFilePath());
|
pakcagesTemplates.insert(pkg.fileName(), pkg.absoluteFilePath());
|
||||||
@ -237,7 +237,7 @@ QString QIF::location(const DistroModule &module) const {
|
|||||||
|
|
||||||
QString QIF::getStyle(const QString& input) const {
|
QString QIF::getStyle(const QString& input) const {
|
||||||
QDir resurces(":/Styles/Distributions/Templates/qif/Styles");
|
QDir resurces(":/Styles/Distributions/Templates/qif/Styles");
|
||||||
auto list = resurces.entryInfoList(QDir::Files);
|
auto list = resurces.entryInfoList(QDir::Files | QDir::Hidden);
|
||||||
for (const auto& style : list) {
|
for (const auto& style : list) {
|
||||||
if (input == style.baseName()) {
|
if (input == style.baseName()) {
|
||||||
QuasarAppUtils::Params::log(QString("Use the %0 installer style").arg(style.baseName()),
|
QuasarAppUtils::Params::log(QString("Use the %0 installer style").arg(style.baseName()),
|
||||||
|
@ -961,9 +961,9 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
|
|||||||
QFileInfoList list;
|
QFileInfoList list;
|
||||||
|
|
||||||
if (recursive) {
|
if (recursive) {
|
||||||
list = d.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
list = d.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
} else {
|
} else {
|
||||||
list = d.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
list = d.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -1639,7 +1639,7 @@ QSet<QString> ConfigParser::getSetDirsRecursive(const QString &path, int maxDepc
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto list = dir.entryInfoList(QDir::Dirs| QDir::NoDotAndDotDot);
|
auto list = dir.entryInfoList(QDir::Dirs| QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto &subDir: list) {
|
for (const auto &subDir: list) {
|
||||||
res.insert(subDir.absoluteFilePath());
|
res.insert(subDir.absoluteFilePath());
|
||||||
|
@ -646,7 +646,7 @@ bool DeployCore::isContainsArraySeparators(const QString &val, int lastLvl) {
|
|||||||
QString DeployCore::findProcess(const QString &env, const QString& proc, bool ignoreSymLinks) {
|
QString DeployCore::findProcess(const QString &env, const QString& proc, bool ignoreSymLinks) {
|
||||||
auto list = env.split(DeployCore::getEnvSeparator());
|
auto list = env.split(DeployCore::getEnvSeparator());
|
||||||
|
|
||||||
auto findEntries = QDir::NoDotAndDotDot | QDir::Files;
|
auto findEntries = QDir::NoDotAndDotDot | QDir::Files | QDir::Hidden;
|
||||||
if (ignoreSymLinks) {
|
if (ignoreSymLinks) {
|
||||||
findEntries = findEntries | QDir::NoSymLinks;
|
findEntries = findEntries | QDir::NoSymLinks;
|
||||||
}
|
}
|
||||||
@ -773,7 +773,7 @@ QString DeployCore::getVCredist(const QString &_qtbinDir) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
auto infoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
auto infoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
auto name = getMSVCName(msvc);
|
auto name = getMSVCName(msvc);
|
||||||
auto version = getMSVCVersion(msvc);
|
auto version = getMSVCVersion(msvc);
|
||||||
|
@ -133,7 +133,7 @@ QStringList Envirement::recursiveInvairement(QDir &dir, int depch, int depchLimi
|
|||||||
return {dir.absolutePath()};
|
return {dir.absolutePath()};
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
QStringList res = {};
|
QStringList res = {};
|
||||||
|
|
||||||
for (QFileInfo &i : list) {
|
for (QFileInfo &i : list) {
|
||||||
|
@ -357,7 +357,7 @@ bool Extracter::copyTranslations(const QStringList &list, const QString& package
|
|||||||
filters.push_back("*" + i + "*");
|
filters.push_back("*" + i + "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto listItems = dir.entryInfoList(filters, QDir::Files | QDir::NoDotAndDotDot);
|
auto listItems = dir.entryInfoList(filters, QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
auto targetPath = cnf->getTargetDir() + "/" + package;
|
||||||
auto distro = cnf->getDistroFromPackage(package);
|
auto distro = cnf->getDistroFromPackage(package);
|
||||||
@ -383,7 +383,7 @@ QFileInfoList Extracter::findFilesInsideDir(const QString &name,
|
|||||||
|
|
||||||
QDir dir(dirpath);
|
QDir dir(dirpath);
|
||||||
|
|
||||||
auto list = dir.entryInfoList( QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
auto list = dir.entryInfoList( QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto & item :list) {
|
for (const auto & item :list) {
|
||||||
if (item.isFile()) {
|
if (item.isFile()) {
|
||||||
@ -501,7 +501,7 @@ bool Extracter::extractQml() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (const auto& plugin: std::as_const(plugins)) {
|
for (const auto& plugin: std::as_const(plugins)) {
|
||||||
const auto qmlFiles = QDir(plugin).entryInfoList(QDir::Files);
|
const auto qmlFiles = QDir(plugin).entryInfoList(QDir::Files | QDir::Hidden);
|
||||||
for (const auto& qmlFile: qmlFiles) {
|
for (const auto& qmlFile: qmlFiles) {
|
||||||
toCopyQmlFiles.push_back(qmlFile.absoluteFilePath());
|
toCopyQmlFiles.push_back(qmlFile.absoluteFilePath());
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ bool FileManager::strip(const QString &dir) const {
|
|||||||
|
|
||||||
if (info.isDir()) {
|
if (info.isDir()) {
|
||||||
QDir d(dir);
|
QDir d(dir);
|
||||||
auto list = d.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
auto list = d.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
bool res = false;
|
bool res = false;
|
||||||
for (const auto &i : list) {
|
for (const auto &i : list) {
|
||||||
@ -298,7 +298,7 @@ bool FileManager::copyFolder(const QString &from,
|
|||||||
|
|
||||||
QDir fromDir(from);
|
QDir fromDir(from);
|
||||||
|
|
||||||
auto list = fromDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries);
|
auto list = fromDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto &item : list) {
|
for (const auto &item : list) {
|
||||||
if (item.isDir()) {
|
if (item.isDir()) {
|
||||||
@ -402,7 +402,7 @@ bool FileManager::moveFolder(const QString &from, const QString &to, const QStri
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDir dir(from);
|
QDir dir(from);
|
||||||
auto list = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
auto list = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
for (const auto &i :list) {
|
for (const auto &i :list) {
|
||||||
auto targetDir = to;
|
auto targetDir = to;
|
||||||
if (i.isDir()) {
|
if (i.isDir()) {
|
||||||
|
@ -153,7 +153,7 @@ bool PluginsParser::scan(const QString& pluginPath,
|
|||||||
DeployCore::QtModule qtModules,
|
DeployCore::QtModule qtModules,
|
||||||
const QString& package) {
|
const QString& package) {
|
||||||
|
|
||||||
auto plugins = QDir(pluginPath).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
auto plugins = QDir(pluginPath).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
for (const auto &plugin: plugins) {
|
for (const auto &plugin: plugins) {
|
||||||
scanPluginGroup(plugin, resDependencies, package, qtModules);
|
scanPluginGroup(plugin, resDependencies, package, qtModules);
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ void PluginsParser::addPlugins(const QStringList& list, const QString& package,
|
|||||||
|
|
||||||
for (const auto &plugin: std::as_const(list)) {
|
for (const auto &plugin: std::as_const(list)) {
|
||||||
if (QFileInfo(cnf->qtDir.getPlugins() + "/" + plugin).isDir()) {
|
if (QFileInfo(cnf->qtDir.getPlugins() + "/" + plugin).isDir()) {
|
||||||
auto listPlugins = QDir(cnf->qtDir.getPlugins() + "/" + plugin).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
auto listPlugins = QDir(cnf->qtDir.getPlugins() + "/" + plugin).entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto &plugin: listPlugins) {
|
for (const auto &plugin: listPlugins) {
|
||||||
container[package].insert(getPluginNameFromFile( plugin.baseName()));
|
container[package].insert(getPluginNameFromFile( plugin.baseName()));
|
||||||
@ -211,7 +211,7 @@ void PluginsParser::scanPlatforms(const QString& package, QList<QString>& disabl
|
|||||||
auto platform = cnf->getPlatform(package);
|
auto platform = cnf->getPlatform(package);
|
||||||
|
|
||||||
QString platformPluginPath = cnf->qtDir.getPlugins() + "/platforms";
|
QString platformPluginPath = cnf->qtDir.getPlugins() + "/platforms";
|
||||||
auto plugins = QDir(platformPluginPath).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
auto plugins = QDir(platformPluginPath).entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
|
|
||||||
for (const auto &plugin: plugins) {
|
for (const auto &plugin: plugins) {
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ void PluginsParser::scanPluginGroup(const QFileInfo& plugin,
|
|||||||
const QString &package,
|
const QString &package,
|
||||||
DeployCore::QtModule qtModules) const {
|
DeployCore::QtModule qtModules) const {
|
||||||
|
|
||||||
auto plugins = QDir(plugin.absoluteFilePath()).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
auto plugins = QDir(plugin.absoluteFilePath()).entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
auto groupModule = qtModuleForPluginGroup(plugin.fileName());
|
auto groupModule = qtModuleForPluginGroup(plugin.fileName());
|
||||||
|
|
||||||
for (const auto& info: plugins) {
|
for (const auto& info: plugins) {
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
<file alias="qmlFile.qml">testRes/qml/Scene</file>
|
<file alias="qmlFile.qml">testRes/qml/Scene</file>
|
||||||
<file alias="qmlFileQt6.qml">testRes/qml/SceneQt6</file>
|
<file alias="qmlFileQt6.qml">testRes/qml/SceneQt6</file>
|
||||||
<file alias="qmlDir">testRes/qml/qmldir</file>
|
<file alias="qmlDir">testRes/qml/qmldir</file>
|
||||||
|
<file>testRes/.hidenAssets/win64/.mingw/cqtdeployer.exe</file>
|
||||||
|
<file>testRes/.hidenAssets/win64/.mingw/.Deploy.dll</file>
|
||||||
|
<file>testRes/.hidenAssets/win64/msvc/lib.dll</file>
|
||||||
|
<file>testRes/.hidenAssets/win64/msvc/exe.exe</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/testResurces">
|
<qresource prefix="/testResurces">
|
||||||
<file>testRes/TestQMLWidgets.sh</file>
|
<file>testRes/TestQMLWidgets.sh</file>
|
||||||
|
BIN
tests/testRes/.hidenAssets/win64/.mingw/.Deploy.dll
Normal file
BIN
tests/testRes/.hidenAssets/win64/.mingw/.Deploy.dll
Normal file
Binary file not shown.
BIN
tests/testRes/.hidenAssets/win64/.mingw/cqtdeployer.exe
Normal file
BIN
tests/testRes/.hidenAssets/win64/.mingw/cqtdeployer.exe
Normal file
Binary file not shown.
BIN
tests/testRes/.hidenAssets/win64/msvc/exe.exe
Executable file
BIN
tests/testRes/.hidenAssets/win64/msvc/exe.exe
Executable file
Binary file not shown.
BIN
tests/testRes/.hidenAssets/win64/msvc/lib.dll
Normal file
BIN
tests/testRes/.hidenAssets/win64/msvc/lib.dll
Normal file
Binary file not shown.
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include "extradependstest.h"
|
#include "extradependstest.h"
|
||||||
|
#include "hidenfilestest.h"
|
||||||
|
|
||||||
#include "allowemptypackagestest.h"
|
#include "allowemptypackagestest.h"
|
||||||
#include "binprefixtest.h"
|
#include "binprefixtest.h"
|
||||||
@ -102,6 +103,7 @@ private slots:
|
|||||||
|
|
||||||
// main tests works on linux only
|
// main tests works on linux only
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
|
TestCase(hidenFilesTest, HidenFilesTest)
|
||||||
TestCase(extraDependsTest, ExtraDependsTest)
|
TestCase(extraDependsTest, ExtraDependsTest)
|
||||||
TestCase(allowemptypackagestest, AllowEmptyPackagesTest )
|
TestCase(allowemptypackagestest, AllowEmptyPackagesTest )
|
||||||
TestCase(binprefixtest, BinPrefixTest)
|
TestCase(binprefixtest, BinPrefixTest)
|
||||||
|
40
tests/units/linux/hidenfilestest.cpp
Normal file
40
tests/units/linux/hidenfilestest.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2024 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#include "hidenfilestest.h"
|
||||||
|
|
||||||
|
#include <filemanager.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void HidenFilesTest::test() {
|
||||||
|
#ifdef Q_OS_UNIX
|
||||||
|
TestUtils utils;
|
||||||
|
|
||||||
|
|
||||||
|
QDir("tstAssets").removeRecursively();
|
||||||
|
FileManager files;
|
||||||
|
files.cp(":/testRes/.hidenAssets", "tstAssets");
|
||||||
|
|
||||||
|
|
||||||
|
auto comapareTree = utils.createTree({
|
||||||
|
"./" + DISTRO_DIR + "/Application.deb",
|
||||||
|
"./" + DISTRO_DIR + "/Application.deb.md5",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
runTestParams({"-extraData", "tstAssets", "clear" ,
|
||||||
|
"deb", "verbose"}, &comapareTree, true);
|
||||||
|
|
||||||
|
// test clear for deb
|
||||||
|
runTestParams({"clear", "verbose"}, nullptr, true);
|
||||||
|
|
||||||
|
QDir("tstAssets").removeRecursively();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
23
tests/units/linux/hidenfilestest.h
Normal file
23
tests/units/linux/hidenfilestest.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2024 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HidenFilesTest_H
|
||||||
|
#define HidenFilesTest_H
|
||||||
|
#include "testbase.h"
|
||||||
|
#include "testutils.h"
|
||||||
|
|
||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
class HidenFilesTest: public TestBase, protected TestUtils
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void test() override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HidenFilesTest_H
|
@ -34,7 +34,7 @@ QSet<QString> TestUtils::getTree(const QString &path, int limit, int depch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDir dir(info.absoluteFilePath());
|
QDir dir(info.absoluteFilePath());
|
||||||
auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);
|
auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
for (const auto &i: std::as_const(list)) {
|
for (const auto &i: std::as_const(list)) {
|
||||||
result.unite(getTree(i.absoluteFilePath(), limit, depch + 1));
|
result.unite(getTree(i.absoluteFilePath(), limit, depch + 1));
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ QSet<QString> TestUtils::getFilesSet(const QString &path, int limit, int depch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDir dir(info.absoluteFilePath());
|
QDir dir(info.absoluteFilePath());
|
||||||
auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);
|
auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||||
for (const auto &i: std::as_const(list)) {
|
for (const auto &i: std::as_const(list)) {
|
||||||
result.unite(getFilesSet(i.absoluteFilePath(), limit, depch + 1));
|
result.unite(getFilesSet(i.absoluteFilePath(), limit, depch + 1));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user