From aec2bfd2a4424b00195c6391fef4afe07dcbc116 Mon Sep 17 00:00:00 2001 From: Guiling Qiyu <114603828+GuilingQiyu@users.noreply.github.com> Date: Fri, 15 Aug 2025 08:47:20 +0800 Subject: [PATCH] Packages (Linux): fixes Linglong detection by counting linglong layers (#1903) * Packages (Linux): fixes Linglong detection on Deepin * Packages (Linux): fixes Linglong detection to count layers * Update src/detection/packages/packages_linux.c --------- Co-authored-by: Carter Li --- src/detection/packages/packages_linux.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/detection/packages/packages_linux.c b/src/detection/packages/packages_linux.c index 04bf4935b..fbd607413 100644 --- a/src/detection/packages/packages_linux.c +++ b/src/detection/packages/packages_linux.c @@ -446,12 +446,7 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts, { packageCounts->guixSystem += getGuixPackages(baseDir, "/run/current-system/profile"); } - if (!(options->disabled & FF_PACKAGES_FLAG_LINGLONG_BIT)) - { - packageCounts->linglong += getNumElements(baseDir, "/var/lib/linglong/repo/refs/heads/main", true); - if (packageCounts->linglong == 0) - packageCounts->linglong += getNumElements(baseDir, "/var/lib/linglong/repo/refs/remotes/stable/main", true); - } + if (!(options->disabled & FF_PACKAGES_FLAG_LINGLONG_BIT)) packageCounts->linglong += getNumElements(baseDir, "/var/lib/linglong/layers", true); if (!(options->disabled & FF_PACKAGES_FLAG_PACSTALL_BIT)) packageCounts->pacstall += getNumElements(baseDir, "/var/lib/pacstall/metadata", false); if (!(options->disabled & FF_PACKAGES_FLAG_PISI_BIT)) packageCounts->pisi += getNumElements(baseDir, "/var/lib/pisi/package", true); if (!(options->disabled & FF_PACKAGES_FLAG_PKGSRC_BIT)) packageCounts->pkgsrc += getNumElements(baseDir, "/usr/pkg/pkgdb", DT_DIR);