From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Pm4Uk-0007ys-Hv for garchives@archives.gentoo.org; Sun, 06 Feb 2011 13:17:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7AF0BE0B67; Sun, 6 Feb 2011 13:09:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3A014E0B38 for ; Sun, 6 Feb 2011 13:09:45 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A4FA21B400F for ; Sun, 6 Feb 2011 13:09:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B403780073 for ; Sun, 6 Feb 2011 13:09:43 +0000 (UTC) From: "Thomas Sachau" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Sachau" Message-ID: <7f84548b516d30de43118d58e6bc03c8739a0967.tommy@gentoo> Subject: [gentoo-commits] proj/portage:multilib commit in: pym/portage/dbapi/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/BinpkgFetcher.py pym/portage/dbapi/bintree.py X-VCS-Directories: pym/portage/dbapi/ pym/_emerge/ X-VCS-Committer: tommy X-VCS-Committer-Name: Thomas Sachau X-VCS-Revision: 7f84548b516d30de43118d58e6bc03c8739a0967 Date: Sun, 6 Feb 2011 13:09:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 59cc99f5bd1a33dc23e735ccf2c669b6 commit: 7f84548b516d30de43118d58e6bc03c8739a0967 Author: David James google com> AuthorDate: Wed Jan 26 22:45:43 2011 +0000 Commit: Thomas Sachau gentoo org> CommitDate: Thu Jan 27 01:01:31 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D7f84548b Update Portage to support multiple binhosts. BUG=3Dchromium-os:11295 TEST=3DBuild x86-mario with multiple binhosts (board binhost, preflight b= inhost) and verify that binaries are picked up from both binhosts. Also veri= fy that if one of the binhosts fails, the other binhost is used correct= ly. Review URL: http://codereview.chromium.org/6329022 Change-Id: I095f28c82e3effbc25105af6ac89e42c335e6381 --- pym/_emerge/BinpkgFetcher.py | 4 ++-- pym/portage/dbapi/bintree.py | 34 +++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py index 942bcdf..221d9a7 100644 --- a/pym/_emerge/BinpkgFetcher.py +++ b/pym/_emerge/BinpkgFetcher.py @@ -57,8 +57,8 @@ class BinpkgFetcher(SpawnProcess): rel_uri =3D bintree._remotepkgs[pkg.cpv].get("PATH") if not rel_uri: rel_uri =3D pkg.cpv + ".tbz2" - uri =3D bintree._remote_base_uri.rstrip("/") + \ - "/" + rel_uri.lstrip("/") + remote_base_uri =3D bintree._remotepkgs[pkg.cpv]["BASE_URI"] + uri =3D remote_base_uri.rstrip("/") + "/" + rel_uri.lstrip("/") else: uri =3D settings["PORTAGE_BINHOST"].rstrip("/") + \ "/" + pkg.pf + ".tbz2" diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 2da7799..cc6203a 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -224,7 +224,6 @@ class binarytree(object): self.populated =3D 0 self.tree =3D {} self._remote_has_index =3D False - self._remote_base_uri =3D None self._remotepkgs =3D None # remote metadata indexed by cpv self.__remotepkgs =3D {} # indexed by tbz2 name (deprecated) self.invalids =3D [] @@ -242,7 +241,7 @@ class binarytree(object): ["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI", "IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES", - "REQUIRED_USE"] + "REQUIRED_USE", "BASE_URI"] self._pkgindex_aux_keys =3D list(self._pkgindex_aux_keys) self._pkgindex_use_evaluated_keys =3D \ ("LICENSE", "RDEPEND", "DEPEND", @@ -728,8 +727,12 @@ class binarytree(object): writemsg(_("!!! PORTAGE_BINHOST unset, but use is requested.\n"), noiselevel=3D-1) =20 - if getbinpkgs and 'PORTAGE_BINHOST' in self.settings: - base_url =3D self.settings["PORTAGE_BINHOST"] + if not getbinpkgs or 'PORTAGE_BINHOST' not in self.settings: + self.populated=3D1 + return + self._remotepkgs =3D {} + self.__remotepkgs =3D {} + for base_url in self.settings["PORTAGE_BINHOST"].split(): parsed_url =3D urlparse(base_url) host =3D parsed_url.netloc port =3D parsed_url.port @@ -857,13 +860,12 @@ class binarytree(object): # file, but that's alright. if pkgindex: # Organize remote package list as a cpv -> metadata map. - self._remotepkgs =3D _pkgindex_cpv_map_latest_build(pkgindex) + remotepkgs =3D _pkgindex_cpv_map_latest_build(pkgindex) + self._remotepkgs.update(remotepkgs) self._remote_has_index =3D True - self._remote_base_uri =3D pkgindex.header.get("URI", base_url) - self.__remotepkgs =3D {} - for cpv in self._remotepkgs: + remote_base_uri =3D pkgindex.header.get("URI", base_url) + for cpv in remotepkgs: self.dbapi.cpv_inject(cpv) - self.populated =3D 1 if True: # Remote package instances override local package # if they are not identical. @@ -872,6 +874,7 @@ class binarytree(object): remote_metadata =3D self._remotepkgs.get(cpv) if remote_metadata is None: continue + remote_metadata["BASE_URI"] =3D remote_base_uri # Use digests to compare identity. identical =3D True for hash_name in hash_names: @@ -893,8 +896,7 @@ class binarytree(object): # Local package instances override remote instances. for cpv in metadata: self._remotepkgs.pop(cpv, None) - return - self._remotepkgs =3D {} + continue try: chunk_size =3D long(self.settings["PORTAGE_BINHOST_CHUNKSIZE"]) if chunk_size < 8: @@ -905,11 +907,12 @@ class binarytree(object): writemsg_stdout( colorize("GOOD", _("Fetching bininfo from ")) + \ re.sub(r'//(.+):.+@(.+)/', r'//\1:*password*@\2/', base_url) + "\n") - self.__remotepkgs =3D portage.getbinpkg.dir_get_metadata( - self.settings["PORTAGE_BINHOST"], chunk_size=3Dchunk_size) + remotepkgs =3D portage.getbinpkg.dir_get_metadata( + base_url, chunk_size=3Dchunk_size) + self.__remotepkgs.update(remotepkgs) #writemsg(green(" -- DONE!\n\n")) =20 - for mypkg in list(self.__remotepkgs): + for mypkg in list(remotepkgs): if "CATEGORY" not in self.__remotepkgs[mypkg]: #old-style or corrupt package writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg, @@ -1233,7 +1236,8 @@ class binarytree(object): rel_url =3D self._remotepkgs[pkgname].get("PATH") if not rel_url: rel_url =3D pkgname+".tbz2" - url =3D self._remote_base_uri.rstrip("/") + "/" + rel_url.lstrip("/") + remote_base_uri =3D self._remotepkgs[pkgname]["BASE_URI"] + url =3D remote_base_uri.rstrip("/") + "/" + rel_url.lstrip("/") else: url =3D self.settings["PORTAGE_BINHOST"].rstrip("/") + "/" + tbz2name protocol =3D urlparse(url)[0]