Skip to content

Commit

Permalink
Removes aliasing for namespaces that affected maven (#350)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Sep 22, 2024
1 parent d60e8d3 commit b4b9459
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions depscan/lib/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,6 @@ def create_pkg_variations(pkg_dict):
vendor_aliases.add(vendor)
vendor_aliases.add(vendor.lower())
vendor_aliases.add(vendor.lstrip("@"))
if (
vendor.startswith("org.")
or vendor.startswith("io.")
or vendor.startswith("com.")
or vendor.startswith("net.")
):
tmp_a = vendor.split(".")
# Automatically add short vendor forms
if len(tmp_a) > 1 and len(tmp_a[1]) > 6:
if tmp_a[1] != name:
vendor_aliases.add(tmp_a[1])
# Add some common vendor aliases
if purl.startswith("pkg:golang") and not name.startswith("go"):
vendor_aliases.add("go")
Expand Down
2 changes: 1 addition & 1 deletion test/test_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_pkg_variations():
pkg_list = create_pkg_variations(
{"vendor": "org.eclipse.foo", "name": "bar", "version": "1.0.0"}
)
assert len(pkg_list) > 1
assert len(pkg_list) == 1
pkg_list = create_pkg_variations(
{
"vendor": "com.fasterxml.jackson.core",
Expand Down

0 comments on commit b4b9459

Please sign in to comment.