Skip to content
Merged
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
27 changes: 17 additions & 10 deletions libs/linglong/src/linglong/repo/ostree_repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2102,16 +2102,6 @@ OSTreeRepo::exportEntries(const std::filesystem::path &rootEntriesDir,
destination = rootEntriesDir / "lib/systemd/user";
}

auto desktopExportPath = std::string{ LINGLONG_EXPORT_PATH } + "/applications";

if (path == "share/applications") {
if (desktopExportPath != "share/applications") {
qInfo() << "destination update from " << destination.c_str() << " to "
<< QString::fromStdString(rootEntriesDir / desktopExportPath);
}
destination = rootEntriesDir / desktopExportPath;
}

if (path == "share/deepin-elf-verify") {
destination = rootEntriesDir / "share/deepin-elf-verify" / item.commit;
}
Expand All @@ -2128,6 +2118,23 @@ OSTreeRepo::exportEntries(const std::filesystem::path &rootEntriesDir,
if (!ret.has_value()) {
return ret;
}

if (path == "share/applications") {
auto desktopExportPath = std::string{ LINGLONG_EXPORT_PATH } + "/applications";

// 如果存在自定义的desktop安装路径,则也需要将desktop文件导出到指定目录
if (desktopExportPath != "share/applications") {
qInfo() << "destination update from " << destination.c_str() << " to "
<< QString::fromStdString(rootEntriesDir / desktopExportPath);

destination = rootEntriesDir / desktopExportPath;

auto ret = this->exportDir(item.info.id, source, destination, 10);
if (!ret.has_value()) {
return ret;
}
}
}
}
return LINGLONG_OK;
}
Expand Down