File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -513,6 +513,20 @@ def build_swift_download_url(purl):
513513 return f"https://{ namespace } /{ name } /archive/{ version } .zip"
514514
515515
516+ @download_router .route ("pkg:luarocks/.*" )
517+ def build_luarocks_download_url (purl ):
518+ """
519+ Return a LuaRocks download URL from the `purl` string.
520+ """
521+ purl_data = PackageURL .from_string (purl )
522+
523+ name = purl_data .name
524+ version = purl_data .version
525+
526+ if name and version :
527+ return f"https://luarocks.org/{ name } -{ version } .src.rock"
528+
529+
516530def get_repo_download_url (purl ):
517531 """
518532 Return ``download_url`` if present in ``purl`` qualifiers or
Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ def test_purl2url_get_download_url():
105105 "pkg:pub/http@0.13.3" : "https://pub.dev/api/archives/http-0.13.3.tar.gz" ,
106106 "pkg:swift/github.com/Alamofire/Alamofire@5.4.3" : "https://github.com/Alamofire/Alamofire/archive/5.4.3.zip" ,
107107 "pkg:swift/github.com/RxSwiftCommunity/RxFlow@2.12.4" : "https://github.com/RxSwiftCommunity/RxFlow/archive/2.12.4.zip" ,
108+ "pkg:luarocks/luasocket@3.1.0-1" : "https://luarocks.org/luasocket-3.1.0-1.src.rock" ,
109+ "pkg:luarocks/hisham/luafilesystem@1.8.0-1" : "https://luarocks.org/luafilesystem-1.8.0-1.src.rock" ,
108110 # From `download_url` qualifier
109111 "pkg:github/yarnpkg/yarn@1.3.2?download_url=https://github.com/yarnpkg/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz&version_prefix=v" : "https://github.com/yarnpkg/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz" ,
110112 "pkg:generic/lxc-master.tar.gz?download_url=https://salsa.debian.org/lxc-team/lxc/-/archive/master/lxc-master.tar.gz" : "https://salsa.debian.org/lxc-team/lxc/-/archive/master/lxc-master.tar.gz" ,
You can’t perform that action at this time.
0 commit comments