commit: 98f5962a96610636dd8d83a0b3506795e3d4a732
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Mon Feb 16 14:31:15 2026 +0000
Commit: Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Mon Feb 16 14:32:39 2026 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=98f5962a
Revert "rename snakeoil.sequences.{stable_unique -> unique_stable}"
This reverts commit b74cb79f0f46e6c7322a7098bbf5741c25889d68.
I've not ran down the 'why' yet, but this is breaking filtration
for a lot of pquery invocations. For example, `pquery linux-firmware`
without this reversion is just 20250211- with this reversion, it shows
all versions that should be visible.
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
src/pkgcore/ebuild/domain.py | 12 ++++++------
src/pkgcore/ebuild/eapi.py | 4 ++--
src/pkgcore/ebuild/profiles.py | 4 ++--
src/pkgcore/ebuild/repository.py | 4 ++--
src/pkgcore/ebuild/triggers.py | 10 +++++-----
src/pkgcore/repository/virtual.py | 1 +
src/pkgcore/scripts/pinspect.py | 4 ++--
src/pkgcore/scripts/pmerge.py | 4 ++--
src/pkgcore/system/libtool.py | 8 ++++----
src/pkgcore/util/commandline.py | 4 ++--
10 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/src/pkgcore/ebuild/domain.py b/src/pkgcore/ebuild/domain.py
index 98b02d60..f8eb69cc 100644
--- a/src/pkgcore/ebuild/domain.py
+++ b/src/pkgcore/ebuild/domain.py
@@ -24,7 +24,7 @@ from snakeoil.data_source import local_source
from snakeoil.log import suppress_logging
from snakeoil.mappings import ImmutableDict, ProtectedDict
from snakeoil.process.spawn import spawn_get_output
-from snakeoil.sequences import predicate_split, split_negations, unique_stable
+from snakeoil.sequences import predicate_split, split_negations, stable_unique
from ..binpkg import repository as binary_repo
from ..cache.flat_hash import md5_cache
@@ -301,7 +301,7 @@ class domain(config_domain):
def system_shell_profile(self, data):
# prepend system profile $PATH if it exists
if "PATH" in data:
- path = unique_stable(
+ path = stable_unique(
data["PATH"].split(os.pathsep) +
os.environ["PATH"].split(os.pathsep)
)
os.environ["PATH"] = os.pathsep.join(path)
@@ -457,25 +457,25 @@ class domain(config_domain):
def pkg_keywords(self, data, debug=False):
if debug:
return tuple(data)
- return tuple((x[0], unique_stable(x[1])) for x in data)
+ return tuple((x[0], stable_unique(x[1])) for x in data)
@load_property("package.accept_keywords",
parse_func=restriction_payload_splitter)
def pkg_accept_keywords(self, data, debug=False):
if debug:
return tuple(data)
- return tuple((x[0], unique_stable(x[1])) for x in data)
+ return tuple((x[0], stable_unique(x[1])) for x in data)
@load_property("package.license", parse_func=restriction_payload_splitter)
def pkg_licenses(self, data, debug=False):
if debug:
return tuple(data)
- return tuple((x[0], unique_stable(x[1])) for x in data)
+ return tuple((x[0], stable_unique(x[1])) for x in data)
@load_property("package.use", parse_func=package_use_splitter)
def pkg_use(self, data, debug=False):
if debug:
return tuple(data)
- return tuple((x[0], split_negations(unique_stable(x[1]))) for x in
data)
+ return tuple((x[0], split_negations(stable_unique(x[1]))) for x in
data)
@load_property("package.env")
def pkg_env(self, data, debug=False):
diff --git a/src/pkgcore/ebuild/eapi.py b/src/pkgcore/ebuild/eapi.py
index b5bd137f..b9de80f5 100644
--- a/src/pkgcore/ebuild/eapi.py
+++ b/src/pkgcore/ebuild/eapi.py
@@ -12,7 +12,7 @@ from snakeoil import klass
from snakeoil.delayed import regexp
from snakeoil.mappings import ImmutableDict, OrderedFrozenSet,
inject_getitem_as_getattr
from snakeoil.process.spawn import bash_version
-from snakeoil.sequences import unique_stable
+from snakeoil.sequences import stable_unique
from ..log import logger
from . import atom, const
@@ -466,7 +466,7 @@ class EAPI(metaclass=klass.immutable_instance):
paths[phase].append(dirpath)
else:
raise ValueError(f"unknown phase: {phase!r}")
- return ImmutableDict((k, tuple(unique_stable(v))) for k, v in
paths.items())
+ return ImmutableDict((k, tuple(stable_unique(v))) for k, v in
paths.items())
@klass.jit_attr
def ebd_env(self):
diff --git a/src/pkgcore/ebuild/profiles.py b/src/pkgcore/ebuild/profiles.py
index 26196ff7..9fb0e1dd 100644
--- a/src/pkgcore/ebuild/profiles.py
+++ b/src/pkgcore/ebuild/profiles.py
@@ -18,7 +18,7 @@ from snakeoil.bash import read_bash, read_bash_dict
from snakeoil.data_source import local_source
from snakeoil.fileutils import readlines_utf8
from snakeoil.mappings import ImmutableDict
-from snakeoil.sequences import split_negations, unique_stable
+from snakeoil.sequences import split_negations, stable_unique
from ..config import errors
from ..config.hint import ConfigHint
@@ -341,7 +341,7 @@ class ProfileNode(metaclass=caching.WeakInstMeta):
for line, lineno, relpath in iterable:
v = line.split()
try:
- yield (atom(v[0]), tuple(unique_stable(v[1:])))
+ yield (atom(v[0]), tuple(stable_unique(v[1:])))
except ebuild_errors.MalformedAtom as e:
logger.error(f"{relpath!r}, line {lineno}: parsing error: {e}")
diff --git a/src/pkgcore/ebuild/repository.py b/src/pkgcore/ebuild/repository.py
index 4cb8363a..f3a5fd47 100644
--- a/src/pkgcore/ebuild/repository.py
+++ b/src/pkgcore/ebuild/repository.py
@@ -21,7 +21,7 @@ from snakeoil.fileutils import readlines_utf8
from snakeoil.mappings import ImmutableDict
from snakeoil.obj import make_kls
from snakeoil.osutils import listdir_dirs, listdir_files
-from snakeoil.sequences import iflatten_instance, unique_stable
+from snakeoil.sequences import iflatten_instance, stable_unique
from snakeoil.strings import pluralism
from .. import fetch
@@ -892,7 +892,7 @@ class ConfiguredTree(configured.tree):
@_wrap_attr(config_wrappables)
def _distfiles(self, raw_pkg_distfiles, enabled_use, pkg):
"""Distfiles used by a package."""
- return
tuple(unique_stable(raw_pkg_distfiles.evaluate_depset(enabled_use)))
+ return
tuple(stable_unique(raw_pkg_distfiles.evaluate_depset(enabled_use)))
@_wrap_attr(config_wrappables)
def _user_patches(self, _raw_pkg_patches, _enabled_use, pkg):
diff --git a/src/pkgcore/ebuild/triggers.py b/src/pkgcore/ebuild/triggers.py
index 08493ab2..85bc4110 100644
--- a/src/pkgcore/ebuild/triggers.py
+++ b/src/pkgcore/ebuild/triggers.py
@@ -23,7 +23,7 @@ from os.path import normpath
from snakeoil.bash import read_bash_dict
from snakeoil.fileutils import AtomicWriteFile
from snakeoil.osutils import listdir_files
-from snakeoil.sequences import iflatten_instance, unique_stable
+from snakeoil.sequences import iflatten_instance, stable_unique
from .. import os_data
from ..fs import livefs
@@ -206,13 +206,13 @@ def gen_config_protect_filter(offset, extra_protects=(),
extra_disables=()):
r = [
values.StrGlobMatch(normpath(x).rstrip("/") + "/")
- for x in set(unique_stable(collapsed_d["CONFIG_PROTECT"] + ["/etc"]))
+ for x in set(stable_unique(collapsed_d["CONFIG_PROTECT"] + ["/etc"]))
]
if len(r) > 1:
r = values.OrRestriction(*r)
else:
r = r[0]
- neg = unique_stable(collapsed_d["CONFIG_PROTECT_MASK"])
+ neg = stable_unique(collapsed_d["CONFIG_PROTECT_MASK"])
if neg:
if len(neg) == 1:
r2 = values.StrGlobMatch(normpath(neg[0]).rstrip("/") + "/",
negate=True)
@@ -231,11 +231,11 @@ def gen_collision_ignore_filter(offset, extra_ignores=()):
ignored.extend(extra_ignores)
ignored.extend(["*/.keep", "*/.keep_*"])
- ignored = unique_stable(ignored)
+ ignored = stable_unique(ignored)
for i, x in enumerate(ignored):
if not x.endswith("/*") and os.path.isdir(x):
ignored[i] = ignored.rstrip("/") + "/*"
- ignored = [values.StrRegex(fnmatch.translate(x)) for x in
unique_stable(ignored)]
+ ignored = [values.StrRegex(fnmatch.translate(x)) for x in
stable_unique(ignored)]
if len(ignored) == 1:
return ignored[0]
return values.OrRestriction(*ignored)
diff --git a/src/pkgcore/repository/virtual.py
b/src/pkgcore/repository/virtual.py
index b3a85f1d..51a70698 100644
--- a/src/pkgcore/repository/virtual.py
+++ b/src/pkgcore/repository/virtual.py
@@ -5,6 +5,7 @@ virtual repository, pkgs generated via callable
__all__ = ("tree", "RestrictionRepo")
from snakeoil.compatibility import cmp
+from snakeoil.sequences import stable_unique
from ..ebuild import atom
from ..ebuild.conditionals import DepSet
diff --git a/src/pkgcore/scripts/pinspect.py b/src/pkgcore/scripts/pinspect.py
index 317362fc..9a950756 100644
--- a/src/pkgcore/scripts/pinspect.py
+++ b/src/pkgcore/scripts/pinspect.py
@@ -21,7 +21,7 @@ from operator import attrgetter, itemgetter
import snakeoil.formatters
from snakeoil.cli import arghparse
-from snakeoil.sequences import iflatten_instance
+from snakeoil.sequences import iflatten_instance, unstable_unique
from .. import fetch
from ..ebuild import inspect_profile
@@ -264,7 +264,7 @@ class license_usage_kls(histo_data):
data = {}
pos = 0
for pos, pkg in enumerate(repo):
- for license in set(iflatten_instance(pkg.license)):
+ for license in unstable_unique(iflatten_instance(pkg.license)):
data.setdefault(license, 0)
data[license] += 1
return data, pos + 1
diff --git a/src/pkgcore/scripts/pmerge.py b/src/pkgcore/scripts/pmerge.py
index 4f3c5b4d..b67a60e0 100644
--- a/src/pkgcore/scripts/pmerge.py
+++ b/src/pkgcore/scripts/pmerge.py
@@ -11,7 +11,7 @@ from textwrap import dedent
from time import time
from snakeoil.cli.exceptions import ExitException
-from snakeoil.sequences import iflatten_instance, unique_stable
+from snakeoil.sequences import iflatten_instance, stable_unique
from snakeoil.strings import pluralism
from ..config.basics import ConfigSectionFromStringDict
@@ -865,7 +865,7 @@ def main(options, out, err):
err.write(f"{options.prog}: no targets specified; nothing to do")
return 1
- atoms = unique_stable(atoms)
+ atoms = stable_unique(atoms)
if options.force_stable_ordering_of_targets:
atoms = sorted(atoms)
diff --git a/src/pkgcore/system/libtool.py b/src/pkgcore/system/libtool.py
index 24807941..84ecc39e 100644
--- a/src/pkgcore/system/libtool.py
+++ b/src/pkgcore/system/libtool.py
@@ -5,7 +5,7 @@ from functools import partial
from os.path import basename, dirname
from snakeoil.currying import post_curry
-from snakeoil.sequences import unique_stable
+from snakeoil.sequences import stable_unique
from ..exceptions import PkgcoreException
from ..merge import triggers
@@ -68,7 +68,7 @@ def rewrite_lafile(handle, filename):
rpaths, libs, libladirs, inherited_flags = [], [], [], []
original_inherited_flags = data.get("inherited_linker_flags", [])
- for item in unique_stable(original_libs):
+ for item in stable_unique(original_libs):
if item.startswith("-l"):
libs.append(item)
elif item.endswith(".la"):
@@ -95,8 +95,8 @@ def rewrite_lafile(handle, filename):
libs.append(item)
else:
raise UnknownData(raw_dep_libs, item)
- libs = unique_stable(rpaths + libladirs + libs)
- inherited_flags = unique_stable(inherited_flags)
+ libs = stable_unique(rpaths + libladirs + libs)
+ inherited_flags = stable_unique(inherited_flags)
if libs == original_libs and inherited_flags == original_inherited_flags:
return False, None
diff --git a/src/pkgcore/util/commandline.py b/src/pkgcore/util/commandline.py
index ab34fb5d..c960d3ec 100644
--- a/src/pkgcore/util/commandline.py
+++ b/src/pkgcore/util/commandline.py
@@ -20,7 +20,7 @@ from os.path import join as pjoin
from snakeoil import modules
from snakeoil.cli import arghparse, tool
from snakeoil.log import suppress_logging
-from snakeoil.sequences import iflatten_instance
+from snakeoil.sequences import iflatten_instance, unstable_unique
from snakeoil.strings import pluralism
from .. import const
@@ -335,7 +335,7 @@ class StoreRepoObject(StoreConfigObject):
If a repo doesn't have a proper location just the name is returned.
"""
- for repo_name, repo in sorted(set(sections.items())):
+ for repo_name, repo in sorted(unstable_unique(sections.items())):
repo_name = getattr(repo, "repo_id", repo_name)
if hasattr(repo, "location"):
yield f"{repo_name}:{repo.location}"