From e10c37d66e671e28505eab8089c43309b2115236 Mon Sep 17 00:00:00 2001 From: jfuller Date: Mon, 22 Jan 2024 11:47:17 +0100 Subject: [PATCH] fix regex search --- griffon/output.py | 7 +------ griffon/services/core_queries.py | 5 ++--- scripts/smoke-tests.sh | 3 +++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/griffon/output.py b/griffon/output.py index 1bb74f7..803f8d6 100644 --- a/griffon/output.py +++ b/griffon/output.py @@ -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: diff --git a/griffon/services/core_queries.py b/griffon/services/core_queries.py index 58a7c4a..b66b4ce 100644 --- a/griffon/services/core_queries.py +++ b/griffon/services/core_queries.py @@ -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) @@ -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( diff --git a/scripts/smoke-tests.sh b/scripts/smoke-tests.sh index 73582af..57addb0 100755 --- a/scripts/smoke-tests.sh +++ b/scripts/smoke-tests.sh @@ -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 "webkitgtk(3|100)" --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