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 1QKb9r-0003WM-0w for garchives@archives.gentoo.org; Thu, 12 May 2011 19:02:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6444C1C01A; Thu, 12 May 2011 19:02:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C18E1C005 for ; Thu, 12 May 2011 19:02:39 +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 ABE451BC0CB for ; Thu, 12 May 2011 19:02:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E174580062 for ; Thu, 12 May 2011 19:02:37 +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: <34b54ba9e854b13f0413383979824ac3f90a2686.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/cache/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/cache/sqlite.py X-VCS-Directories: pym/portage/cache/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 34b54ba9e854b13f0413383979824ac3f90a2686 Date: Thu, 12 May 2011 19:02:37 +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: b3d85d5bd73297768bcf54e203c04379 commit: 34b54ba9e854b13f0413383979824ac3f90a2686 Author: Zac Medico gentoo org> AuthorDate: Thu May 12 18:42:08 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu May 12 18:42:08 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D34b54ba9 cache.sqlite: handle readonly --- pym/portage/cache/sqlite.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py index d15b6ec..4eb340b 100644 --- a/pym/portage/cache/sqlite.py +++ b/pym/portage/cache/sqlite.py @@ -31,7 +31,7 @@ class database(fs_template.FsBased): self.location =3D os.path.join(self.location,=20 self.label.lstrip(os.path.sep).rstrip(os.path.sep)) =20 - if not os.path.exists(self.location): + if not self.readonly and not os.path.exists(self.location): self._ensure_dirs() =20 config.setdefault("autocommit", self.autocommits) @@ -72,7 +72,8 @@ class database(fs_template.FsBased): connection_kwargs =3D {} connection_kwargs["timeout"] =3D config["timeout"] try: - self._ensure_dirs() + if not self.readonly: + self._ensure_dirs() self._db_connection =3D self._db_module.connect( database=3D_unicode_decode(self._dbpath), **connection_kwargs) self._db_cursor =3D self._db_connection.cursor()