fix: update packages properties after rebuild

This case leads to issue when it is impossible to update list of
implicit dependencies correctly in case of multi-packages
This commit is contained in:
2024-12-24 15:13:18 +02:00
parent 0660c33de3
commit 286ff4bcef
5 changed files with 44 additions and 2 deletions

View File

@ -136,7 +136,7 @@ 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]
packages = list(self.package.packages) + [f"{self.package.base}-debug"]
# 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

View File

@ -62,6 +62,8 @@ class Executor(PackageInfo, Cleaner):
patches = self.reporter.package_patches_get(package.base, None)
commit_sha = task.init(local_path, patches, local_version)
built = task.build(local_path, PACKAGER=packager_id)
package.with_packages(built, self.pacman)
for src in built:
dst = self.paths.packages / src.name
shutil.move(src, dst)

View File

@ -568,3 +568,19 @@ class Package(LazyLogging):
dict[str, Any]: json-friendly dictionary
"""
return dataclass_view(self)
def with_packages(self, packages: list[Path], pacman: Pacman) -> None:
"""
replace packages descriptions with ones from archives
Args:
packages(Iterable[Path]): paths to package archives
pacman(Pacman): alpm wrapper instance
"""
self.packages = {} # reset state
for package in packages:
archive = self.from_archive(package, pacman)
if archive.base != self.base:
continue
self.packages.update(archive.packages)