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 1QxO8v-0000E3-Gj for garchives@archives.gentoo.org; Sat, 27 Aug 2011 19:02:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7B4CA21C033; Sat, 27 Aug 2011 19:02:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 419B821C033 for ; Sat, 27 Aug 2011 19:02:01 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9A1711B4079 for ; Sat, 27 Aug 2011 19:02:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C6A1280040 for ; Sat, 27 Aug 2011 19:01:59 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <63035acd702ab0cdaac31e33676b5a20a91eae47.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/egencache X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 63035acd702ab0cdaac31e33676b5a20a91eae47 Date: Sat, 27 Aug 2011 19:01:59 +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: a3315de75590c5541ec597b65a691afc commit: 63035acd702ab0cdaac31e33676b5a20a91eae47 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 27 19:01:06 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Aug 27 19:01:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D63035acd egencache: implement XMLParser.doctype() This is prevents "DeprecationWarning: This method of XMLParser is deprecated. Define doctype() method on the TreeBuilder target." warnings. The code is copied from repoman, commit 5a5e51a2737a0855bb562683f50c57cc31587460. --- bin/egencache | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/bin/egencache b/bin/egencache index 6d8df35..a87394c 100755 --- a/bin/egencache +++ b/bin/egencache @@ -368,6 +368,14 @@ class GenCache(object): "committing target: %s\n" % (ce,), level=3Dlogging.ERROR, noiselevel=3D-1) =20 +class _MetadataTreeBuilder(ElementTree.TreeBuilder): + """ + Implements doctype() as required to avoid deprecation warnings with + >=3Dpython-2.7. + """ + def doctype(self, name, pubid, system): + pass + class GenUseLocalDesc(object): def __init__(self, portdb, output=3DNone, preserve_comments=3DFalse): @@ -475,7 +483,9 @@ class GenUseLocalDesc(object): for cp in self._portdb.cp_all(): metadata_path =3D os.path.join(repo_path, cp, 'metadata.xml') try: - metadata =3D ElementTree.parse(metadata_path) + metadata =3D ElementTree.parse(metadata_path, + parser=3DElementTree.XMLParser( + target=3D_MetadataTreeBuilder())) except IOError: pass except (ExpatError, EnvironmentError) as e: