cache.sqlite: handle readonly more v2.2.0_alpha33
authorZac Medico <zmedico@gentoo.org>
Thu, 12 May 2011 19:04:54 +0000 (12:04 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 May 2011 19:04:54 +0000 (12:04 -0700)
pym/portage/cache/sqlite.py

index 4eb340bb00726dbebb487d55d43eea05540f57d2..fcc62ff94fd470c4f5189dc0e737050d8351bfd2 100644 (file)
@@ -78,7 +78,7 @@ class database(fs_template.FsBased):
                                database=_unicode_decode(self._dbpath), **connection_kwargs)
                        self._db_cursor = self._db_connection.cursor()
                        self._db_cursor.execute("PRAGMA encoding = %s" % self._db_escape_string("UTF-8"))
-                       if not self._ensure_access(self._dbpath):
+                       if not self.readonly and not self._ensure_access(self._dbpath):
                                raise cache_errors.InitializationError(self.__class__, "can't ensure perms on %s" % self._dbpath)
                        self._db_init_cache_size(config["cache_bytes"])
                        self._db_init_synchronous(config["synchronous"])