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 1NbFaP-00085z-PY for garchives@archives.gentoo.org; Sat, 30 Jan 2010 15:50:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 29A99E07C1; Sat, 30 Jan 2010 15:50:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 05B4EE07C1 for ; Sat, 30 Jan 2010 15:50:08 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 79B6767B2F for ; Sat, 30 Jan 2010 15:50:07 +0000 (UTC) Received: from volkmar by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1NbFaI-00050G-UJ for gentoo-commits@lists.gentoo.org; Sat, 30 Jan 2010 15:50:06 +0000 To: gentoo-commits@lists.gentoo.org From: "Mounir Lamouri (volkmar)" Subject: [gentoo-commits] portage r15291 - main/trunk/pym/portage/cache X-VCS-Repository: portage X-VCS-Revision: 15291 X-VCS-Files: main/trunk/pym/portage/cache/flat_list.py X-VCS-Directories: main/trunk/pym/portage/cache X-VCS-Committer: volkmar X-VCS-Committer-Name: Mounir Lamouri Content-Type: text/plain; charset=UTF-8 Message-Id: Sender: Mounir Lamouri Date: Sat, 30 Jan 2010 15:50:06 +0000 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: da86838f-6c0e-4edc-9078-09fa3961c17e X-Archives-Hash: 2709b68322425e342e9ac3f6ed3f8826 Author: volkmar Date: 2010-01-30 15:50:06 +0000 (Sat, 30 Jan 2010) New Revision: 15291 Modified: main/trunk/pym/portage/cache/flat_list.py Log: fix flat_list cache backend looks like it was outdated wrt. template cache backend Modified: main/trunk/pym/portage/cache/flat_list.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/trunk/pym/portage/cache/flat_list.py 2010-01-30 14:46:50 UTC (re= v 15290) +++ main/trunk/pym/portage/cache/flat_list.py 2010-01-30 15:50:06 UTC (re= v 15291) @@ -22,21 +22,21 @@ 'KEYWORDS', 'IUSE', 'UNUSED_00', 'PDEPEND', 'PROVIDE', 'EAPI', 'PROPERTIES', 'DEFINED_PHASES') =20 - def __init__(self, label, auxdbkeys, **config): - super(database,self).__init__(label, auxdbkeys, **config) - self._base =3D os.path.join(self._base,=20 + def __init__(self, *args, **config): + super(database,self).__init__(*args, **config) + self.location =3D os.path.join(self.location,=20 self.label.lstrip(os.path.sep).rstrip(os.path.sep)) =20 if len(self._known_keys) > len(self.auxdbkey_order) + 2: raise Exception("less ordered keys then auxdbkeys") - if not os.path.exists(self._base): + if not os.path.exists(self.location): self._ensure_dirs() =20 =20 def _getitem(self, cpv): d =3D {} try: - myf =3D codecs.open(_unicode_encode(os.path.join(self._base, cpv), + myf =3D codecs.open(_unicode_encode(os.path.join(self.location, cpv), encoding=3D_encodings['fs'], errors=3D'strict'), mode=3D'r', encoding=3D_encodings['repo.content'], errors=3D'replace') @@ -58,7 +58,7 @@ =20 def _setitem(self, cpv, values): s =3D cpv.rfind("/") - fp=3Dos.path.join(self._base,cpv[:s],".update.%i.%s" % (os.getpid(), c= pv[s+1:])) + fp=3Dos.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid()= , cpv[s+1:])) try: myf =3D codecs.open(_unicode_encode(fp, encoding=3D_encodings['fs'], errors=3D'strict'), @@ -84,7 +84,7 @@ myf.close() self._ensure_access(fp, mtime=3Dvalues["_mtime_"]) #update written. now we move it. - new_fp =3D os.path.join(self._base,cpv) + new_fp =3D os.path.join(self.location,cpv) try: os.rename(fp, new_fp) except (OSError, IOError) as e: @@ -94,7 +94,7 @@ =20 def _delitem(self, cpv): try: - os.remove(os.path.join(self._base,cpv)) + os.remove(os.path.join(self.location,cpv)) except OSError as e: if errno.ENOENT =3D=3D e.errno: raise KeyError(cpv) @@ -103,13 +103,13 @@ =20 =20 def __contains__(self, cpv): - return os.path.exists(os.path.join(self._base, cpv)) + return os.path.exists(os.path.join(self.location, cpv)) =20 =20 def __iter__(self): """generator for walking the dir struct""" - dirs =3D [self._base] - len_base =3D len(self._base) + dirs =3D [self.location] + len_base =3D len(self.location) while len(dirs): for l in os.listdir(dirs[0]): if l.endswith(".cpickle"):