def matcher(package: Package, package_context: PackageContext, match_context: MatchContext) -> bool: match = namepat_re.fullmatch(package.effname) if match is not None: match_context.name_match = match return True return False
def matcher(package: Package, package_context: PackageContext, match_context: MatchContext) -> bool: match = verpat.fullmatch(package.version.lower()) if match is not None: match_context.ver_match = match return True return False
def match(self, package: Package, package_context: PackageContext) -> MatchContext | None: match_context = MatchContext() for matcher in self._matchers: if not matcher(package, package_context, match_context): return None package_context.add_matched_rule(self.number) return match_context
def action(package: Package, package_context: PackageContext, match_context: MatchContext) -> None: flavors: list[str] = want_flavors if want_flavors else [ package.effname ] flavors = [ match_context.sub_name_dollars(flavor, package.effname) for flavor in flavors ] flavors = [flavor.strip('-') for flavor in flavors] package.flavors += [flavor for flavor in flavors if flavor]
def action(package: Package, package_context: PackageContext, match_context: MatchContext) -> None: package.subrepo = match_context.sub_name_dollars( setsubrepo, package.effname)
def action(package: Package, package_context: PackageContext, match_context: MatchContext) -> None: package.version = match_context.sub_ver_dollars( setver, package.version)
def action(package: Package, package_context: PackageContext, match_context: MatchContext) -> None: match_context.last = True