Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
fix regex search
Browse files Browse the repository at this point in the history
  • Loading branch information
JimFuller-RedHat committed Jan 22, 2024
1 parent 5ddeafe commit c607f67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 1 addition & 6 deletions griffon/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,7 @@ def text_output_products_contain_component(
)
ctx.exit()

# if -r option used we need to escape it
search_component_name = (
re.escape(ctx.params["component_name"])
if not ctx.obj["REGEX_NAME_SEARCH"]
else ctx.params["component_name"]
)
search_component_name = ctx.params["component_name"]

# handle multiple components
if "results" in output and output["count"] > 0:
Expand Down
5 changes: 2 additions & 3 deletions griffon/services/core_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,7 @@ def execute(self, status=None) -> List[Dict[str, Any]]:
"include_fields": "purl,type,name,related_url,namespace,software_build,nvr,release,version,arch,product_streams.product_versions,product_streams.name,product_streams.ofuri,product_streams.active,product_streams.exclude_components,product_streams.relations", # noqa
}

component_name = (
re.escape(self.component_name) if not self.regex_name_search else self.component_name
)
component_name = self.component_name

if self.search_latest:
search_latest_params = copy.deepcopy(params)
Expand Down Expand Up @@ -427,6 +425,7 @@ def execute(self, status=None) -> List[Dict[str, Any]]:
latest_components,
):
results.append(processed_component)

if not self.no_community:
status.update("searching latest community provided child component(s).")
community_component_cnt = self.community_session.components.count(
Expand Down
3 changes: 3 additions & 0 deletions scripts/smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,7 @@ griffon service component-flaws python-marshmallow --affectedness AFFECTED
griffon service products-contain-component --search-all --search-upstreams -s libxml2 -a
griffon service products-contain-component -s grep -v --search-all
griffon service products-contain-component -r 'webkit.tk' -vv
griffon service products-contain-component -r "webkit(2|3)gtk" --search-all
griffon service products-contain-component webkitgtk4-jsc --include-product-streams-excluded-components --include-inactive-product-streams --no-community --no-filter-rh-naming -vv

griffon service products-contain-component -s bind-libs-lite --search-all

0 comments on commit c607f67

Please sign in to comment.