diff --git a/britney.py b/britney.py index fb0a2b3..e82229a 100755 --- a/britney.py +++ b/britney.py @@ -1266,8 +1266,8 @@ class Britney(object): packages_s_a = self.binaries[suite][arch][0] # for every binary package produced by this source in unstable for this architecture - for pkg_id in sorted(x for x in source_u[BINARIES] if x[2] == arch): - pkg_name = pkg_id[0] + for pkg_id in sorted(x for x in source_u[BINARIES] if x.architecture == arch): + pkg_name = pkg_id.package_name # retrieve the testing (if present) and unstable corresponding binary packages binary_t = pkg_name in packages_t_a and packages_t_a[pkg_name] or None @@ -1344,8 +1344,8 @@ class Britney(object): arch, False) - for pkg_id in sorted(x for x in source_t[BINARIES] if x[2] == arch): - pkg = pkg_id[0] + for pkg_id in sorted(x for x in source_t[BINARIES] if x.architecture == arch): + pkg = pkg_id.package_name # if the package is architecture-independent, then ignore it tpkg_data = packages_t_a[pkg] if tpkg_data.version == 'all': @@ -1551,7 +1551,7 @@ class Britney(object): # if the package in testing has no binaries on this # architecture, it can't be out-of-date if not any(x for x in source_t[BINARIES] - if x[2] == arch and all_binaries[x].architecture != 'all'): + if x.architecture == arch and all_binaries[x].architecture != 'all'): continue # if the (t-)p-u package has produced any binaries on @@ -1585,8 +1585,8 @@ class Britney(object): oodbins = {} uptodatebins = False # for every binary package produced by this source in the suite for this architecture - for pkg_id in sorted(x for x in source_u[BINARIES] if x[2] == arch): - pkg = pkg_id[0] + for pkg_id in sorted(x for x in source_u[BINARIES] if x.architecture == arch): + pkg = pkg_id.package_name if pkg not in pkgs: pkgs[pkg] = [] pkgs[pkg].append(arch) diff --git a/britney_util.py b/britney_util.py index 007527c..85b70e7 100644 --- a/britney_util.py +++ b/britney_util.py @@ -582,7 +582,7 @@ def check_installability(inst_tester, binaries, arch, updates, affected, check_a improvement = 0 # broken packages (first round) - for pkg_id in (x for x in updates if x[2] == arch): + for pkg_id in (x for x in updates if x.architecture == arch): name, version, parch = pkg_id if name not in packages_t_a: continue @@ -616,7 +616,7 @@ def check_installability(inst_tester, binaries, arch, updates, affected, check_a # The early round is sufficient to disprove the situation return - for pkg_id in (x for x in affected if x[2] == arch): + for pkg_id in (x for x in affected if x.architecture == arch): name, version, parch = pkg_id if name not in packages_t_a: continue diff --git a/installability/tester.py b/installability/tester.py index 7643596..5f6eb1a 100644 --- a/installability/tester.py +++ b/installability/tester.py @@ -182,10 +182,10 @@ class InstallabilityTester(object): # Re-add broken packages as some of them may now be installable self._testing |= self._cache_broken self._cache_broken = set() - if pkg_id in self._essentials and pkg_id[2] in self._cache_ess: + if pkg_id in self._essentials and pkg_id.architecture in self._cache_ess: # Adds new essential => "pseudo-essential" set needs to be # recomputed - del self._cache_ess[pkg_id[2]] + del self._cache_ess[pkg_id.architecture] return True @@ -204,9 +204,9 @@ class InstallabilityTester(object): if pkg_id in self._testing: self._testing.remove(pkg_id) - if pkg_id[2] in self._cache_ess and pkg_id in self._cache_ess[pkg_id[2]][0]: + if pkg_id.architecture in self._cache_ess and pkg_id in self._cache_ess[pkg_id.architecture][0]: # Removes a package from the "pseudo-essential set" - del self._cache_ess[pkg_id[2]] + del self._cache_ess[pkg_id.architecture] if pkg_id not in self._revuniverse: # no reverse relations - safe @@ -297,12 +297,12 @@ class InstallabilityTester(object): if len(musts) == 1: # Include the essential packages in testing as a starting point. - if t[2] not in self._cache_ess: + if t.architecture not in self._cache_ess: # The minimal essential set cache is not present - # compute it now. - (start, ess_never) = self._get_min_pseudo_ess_set(t[2]) + (start, ess_never) = self._get_min_pseudo_ess_set(t.architecture) else: - (start, ess_never) = self._cache_ess[t[2]] + (start, ess_never) = self._cache_ess[t.architecture] if t in ess_never: # t conflicts with something in the essential set or the essential @@ -601,7 +601,7 @@ class InstallabilityTester(object): universe = self._universe stats = self._stats - ess_base = set(x for x in self._essentials if x[2] == arch and x in testing) + ess_base = set(x for x in self._essentials if x.architecture == arch and x in testing) start = set(ess_base) ess_never = set() ess_choices = set() @@ -648,7 +648,7 @@ class InstallabilityTester(object): arch_stats.nodes += 1 if pkg in eqv_table and pkg not in seen_eqv[pkg_arch]: - eqv = [e for e in eqv_table[pkg] if e[2] == pkg_arch] + eqv = [e for e in eqv_table[pkg] if e.architecture == pkg_arch] arch_stats.eqv_nodes += len(eqv) arch_stats.add_dep_edges(deps)