diff --git a/src/packageurl/contrib/purl2url.py b/src/packageurl/contrib/purl2url.py index 58a321e..c9425a2 100644 --- a/src/packageurl/contrib/purl2url.py +++ b/src/packageurl/contrib/purl2url.py @@ -185,6 +185,7 @@ def build_rubygems_repo_url(purl): elif name: return f"https://rubygems.org/gems/{name}" + @repo_router.route("pkg:cran/.*") def build_cran_repo_url(purl): """ diff --git a/src/packageurl/contrib/url2purl.py b/src/packageurl/contrib/url2purl.py index 784162a..7356a0d 100644 --- a/src/packageurl/contrib/url2purl.py +++ b/src/packageurl/contrib/url2purl.py @@ -284,9 +284,7 @@ def build_rubygems_purl(uri): "https?://packagemanager.rstudio.com/cran/.*", ) def build_cran_purl(uri): - cran_pattern = ( - r"^https?://(cran\.r-project\.org|packagemanager\.rstudio\.com/cran)/.*?src/contrib/(?P.+)_(?P.+)\.tar.gz$" - ) + cran_pattern = r"^https?://(cran\.r-project\.org|packagemanager\.rstudio\.com/cran)/.*?src/contrib/(?P.+)_(?P.+)\.tar.gz$" qualifiers = {} if "//cran.r-project.org/" not in uri: qualifiers["download_url"] = uri