summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/cache/sqlite.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py
index d15b6ece1..4eb340bb0 100644
--- a/pym/portage/cache/sqlite.py
+++ b/pym/portage/cache/sqlite.py
@@ -31,7 +31,7 @@ class database(fs_template.FsBased):
self.location = os.path.join(self.location,
self.label.lstrip(os.path.sep).rstrip(os.path.sep))
- if not os.path.exists(self.location):
+ if not self.readonly and not os.path.exists(self.location):
self._ensure_dirs()
config.setdefault("autocommit", self.autocommits)
@@ -72,7 +72,8 @@ class database(fs_template.FsBased):
connection_kwargs = {}
connection_kwargs["timeout"] = config["timeout"]
try:
- self._ensure_dirs()
+ if not self.readonly:
+ self._ensure_dirs()
self._db_connection = self._db_module.connect(
database=_unicode_decode(self._dbpath), **connection_kwargs)
self._db_cursor = self._db_connection.cursor()