mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-29 19:24:33 +00:00
ref #629 "added an error message for conflict between libDir and targetDir options"
This commit is contained in:
parent
5fb560e8f5
commit
fd72d2be20
@ -695,7 +695,9 @@ bool ConfigParser::parseDeployMode(bool checkBin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
initExtraPath();
|
||||
if (!initExtraPath()) {
|
||||
return false;
|
||||
}
|
||||
initExtraNames();
|
||||
initPlugins();
|
||||
|
||||
@ -1294,7 +1296,7 @@ bool ConfigParser::setQtDir(const QString &value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigParser::initExtraPath() {
|
||||
bool ConfigParser::initExtraPath() {
|
||||
auto listLibDir = QuasarAppUtils::Params::getArg("libDir").
|
||||
split(DeployCore::getSeparator(0));
|
||||
|
||||
@ -1309,6 +1311,16 @@ void ConfigParser::initExtraPath() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_config.envirement.isIgnore(info.absoluteFilePath())) {
|
||||
QuasarAppUtils::Params::log(QString("Failed to set libDir path!"
|
||||
" The %0 path will be ignored because"
|
||||
" this path is child path of the targetDir path"
|
||||
" or manually added into ignore environment.").
|
||||
arg(info.absoluteFilePath()),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
dir.setPath(info.absoluteFilePath());
|
||||
auto extraDirs = getSetDirsRecursive(QDir::fromNativeSeparators(info.absoluteFilePath()), _config.depchLimit);
|
||||
_config.extraPaths.addExtraPaths(extraDirs);
|
||||
@ -1326,6 +1338,8 @@ void ConfigParser::initExtraPath() {
|
||||
QuasarAppUtils::Debug);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigParser::initExtraNames() {
|
||||
|
@ -83,7 +83,7 @@ private:
|
||||
bool setQmake(const QString &value);
|
||||
bool setQtDir(const QString &value);
|
||||
|
||||
void initExtraPath();
|
||||
bool initExtraPath();
|
||||
void initExtraNames();
|
||||
|
||||
bool initPlugins();
|
||||
|
@ -65,7 +65,9 @@ void Envirement::addEnv(const QStringList &listDirs) {
|
||||
for (const auto& i : listDirs) {
|
||||
auto path = PathUtils::fixPath(QFileInfo(i).absoluteFilePath());
|
||||
|
||||
if (_ignoreEnvList && _ignoreEnvList->inThisEnvirement(i)) {
|
||||
if (isIgnore(i)) {
|
||||
QuasarAppUtils::Params::log(QString("The %0 path is ignored and not added to a search list!!").arg(i),
|
||||
QuasarAppUtils::Debug);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -85,6 +87,10 @@ void Envirement::addEnv(const QStringList &listDirs) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Envirement::isIgnore(const QString &path) const {
|
||||
return _ignoreEnvList && _ignoreEnvList->inThisEnvirement(path);
|
||||
}
|
||||
|
||||
void Envirement::clear() {
|
||||
if (_ignoreEnvList)
|
||||
delete _ignoreEnvList;
|
||||
|
@ -34,6 +34,13 @@ public:
|
||||
void addEnv(const QString &dir);
|
||||
void addEnv(const QStringList &listDirs);
|
||||
|
||||
/**
|
||||
* @brief isIgnore This method return true if the @a path is contains in ignore list else return false.
|
||||
* @brief path This is path to of the system enviroment that will be checked to ignore.
|
||||
* @return true if the @a path is contains in ignore list else return false.
|
||||
*/
|
||||
bool isIgnore(const QString& path) const;
|
||||
|
||||
void clear();
|
||||
|
||||
// return true if file exits in this envirement
|
||||
|
@ -185,6 +185,7 @@ private slots:
|
||||
void testDisableShortcuts();
|
||||
void testDisableRunScripts();
|
||||
void testQifOut();
|
||||
void testIgnoreEnvWithLibDir();
|
||||
|
||||
void customTest();
|
||||
};
|
||||
@ -1533,6 +1534,24 @@ void deploytest::testQifOut() {
|
||||
"qif", "-qifOut", "QIF_OUT.exe"}, &result);
|
||||
}
|
||||
|
||||
void deploytest::testIgnoreEnvWithLibDir() {
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
#else
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
#endif
|
||||
|
||||
QVERIFY(QDir().mkdir("libDirtest"));
|
||||
|
||||
// Run deploy installer
|
||||
runTestParams({"-bin", bin, "clear",
|
||||
"-targetDir", "./libDirtest",
|
||||
"-libDir", "./libDirtest"}, nullptr, false, false,
|
||||
exitCodes::PrepareError);
|
||||
|
||||
QVERIFY(QDir().rmdir("libDirtest"));
|
||||
}
|
||||
|
||||
void deploytest::customTest() {
|
||||
//runTestParams({"-confFile", "",
|
||||
// "qifFromSystem"});
|
||||
|
Loading…
x
Reference in New Issue
Block a user