Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: compatible with runtime module #899

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions libs/linglong/src/linglong/builder/linglong_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ utils::error::Result<package::Reference> pullDependency(const package::FuzzyRefe

auto tmpTask = service::PackageTask::createTemporaryTask();
auto partChanged = [&ref, module](const uint fetched, const uint requested) {
auto percentage = (uint)((((double)fetched) / requested) * 100);
auto percentage = (uint)((((double)fetched) / requested) * 100);
auto progress = QString("(%1/%2 %3%)").arg(fetched).arg(requested).arg(percentage);
printReplacedText(QString("%1%2%3%4 %5")
.arg(ref->id, -25) // NOLINT
Expand Down Expand Up @@ -515,6 +515,10 @@ utils::error::Result<void> Builder::build(const QStringList &args) noexcept
2);
auto baseLayerDir = this->repo.getMergedModuleDir(*baseRef, false);
if (!baseLayerDir) {
baseLayerDir = this->repo.getLayerDir(*baseRef, "develop");
if (!baseLayerDir.has_value()) {
return LINGLONG_ERR("get base layer dir", baseLayerDir);
}
return LINGLONG_ERR("get base layer dir", baseLayerDir);
}

Expand Down Expand Up @@ -558,7 +562,10 @@ utils::error::Result<void> Builder::build(const QStringList &args) noexcept
2);
auto runtimeLayerDirRet = this->repo.getMergedModuleDir(*runtimeRet, false);
if (!runtimeLayerDirRet.has_value()) {
return LINGLONG_ERR("get runtime layer dir", runtimeLayerDirRet);
runtimeLayerDirRet = this->repo.getLayerDir(*runtimeRet, "develop");
if (!runtimeLayerDirRet.has_value()) {
return LINGLONG_ERR("get runtime layer dir", runtimeLayerDirRet);
}
}
runtimeRef = *runtimeRet;
runtimeLayerDir = *runtimeLayerDirRet;
Expand Down
3 changes: 3 additions & 0 deletions libs/linglong/src/linglong/repo/ostree_repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,9 @@ utils::error::Result<void> OSTreeRepo::mergeModules() const noexcept
binaryCommit = layer.commit;
}
}
if (binaryCommit.empty()) {
continue;
}
auto mergeID = hash.result().toHex().toStdString();
// 判断单个merged是否有变动
auto mergedChanged = true;
Expand Down