mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-03 13:09:34 +00:00
major tests crashed
This commit is contained in:
parent
7617e012ac
commit
76b0de756b
@ -75,28 +75,20 @@ bool DependenciesScanner::fillLibInfo(LibInfo &info, const QString &file) {
|
||||
|
||||
void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res)
|
||||
{
|
||||
bool isScaned = _scanedLibs.contains(lib.fullPath());
|
||||
if (_scanedLibs.contains(lib.fullPath())) {
|
||||
auto scanedLib = _scanedLibs.value(lib.fullPath());
|
||||
|
||||
for (auto i : lib.dependncies) {
|
||||
|
||||
if (isScaned) {
|
||||
auto scanedLib = _scanedLibs.value(i);
|
||||
|
||||
if (!scanedLib.isValid()) {
|
||||
qCritical() << "no valid lib in scaned libs list!";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!scanedLib.isScaned()) {
|
||||
qCritical() << "lib not scaned!";
|
||||
return;
|
||||
}
|
||||
|
||||
res.insert(scanedLib);
|
||||
|
||||
continue;
|
||||
if (!scanedLib.isValid()) {
|
||||
qCritical() << "no valid lib in scaned libs list!";
|
||||
return;
|
||||
}
|
||||
|
||||
res.unite(scanedLib.allDep);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto i : lib.dependncies) {
|
||||
|
||||
auto libs = getLibsFromEnvirement(i);
|
||||
|
||||
@ -111,14 +103,24 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res)
|
||||
while (dep != libs.end() &&
|
||||
dep.value().platform != lib.platform) dep++;
|
||||
|
||||
if (dep != libs.end() && !res.contains(*dep)) {
|
||||
if (dep != libs.end()) {
|
||||
LibInfo scanedLib = _scanedLibs.value(dep->fullPath());
|
||||
|
||||
if (!scanedLib.isValid()) {
|
||||
auto listDep = QSet<LibInfo>();
|
||||
|
||||
recursiveDep(*dep, listDep);
|
||||
|
||||
dep->allDep = listDep;
|
||||
_scanedLibs.insert(dep->fullPath(), *dep);
|
||||
|
||||
res.unite(listDep);
|
||||
} else {
|
||||
res.unite(scanedLib.allDep);
|
||||
}
|
||||
res.insert(*dep);
|
||||
recursiveDep(*dep, res);
|
||||
}
|
||||
}
|
||||
|
||||
lib.allDep = res;
|
||||
_scanedLibs.insert(lib.fullPath(), lib);
|
||||
}
|
||||
|
||||
void DependenciesScanner::setEnvironment(const QStringList &env) {
|
||||
|
@ -24,8 +24,9 @@ bool ELF::getLibInfo(const QString &lib, LibInfo &info) {
|
||||
info.setName(QFileInfo(lib).fileName());
|
||||
info.setPath(QFileInfo(lib).absolutePath());
|
||||
|
||||
for (auto &i : reader.dependencies()) {
|
||||
info.addDependncies(i);
|
||||
auto dep = reader.dependencies();
|
||||
for (auto &i : dep) {
|
||||
info.addDependncies(i.toUpper());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -89,10 +89,6 @@ bool LibInfo::isValid() const {
|
||||
name.size() && path.size();
|
||||
}
|
||||
|
||||
bool LibInfo::isScaned() const {
|
||||
return allDep.size();
|
||||
}
|
||||
|
||||
uint qHash(const LibInfo &info) {
|
||||
return qHash(info.fullPath());
|
||||
}
|
||||
|
@ -27,8 +27,6 @@ public:
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
bool isScaned() const;
|
||||
|
||||
friend class DependenciesScanner;
|
||||
const QSet<LibInfo>& getAllDep() const;
|
||||
Platform getPlatform() const;
|
||||
|
@ -64,7 +64,7 @@ bool PE::getLibInfo(const QString &lib, LibInfo &info) {
|
||||
}
|
||||
|
||||
info.setName(QFileInfo(lib).fileName());
|
||||
info.setName(QFileInfo(lib).absolutePath());
|
||||
info.setPath(QFileInfo(lib).absolutePath());
|
||||
|
||||
if (!getDep(parsedPeLib->internal, info)) {
|
||||
return false;
|
||||
|
@ -388,7 +388,8 @@ void deploytest::testExtractLib() {
|
||||
QVERIFY(info.getPlatform() == platforms.value(lib));
|
||||
|
||||
for (auto &dep : deb.value(lib)) {
|
||||
QVERIFY(info.getDependncies().contains(dep.toUpper()));
|
||||
bool test = info.getDependncies().contains(dep.toUpper());
|
||||
QVERIFY(test);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user