public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-02-03  5:08 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-02-03  5:08 UTC (permalink / raw
  To: gentoo-commits

commit:     f8ef0cbecbd7a0aec56b8e4aa7b7e5a9b553db2d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  3 05:06:20 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb  3 05:06:34 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8ef0cbe

sphinx-build: avoid autodoc ModuleNotFoundError for xattr

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/ebuild_xattr.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/portage/cache/ebuild_xattr.py b/lib/portage/cache/ebuild_xattr.py
index cc6b06246..33a40fdba 100644
--- a/lib/portage/cache/ebuild_xattr.py
+++ b/lib/portage/cache/ebuild_xattr.py
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright: 2009-2011 Gentoo Foundation
+# Copyright: 2009-2020 Gentoo Authors
 # Author(s): Petteri Räty (betelgeuse@gentoo.org)
 # License: GPL2
 
@@ -14,8 +14,7 @@ from portage import cpv_getkey
 from portage import os
 from portage import _encodings
 from portage import _unicode_decode
-portage.proxy.lazyimport.lazyimport(globals(),
-	'xattr')
+from portage.util._xattr import xattr
 
 class NoValueException(Exception):
 	pass


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-03 19:30 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-03 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     5d4b6d8e72233b947e2645a137eeaceb14d6fcdc
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 19:05:53 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 19:22:03 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d4b6d8e

lib/portage/cache/ebuild_xattr.py: drop unused-import

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/ebuild_xattr.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/portage/cache/ebuild_xattr.py b/lib/portage/cache/ebuild_xattr.py
index 6b42d79df..bba3f1b88 100644
--- a/lib/portage/cache/ebuild_xattr.py
+++ b/lib/portage/cache/ebuild_xattr.py
@@ -7,7 +7,6 @@ __all__ = ['database']
 
 import errno
 
-import portage
 from portage.cache import fs_template
 from portage.versions import catsplit
 from portage import cpv_getkey


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     39c48cdeed9674df6e8ab18e32fa075e95f9bdee
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:06 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=39c48cde

lib/portage/cache/sqlite.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/sqlite.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py
index 02bf3fcde..3a372bcfc 100644
--- a/lib/portage/cache/sqlite.py
+++ b/lib/portage/cache/sqlite.py
@@ -33,7 +33,7 @@ class database(fs_template.FsBased):
 		self._allowed_keys_set = frozenset(self._allowed_keys)
 		self._allowed_keys = sorted(self._allowed_keys_set)
 
-		self.location = os.path.join(self.location, 
+		self.location = os.path.join(self.location,
 			self.label.lstrip(os.path.sep).rstrip(os.path.sep))
 
 		if not self.readonly and not os.path.exists(self.location):
@@ -105,7 +105,7 @@ class database(fs_template.FsBased):
 		table_parameters.append("UNIQUE(%s)" % self._db_table["packages"]["package_key"])
 		create_statement.append(",".join(table_parameters))
 		create_statement.append(")")
-		
+
 		self._db_table["packages"]["create"] = " ".join(create_statement)
 
 		cursor = self._db_cursor


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     54d5bb6affb81746f58bc62df5fa170d11bf1324
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:15 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:02 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=54d5bb6a

lib/portage/cache/template.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/template.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/cache/template.py b/lib/portage/cache/template.py
index 509f8a2dc..c8351a924 100644
--- a/lib/portage/cache/template.py
+++ b/lib/portage/cache/template.py
@@ -29,7 +29,7 @@ class database:
 		self.readonly = readonly
 		self.sync_rate = 0
 		self.updates = 0
-	
+
 	def __getitem__(self, cpv):
 		"""set a cpv to values
 		This shouldn't be overriden in derived classes since it handles the __eclasses__ conversion.
@@ -255,7 +255,7 @@ class database:
 		"""generic function for walking the entire cache db, matching restrictions to
 		filter what cpv's are returned.  Derived classes should override this if they
 		can implement a faster method then pulling each cpv:values, and checking it.
-		
+
 		For example, RDBMS derived classes should push the matching logic down to the
 		actual RDBM."""
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     04490c92f5713d9634cc1fe3ea7ed4607e9e9ef8
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:24 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:04 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=04490c92

lib/portage/cache/mappings.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/mappings.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/cache/mappings.py b/lib/portage/cache/mappings.py
index 5933981b9..93764e5b8 100644
--- a/lib/portage/cache/mappings.py
+++ b/lib/portage/cache/mappings.py
@@ -1,4 +1,4 @@
-# Copyright: 2005-2019 Gentoo Authors
+# Copyright: 2005-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 # Author(s): Brian Harring (ferringb@gentoo.org)
 
@@ -212,7 +212,7 @@ class ProtectedDict(MutableMapping):
 				self.blacklist[key] = True
 				return
 		raise KeyError(key)
-			
+
 
 	def __iter__(self):
 		for k in self.new:


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-03 23:28 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-03 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     93648e447c4e3b4f1be9b2d0e8ed4503bbf72d68
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 22:43:26 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 23:28:05 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=93648e44

lib/portage/cache/fs_template.py: fix whitespace

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/fs_template.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/cache/fs_template.py b/lib/portage/cache/fs_template.py
index 64050f439..37aac7e42 100644
--- a/lib/portage/cache/fs_template.py
+++ b/lib/portage/cache/fs_template.py
@@ -15,7 +15,7 @@ del lazyimport
 
 
 class FsBased(template.database):
-	"""template wrapping fs needed options, and providing _ensure_access as a way to 
+	"""template wrapping fs needed options, and providing _ensure_access as a way to
 	attempt to ensure files have the specified owners/perms"""
 
 	def __init__(self, *args, **config):


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2020-08-09  3:02 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2020-08-09  3:02 UTC (permalink / raw
  To: gentoo-commits

commit:     db2e846fa244514f72611630f7ba4e343aa71802
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  8 00:25:27 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug  9 00:48:12 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=db2e846f

sqlite: add lazy connection init

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/sqlite.py | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py
index 55ae8f0e5..0395dd516 100644
--- a/lib/portage/cache/sqlite.py
+++ b/lib/portage/cache/sqlite.py
@@ -1,6 +1,7 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import collections
 import re
 
 from portage.cache import fs_template
@@ -23,6 +24,9 @@ class database(fs_template.FsBased):
 	# equation: cache_bytes = page_bytes * page_count
 	cache_bytes = 1024 * 1024 * 10
 
+	_connection_info_entry = collections.namedtuple('_connection_info_entry',
+		('connection', 'cursor'))
+
 	def __init__(self, *args, **config):
 		super(database, self).__init__(*args, **config)
 		self._import_sqlite()
@@ -44,8 +48,8 @@ class database(fs_template.FsBased):
 		# Set longer timeout for throwing a "database is locked" exception.
 		# Default timeout in sqlite3 module is 5.0 seconds.
 		config.setdefault("timeout", 15)
-		self._db_init_connection(config)
-		self._db_init_structures()
+		self._config = config
+		self._db_connection_info = None
 
 	def _import_sqlite(self):
 		# sqlite3 is optional with >=python-2.5
@@ -65,7 +69,20 @@ class database(fs_template.FsBased):
 			s = str(s)
 		return "'%s'" % s.replace("'", "''")
 
-	def _db_init_connection(self, config):
+	@property
+	def _db_cursor(self):
+		if self._db_connection_info is None:
+			self._db_init_connection()
+		return self._db_connection_info.cursor
+
+	@property
+	def _db_connection(self):
+		if self._db_connection_info is None:
+			self._db_init_connection()
+		return self._db_connection_info.connection
+
+	def _db_init_connection(self):
+		config = self._config
 		self._dbpath = self.location + ".sqlite"
 		#if os.path.exists(self._dbpath):
 		#	os.unlink(self._dbpath)
@@ -74,14 +91,16 @@ class database(fs_template.FsBased):
 		try:
 			if not self.readonly:
 				self._ensure_dirs()
-			self._db_connection = self._db_module.connect(
+			connection = self._db_module.connect(
 				database=_unicode_decode(self._dbpath), **connection_kwargs)
-			self._db_cursor = self._db_connection.cursor()
+			cursor = connection.cursor()
+			self._db_connection_info = self._connection_info_entry(connection, cursor)
 			self._db_cursor.execute("PRAGMA encoding = %s" % self._db_escape_string("UTF-8"))
 			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"])
+			self._db_init_structures()
 		except self._db_error as e:
 			raise cache_errors.InitializationError(self.__class__, e)
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2023-10-16  4:57 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2023-10-16  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     67ee41a123770ae389f03abc68d65d3b4d963f30
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 16 03:53:06 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 16 03:54:58 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=67ee41a1

slot_dict_class: Split out _SlotDict base class

This is a prerequisite for pickle support.

Bug: https://bugs.gentoo.org/915834
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/mappings.py | 292 ++++++++++++++++++++++--------------------
 1 file changed, 151 insertions(+), 141 deletions(-)

diff --git a/lib/portage/cache/mappings.py b/lib/portage/cache/mappings.py
index 29df7ba6ef..82ab6991ea 100644
--- a/lib/portage/cache/mappings.py
+++ b/lib/portage/cache/mappings.py
@@ -1,4 +1,4 @@
-# Copyright: 2005-2020 Gentoo Authors
+# Copyright: 2005-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 # Author(s): Brian Harring (ferringb@gentoo.org)
 
@@ -271,6 +271,152 @@ class LazyLoad(Mapping):
     keys = __iter__
 
 
+class _SlotDict:
+    """
+    Base class for classes returned from slot_dict_class.
+    """
+
+    _prefix = ""
+    allowed_keys = frozenset()
+    __slots__ = ("__weakref__",)
+
+    def __init__(self, *args, **kwargs):
+        if len(args) > 1:
+            raise TypeError(
+                "expected at most 1 positional argument, got " + repr(len(args))
+            )
+
+        if args:
+            self.update(args[0])
+
+        if kwargs:
+            self.update(kwargs)
+
+    def __iter__(self):
+        for k, v in self.iteritems():
+            yield k
+
+    def __len__(self):
+        l = 0
+        for i in self.iteritems():
+            l += 1
+        return l
+
+    def iteritems(self):
+        prefix = self._prefix
+        for k in self.allowed_keys:
+            try:
+                yield (k, getattr(self, prefix + k))
+            except AttributeError:
+                pass
+
+    def itervalues(self):
+        for k, v in self.iteritems():
+            yield v
+
+    def __delitem__(self, k):
+        try:
+            delattr(self, self._prefix + k)
+        except AttributeError:
+            raise KeyError(k)
+
+    def __setitem__(self, k, v):
+        setattr(self, self._prefix + k, v)
+
+    def setdefault(self, key, default=None):
+        try:
+            return self[key]
+        except KeyError:
+            self[key] = default
+        return default
+
+    def update(self, *args, **kwargs):
+        if len(args) > 1:
+            raise TypeError(
+                "expected at most 1 positional argument, got " + repr(len(args))
+            )
+        other = None
+        if args:
+            other = args[0]
+        if other is None:
+            pass
+        elif hasattr(other, "iteritems"):
+            # Use getattr to avoid interference from 2to3.
+            for k, v in getattr(other, "iteritems")():
+                self[k] = v
+        elif hasattr(other, "items"):
+            # Use getattr to avoid interference from 2to3.
+            for k, v in getattr(other, "items")():
+                self[k] = v
+        elif hasattr(other, "keys"):
+            for k in other.keys():
+                self[k] = other[k]
+        else:
+            for k, v in other:
+                self[k] = v
+        if kwargs:
+            self.update(kwargs)
+
+    def __getitem__(self, k):
+        try:
+            return getattr(self, self._prefix + k)
+        except AttributeError:
+            raise KeyError(k)
+
+    def get(self, key, default=None):
+        try:
+            return self[key]
+        except KeyError:
+            return default
+
+    def __contains__(self, k):
+        return hasattr(self, self._prefix + k)
+
+    def pop(self, key, *args):
+        if len(args) > 1:
+            raise TypeError(
+                "pop expected at most 2 arguments, got " + repr(1 + len(args))
+            )
+        try:
+            value = self[key]
+        except KeyError:
+            if args:
+                return args[0]
+            raise
+        del self[key]
+        return value
+
+    def popitem(self):
+        try:
+            k, v = self.iteritems().next()
+        except StopIteration:
+            raise KeyError("container is empty")
+        del self[k]
+        return (k, v)
+
+    def copy(self):
+        c = self.__class__()
+        c.update(self)
+        return c
+
+    def clear(self):
+        for k in self.allowed_keys:
+            try:
+                delattr(self, self._prefix + k)
+            except AttributeError:
+                pass
+
+    def __str__(self):
+        return str(dict(self.iteritems()))
+
+    def __repr__(self):
+        return repr(dict(self.iteritems()))
+
+    items = iteritems
+    keys = __iter__
+    values = itervalues
+
+
 _slot_dict_classes = weakref.WeakValueDictionary()
 
 
@@ -296,147 +442,11 @@ def slot_dict_class(keys, prefix="_val_"):
     v = _slot_dict_classes.get((keys_set, prefix))
     if v is None:
 
-        class SlotDict:
+        class LocalSlotDict(_SlotDict):
             allowed_keys = keys_set
             _prefix = prefix
-            __slots__ = ("__weakref__",) + tuple(prefix + k for k in allowed_keys)
-
-            def __init__(self, *args, **kwargs):
-                if len(args) > 1:
-                    raise TypeError(
-                        "expected at most 1 positional argument, got " + repr(len(args))
-                    )
-
-                if args:
-                    self.update(args[0])
-
-                if kwargs:
-                    self.update(kwargs)
-
-            def __iter__(self):
-                for k, v in self.iteritems():
-                    yield k
-
-            def __len__(self):
-                l = 0
-                for i in self.iteritems():
-                    l += 1
-                return l
-
-            def iteritems(self):
-                prefix = self._prefix
-                for k in self.allowed_keys:
-                    try:
-                        yield (k, getattr(self, prefix + k))
-                    except AttributeError:
-                        pass
-
-            def itervalues(self):
-                for k, v in self.iteritems():
-                    yield v
-
-            def __delitem__(self, k):
-                try:
-                    delattr(self, self._prefix + k)
-                except AttributeError:
-                    raise KeyError(k)
-
-            def __setitem__(self, k, v):
-                setattr(self, self._prefix + k, v)
-
-            def setdefault(self, key, default=None):
-                try:
-                    return self[key]
-                except KeyError:
-                    self[key] = default
-                return default
-
-            def update(self, *args, **kwargs):
-                if len(args) > 1:
-                    raise TypeError(
-                        "expected at most 1 positional argument, got " + repr(len(args))
-                    )
-                other = None
-                if args:
-                    other = args[0]
-                if other is None:
-                    pass
-                elif hasattr(other, "iteritems"):
-                    # Use getattr to avoid interference from 2to3.
-                    for k, v in getattr(other, "iteritems")():
-                        self[k] = v
-                elif hasattr(other, "items"):
-                    # Use getattr to avoid interference from 2to3.
-                    for k, v in getattr(other, "items")():
-                        self[k] = v
-                elif hasattr(other, "keys"):
-                    for k in other.keys():
-                        self[k] = other[k]
-                else:
-                    for k, v in other:
-                        self[k] = v
-                if kwargs:
-                    self.update(kwargs)
-
-            def __getitem__(self, k):
-                try:
-                    return getattr(self, self._prefix + k)
-                except AttributeError:
-                    raise KeyError(k)
-
-            def get(self, key, default=None):
-                try:
-                    return self[key]
-                except KeyError:
-                    return default
-
-            def __contains__(self, k):
-                return hasattr(self, self._prefix + k)
-
-            def pop(self, key, *args):
-                if len(args) > 1:
-                    raise TypeError(
-                        "pop expected at most 2 arguments, got " + repr(1 + len(args))
-                    )
-                try:
-                    value = self[key]
-                except KeyError:
-                    if args:
-                        return args[0]
-                    raise
-                del self[key]
-                return value
-
-            def popitem(self):
-                try:
-                    k, v = self.iteritems().next()
-                except StopIteration:
-                    raise KeyError("container is empty")
-                del self[k]
-                return (k, v)
-
-            def copy(self):
-                c = self.__class__()
-                c.update(self)
-                return c
-
-            def clear(self):
-                for k in self.allowed_keys:
-                    try:
-                        delattr(self, self._prefix + k)
-                    except AttributeError:
-                        pass
-
-            def __str__(self):
-                return str(dict(self.iteritems()))
-
-            def __repr__(self):
-                return repr(dict(self.iteritems()))
-
-            items = iteritems
-            keys = __iter__
-            values = itervalues
-
-        v = SlotDict
+            __slots__ = tuple(prefix + k for k in allowed_keys)
+
+        v = LocalSlotDict
         _slot_dict_classes[v.allowed_keys] = v
     return v


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/cache/
@ 2023-10-16  4:57 Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2023-10-16  4:57 UTC (permalink / raw
  To: gentoo-commits

commit:     95a7bace72aff1ee22a1ed3a0960b380e09917d1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 16 03:55:30 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 16 03:55:30 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=95a7bace

slot_dict_class: Fix cache key

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/cache/mappings.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/portage/cache/mappings.py b/lib/portage/cache/mappings.py
index 82ab6991ea..1aacad99a4 100644
--- a/lib/portage/cache/mappings.py
+++ b/lib/portage/cache/mappings.py
@@ -439,7 +439,8 @@ def slot_dict_class(keys, prefix="_val_"):
         keys_set = keys
     else:
         keys_set = frozenset(keys)
-    v = _slot_dict_classes.get((keys_set, prefix))
+    cache_key = (keys_set, prefix)
+    v = _slot_dict_classes.get(cache_key)
     if v is None:
 
         class LocalSlotDict(_SlotDict):
@@ -448,5 +449,5 @@ def slot_dict_class(keys, prefix="_val_"):
             __slots__ = tuple(prefix + k for k in allowed_keys)
 
         v = LocalSlotDict
-        _slot_dict_classes[v.allowed_keys] = v
+        _slot_dict_classes[cache_key] = v
     return v


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-16  4:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-09  3:02 [gentoo-commits] proj/portage:master commit in: lib/portage/cache/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2023-10-16  4:57 Zac Medico
2023-10-16  4:57 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 19:30 Zac Medico
2020-02-03  5:08 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox