fix: skip debug packages as well

This commit is contained in:
Evgenii Alekseev 2024-08-08 13:53:44 +03:00
parent c023ebe165
commit 6f30c687c2
2 changed files with 4 additions and 1 deletions

View File

@ -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.

View File

@ -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]