diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-11-26 19:45:33 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-11-26 19:45:33 -0800 |
commit | 19f87d4ef525cbfd61b17ccd8fecf28f4efc48c9 (patch) | |
tree | 27505413fab9d53a8d9a3e6d995f852a9c6cbfcd | |
parent | similar_name_search: fix lower/upper case bugs (diff) | |
download | portage-19f87d4ef525cbfd61b17ccd8fecf28f4efc48c9.tar.gz portage-19f87d4ef525cbfd61b17ccd8fecf28f4efc48c9.tar.bz2 portage-19f87d4ef525cbfd61b17ccd8fecf28f4efc48c9.zip |
Use Package.counter where appropriate.
-rw-r--r-- | pym/_emerge/BlockerDB.py | 5 | ||||
-rw-r--r-- | pym/_emerge/FakeVartree.py | 6 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 11 |
3 files changed, 6 insertions, 16 deletions
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py index 883203387..ce8806d91 100644 --- a/pym/_emerge/BlockerDB.py +++ b/pym/_emerge/BlockerDB.py @@ -51,7 +51,7 @@ class BlockerDB(object): stale_cache.discard(inst_pkg.cpv) cached_blockers = blocker_cache.get(inst_pkg.cpv) if cached_blockers is not None and \ - cached_blockers.counter != long(inst_pkg.metadata["COUNTER"]): + cached_blockers.counter != inst_pkg.counter: cached_blockers = None if cached_blockers is not None: blocker_atoms = cached_blockers.atoms @@ -72,9 +72,8 @@ class BlockerDB(object): blocker_atoms = [atom for atom in atoms \ if atom.startswith("!")] blocker_atoms.sort() - counter = long(inst_pkg.metadata["COUNTER"]) blocker_cache[inst_pkg.cpv] = \ - blocker_cache.BlockerData(counter, blocker_atoms) + blocker_cache.BlockerData(inst_pkg.counter, blocker_atoms) for cpv in stale_cache: del blocker_cache[cpv] blocker_cache.flush() diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py index f618b2868..398cde804 100644 --- a/pym/_emerge/FakeVartree.py +++ b/pym/_emerge/FakeVartree.py @@ -252,12 +252,6 @@ class FakeVartree(vartree): root_config=self._pkg_root_config, type_name="installed") - try: - mycounter = long(pkg.metadata["COUNTER"]) - except ValueError: - mycounter = 0 - pkg.metadata["COUNTER"] = str(mycounter) - self._pkg_cache[pkg] = pkg return pkg diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 365fbf8d3..df4914316 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4950,7 +4950,7 @@ class depgraph(object): self._spinner_update() blocker_data = blocker_cache.get(cpv) if blocker_data is not None and \ - blocker_data.counter != long(pkg.metadata["COUNTER"]): + blocker_data.counter != pkg.counter: blocker_data = None # If blocker data from the graph is available, use @@ -4967,9 +4967,8 @@ class depgraph(object): blockers is not None: # Re-use the blockers from the graph. blocker_atoms = sorted(blockers) - counter = long(pkg.metadata["COUNTER"]) blocker_data = \ - blocker_cache.BlockerData(counter, blocker_atoms) + blocker_cache.BlockerData(pkg.counter, blocker_atoms) blocker_cache[pkg.cpv] = blocker_data continue @@ -5011,9 +5010,8 @@ class depgraph(object): blocker_atoms = [myatom for myatom in atoms \ if myatom.blocker] blocker_atoms.sort() - counter = long(pkg.metadata["COUNTER"]) blocker_cache[cpv] = \ - blocker_cache.BlockerData(counter, blocker_atoms) + blocker_cache.BlockerData(pkg.counter, blocker_atoms) if blocker_atoms: try: for atom in blocker_atoms: @@ -5825,8 +5823,7 @@ class depgraph(object): other_version = None for pkg in vardb.match_pkgs(atom): if pkg.cpv == task.cpv and \ - pkg.metadata["COUNTER"] == \ - task.metadata["COUNTER"]: + pkg.counter == task.counter: continue other_version = pkg break |