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 1QY1Yf-0001z6-H1 for garchives@archives.gentoo.org; Sat, 18 Jun 2011 19:51:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C49AC1C003; Sat, 18 Jun 2011 19:51:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 925C81C003 for ; Sat, 18 Jun 2011 19:51:42 +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 20C4B1B4009 for ; Sat, 18 Jun 2011 19:51:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4A90C8003C for ; Sat, 18 Jun 2011 19:51:41 +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: Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/emaint X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: aa1a33a58262c2982e43238ef6f7710115eba9a3 Date: Sat, 18 Jun 2011 19:51:41 +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: e3c15ef546a138f449ea300aa9272630 commit: aa1a33a58262c2982e43238ef6f7710115eba9a3 Author: Zac Medico gentoo org> AuthorDate: Sat Jun 18 19:51:12 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Jun 18 19:51:12 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Daa1a33a5 emaint binhost: check SIZE and MTIME --- bin/emaint | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/bin/emaint b/bin/emaint index 1b1df71..7294d79 100755 --- a/bin/emaint +++ b/bin/emaint @@ -5,6 +5,7 @@ from __future__ import print_function =20 import re import signal +import stat import sys import textwrap import time @@ -19,6 +20,9 @@ except ImportError: =20 from portage import os =20 +if sys.hexversion >=3D 0x3000000: + long =3D int + class WorldHandler(object): =20 short_desc =3D "Fix problems in the world file" @@ -185,7 +189,23 @@ class BinhostHandler(object): del missing[:] for i, cpv in enumerate(cpv_all): d =3D metadata.get(cpv) - if not d or "MD5" not in d: + if not d or \ + "MD5" not in d or \ + "SIZE" not in d or \ + "MTIME" not in d: + missing.append(cpv) + continue + + pkg_path =3D bintree.getname(cpv) + s =3D os.lstat(pkg_path) + try: + if long(d["MTIME"]) !=3D s[stat.ST_MTIME]: + missing.append(cpv) + continue + if long(d["SIZE"]) !=3D long(s.st_size): + missing.append(cpv) + continue + except ValueError: missing.append(cpv) =20 maxval =3D len(missing)