diff options
Diffstat (limited to 'lib/_emerge')
-rw-r--r-- | lib/_emerge/Scheduler.py | 13 | ||||
-rw-r--r-- | lib/_emerge/actions.py | 7 | ||||
-rw-r--r-- | lib/_emerge/depgraph.py | 21 |
3 files changed, 41 insertions, 0 deletions
diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py index d913cd2dc..614df9e78 100644 --- a/lib/_emerge/Scheduler.py +++ b/lib/_emerge/Scheduler.py @@ -2116,6 +2116,19 @@ class Scheduler(PollScheduler): for x in self._mergelist if isinstance(x, Package) and x.operation == "merge" ] + # Store binpkgs using the same keys as $PKGDIR/Packages plus EROOT. + mtimedb["resume"]["binpkgs"] = [ + { + "CPV": str(x.cpv), + "BUILD_ID": x.cpv.build_id, + "BUILD_TIME": x.cpv.build_time, + "MTIME": x.cpv.mtime, + "SIZE": x.cpv.file_size, + "EROOT": x.root, + } + for x in self._mergelist + if isinstance(x, Package) and x.type_name == "binary" + ] mtimedb.commit() diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index 512e470ad..43d936fd1 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -216,6 +216,13 @@ def action_build( if not isinstance(favorites, list): del mtimedb[k] continue + binpkgs = resume_data.get("binpkgs") + if binpkgs and ( + not isinstance(binpkgs, list) + or any(not isinstance(x, dict) for x in binpkgs) + ): + del mtimedb[k] + continue resume = False if "--resume" in myopts and ("resume" in mtimedb or "resume_backup" in mtimedb): diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 3adc04bcf..a05404d9c 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -11066,6 +11066,13 @@ class depgraph: else: args = [] + binpkgs_map = {} + binpkgs = resume_data.get("binpkgs") + if binpkgs: + for x in binpkgs: + if isinstance(x, dict) and "EROOT" in x and "CPV" in x: + binpkgs_map[(x["EROOT"], x["CPV"])] = x + serialized_tasks = [] masked_tasks = [] for x in mergelist: @@ -11096,8 +11103,22 @@ class depgraph: except InvalidAtom: continue + if pkg_type == "binary": + binpkg_info = binpkgs_map.get((myroot, pkg_key)) + else: + binpkg_info = False + pkg = None for pkg in self._iter_match_pkgs(root_config, pkg_type, atom): + if binpkg_info: + if not ( + pkg.cpv.build_id == binpkg_info.get("BUILD_ID") + and pkg.cpv.build_time == binpkg_info.get("BUILD_TIME") + and pkg.cpv.mtime == binpkg_info.get("MTIME") + and pkg.cpv.file_size == binpkg_info.get("SIZE") + ): + continue + if not self._pkg_visibility_check( pkg ) or self._frozen_config.excluded_pkgs.findAtomForPackage( |