Skip to content

Commit 7f2f273

Browse files
committed
Add support for APK download URLs
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 25143f5 commit 7f2f273

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/packageurl/contrib/purl2url.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,11 @@ def build_apk_download_url(purl):
674674
repo = purl.qualifiers.get("repo")
675675
alpine_version = purl.qualifiers.get("alpine_version")
676676

677+
if not name or not version or not arch or not repo or not alpine_version:
678+
raise ValueError(
679+
"All qualifiers (arch, repo, alpine_version) and name/version must be present in apk purl"
680+
)
681+
677682
return (
678683
f"https://dl-cdn.alpinelinux.org/alpine/{alpine_version}/{repo}/{arch}/{name}-{version}.apk"
679684
)

0 commit comments

Comments
 (0)