Skip to content

Commit 2e0db67

Browse files
committed
bugs: skip hard masked targets
Resolves: #210 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 96c5729 commit 2e0db67

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/pkgdev/scripts/pkgdev_bugs.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ def find_best_match(self, restrict, pkgset: list[package], prefer_semi_stable=Tr
372372
restrict = boolean.AndRestriction(
373373
*restrict,
374374
packages.PackageRestriction("properties", values.ContainmentMatch("live", negate=True)),
375+
packages.OrRestriction(*self.options.search_repo.pkg_masks, negate=True),
375376
)
376377
# prefer using user selected targets
377378
if intersect := tuple(filter(restrict.match, self.targets)):
@@ -464,6 +465,7 @@ def _find_dependencies(self, pkg: package, keywords: set[str]):
464465
def load_targets(self, targets: list[tuple[str, str]]):
465466
result = []
466467
search_repo = self.options.search_repo
468+
masked = packages.OrRestriction(*self.options.search_repo.pkg_masks)
467469
for _, target in targets:
468470
try:
469471
pkgset = search_repo.match(target)
@@ -474,6 +476,13 @@ def load_targets(self, targets: list[tuple[str, str]]):
474476
break
475477
else: # no stablereq
476478
continue
479+
if masked.match(target):
480+
self.err.write(
481+
self.err.fg("yellow"),
482+
f"Target {target} is masked, skipping",
483+
self.err.reset,
484+
)
485+
continue
477486
result.append(self.find_best_match([target], pkgset, False))
478487
except (ValueError, IndexError):
479488
bugs.error(f"Restriction {target} has no match in repository", status=3)

0 commit comments

Comments
 (0)