From 6f30c687c2b0642947364ed677c65148cc2b82f9 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Thu, 8 Aug 2024 13:53:44 +0300 Subject: [PATCH] fix: skip debug packages as well --- docs/architecture.rst | 1 + src/ahriman/models/package_archive.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/architecture.rst b/docs/architecture.rst index 0d661187..0610d668 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -280,6 +280,7 @@ In addition to the depends/optional/make/check depends lists the server also han Having the initial dependencies tree, the application is looking for packages which contains those (both files and directories) paths and creates the initial packages list. After that, the packages list is reduced in the following way: +* From any leaf exclude the package itself and possible debug packages. * If the entry (i.e. file or directory) belongs to the package which is in base group, it will be removed. * If there is a package which depends on the another package which provide the same entry, the package will be removed. * After that, if there is a package which *optionally* depends on the another package in the remaining list, the package will be removed. diff --git a/src/ahriman/models/package_archive.py b/src/ahriman/models/package_archive.py index 42d6e340..e334d0c8 100644 --- a/src/ahriman/models/package_archive.py +++ b/src/ahriman/models/package_archive.py @@ -126,12 +126,14 @@ class PackageArchive: """ dependencies, roots = self.depends_on_paths() installed_packages = self.installed_packages() + # build list of packages, which contains both the package itself and (possible) debug packages + packages = list(self.package.packages) + [f"{package}-debug" for package in self.package.packages] # build initial map of file path -> packages containing this path # in fact, keys will contain all libraries the package linked to and all directories it contains dependencies_per_path: dict[Path, list[FilesystemPackage]] = {} for package_base, package in installed_packages.items(): - if package_base in self.package.packages: + if package_base in packages: continue # skip package itself required_by = [directory for directory in package.directories if directory in roots]