Return the base path to a Package directory (ignoring version) for a purl
(purl: Union[PackageURL, str])
| 140 | |
| 141 | |
| 142 | def get_package_base_dir(purl: Union[PackageURL, str]): |
| 143 | """ |
| 144 | Return the base path to a Package directory (ignoring version) for a purl |
| 145 | """ |
| 146 | if isinstance(purl, str): |
| 147 | purl = PackageURL.from_string(purl) |
| 148 | |
| 149 | path_elements = package_path_elements(purl) |
| 150 | phash, core_path, _pversion, _extra_path = path_elements |
| 151 | return Path(f"{PACKAGE_REPOS_NAME_PREFIX}-{purl.type}-{phash}") / core_path |
| 152 | |
| 153 | |
| 154 | def get_package_purls_yml_file_path(purl: Union[PackageURL, str]): |
no test coverage detected