Skip to content

Commit e7c412f

Browse files
committed
tatt: don't let IUSE defaults override the profile
_build_job unioned the ebuild's +flag defaults over the domain's enabled use flags to build a package's default configuration. But pkgcore already folds those in at their proper priority; get_package_use_unconfigured hands them to enabled_use.pull_data as pre_defaults, below the profile and package.use, then drops the masked ones; so unioning them back on top reinstated exactly the flags the profile had turned off. x11-misc/sddm carries IUSE="+elogind systemd" with REQUIRED_USE="^^ ( elogind systemd )". On a systemd profile elogind is use.masked and enabled holds systemd, but the union put elogind back, leaving the solver to break the ^^ against the profile: --use-default emitted TUSE="-systemd elogind". Drop default_on_iuse and use enabled alone, which also matches _groupby_use_expand, already taking it as the baseline for what to print. Resolves: #183 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent b5369df commit e7c412f

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

NEWS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ pkgdev 0.2.17 (unreleased)
3434
solve the dependency there. Versions already stable (or already keyworded,
3535
for a keywordreq) on a failing arch are now passed over (Arthur Zamarin, #186)
3636

37+
**pkgdev tatt:**
38+
39+
- tatt: fix ebuild ``IUSE`` defaults overriding the profile when deciding a
40+
package's default USE configuration (Arthur Zamarin, #183)
41+
3742
pkgdev 0.2.16 (2026-07-31)
3843
--------------------------
3944

src/pkgdev/scripts/pkgdev_tatt.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ def _groupby_use_expand(
280280

281281
def _build_job(namespace, pkg, is_test: bool):
282282
use_expand_prefixes = tuple(s.lower() + "_" for s in namespace.domain.profile.use_expand)
283-
default_on_iuse = tuple(use[1:] for use in pkg.iuse if use.startswith("+"))
284283
immutable, enabled, _disabled = namespace.domain.get_package_use_unconfigured(pkg)
285284

286285
iuse = frozenset(pkg.iuse_stripped)
287286
force_true = immutable.union(("test",) if is_test else ())
288287
force_false = ("test",) if not is_test else ()
289288

290289
if namespace.random_use == "d":
291-
prefer_true = enabled.union(default_on_iuse)
290+
prefer_true = enabled
292291
elif namespace.random_use in "rR":
293292
ignore_prefixes = set(namespace.ignore_prefixes)
294293
if namespace.random_use == "r":
@@ -303,9 +302,7 @@ def _build_job(namespace, pkg, is_test: bool):
303302
if prefer_true:
304303
random.shuffle(prefer_true)
305304
prefer_true = prefer_true[: random.randint(0, len(prefer_true) - 1)]
306-
prefer_true.extend(
307-
use for use in enabled.union(default_on_iuse) if use.startswith(ignore_prefixes)
308-
)
305+
prefer_true.extend(use for use in enabled if use.startswith(ignore_prefixes))
309306

310307
# only flags REQUIRED_USE mentions need solving; the rest can't violate it
311308
constrained = frozenset(iter_flags(pkg.required_use))

0 commit comments

Comments
 (0)