2727
2828from fetchcode .package_util import GITHUB_SOURCE_BY_PACKAGE
2929from fetchcode .package_util import IPKG_RELEASES
30+ from fetchcode .package_util import UDHCP_RELEASES
31+ from fetchcode .package_util import ErofsUtilsGitHubSource
3032from fetchcode .package_util import GitHubSource
3133from fetchcode .package_util import MiniupnpPackagesGitHubSource
34+ from fetchcode .package_util import OpenSSLGitHubSource
3235from fetchcode .packagedcode_models import Package
3336from fetchcode .utils import get_response
3437
@@ -242,7 +245,25 @@ def get_github_data_for_miniupnp(purl):
242245 )
243246
244247
245- @router .route ("pkg:generic/erofs-utils.*" ,)
248+ @router .route (
249+ "pkg:openssl/openssl.*" ,
250+ )
251+ def get_github_data_for_openssl (purl ):
252+ """
253+ Yield `Package` object for OpenSSL package from GitHub.
254+ """
255+ generic_purl = PackageURL .from_string (purl )
256+ github_repo_purl = PackageURL (
257+ type = "github" ,
258+ namespace = "openssl" ,
259+ name = "openssl" ,
260+ version = generic_purl .version ,
261+ )
262+
263+ return OpenSSLGitHubSource .get_package_info (github_repo_purl )
264+
265+
266+ @router .route ("pkg:generic/erofs-utils.*" )
246267def get_github_data_for_erofs_utils (purl ):
247268 """
248269 Yield `Package` object for erofs-utils package from GitHub.
@@ -255,7 +276,7 @@ def get_github_data_for_erofs_utils(purl):
255276 version = generic_purl .version ,
256277 )
257278
258- return GitHubSource .get_package_info (github_repo_purl )
279+ return ErofsUtilsGitHubSource .get_package_info (github_repo_purl )
259280
260281
261282@router .route ("pkg:bitbucket/.*" )
@@ -384,6 +405,37 @@ def get_package_info(cls, package_url):
384405 )
385406
386407
408+ # The udhcp is no longer maintained as a standalone project.
409+ # It has been fully integrated into busybox.
410+ class UdhcpDirectoryListedSource (DirectoryListedSource ):
411+ source_url = (
412+ "https://web.archive.org/web/20021209021312/http://udhcp.busybox.net/source/"
413+ )
414+
415+ @classmethod
416+ def get_package_info (cls , package_url ):
417+
418+ version = package_url .version
419+ if version and version in UDHCP_RELEASES :
420+ archive = UDHCP_RELEASES [version ]
421+ yield Package (
422+ homepage_url = cls .source_url ,
423+ download_url = archive ["url" ],
424+ release_date = archive ["date" ],
425+ ** package_url .to_dict (),
426+ )
427+
428+ else :
429+ for version , data in UDHCP_RELEASES .items ():
430+ purl = PackageURL (type = "generic" , name = "udhcp" , version = version )
431+ yield Package (
432+ homepage_url = cls .source_url ,
433+ download_url = data ["url" ],
434+ release_date = data ["date" ],
435+ ** purl .to_dict (),
436+ )
437+
438+
387439class IpkgDirectoryListedSource (DirectoryListedSource ):
388440 source_url = "https://web.archive.org/web/20090326020239/http://handhelds.org/download/packages/ipkg/"
389441 is_nested = False
@@ -612,6 +664,7 @@ class BareboxDirectoryListedSource(DirectoryListedSource):
612664 is_nested = False
613665 ignored_files_and_dir = []
614666
667+
615668class LinuxDirectoryListedSource (DirectoryListedSource ):
616669 source_url = "https://cdn.kernel.org/pub/linux/kernel/"
617670 # Source archive ex: linux-1.2.3.tar.gz
@@ -631,8 +684,11 @@ class LinuxDirectoryListedSource(DirectoryListedSource):
631684 "uemacs/" ,
632685 ]
633686
687+
634688class E2fsprogsDirectoryListedSource (DirectoryListedSource ):
635- source_url = "https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
689+ source_url = (
690+ "https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
691+ )
636692 # Source archive ex: e2fsprogs-1.2.3.tar.gz
637693 source_archive_regex = re .compile (r"^(e2fsprogs-)(?P<version>[\w.-]*)(.tar.gz)$" )
638694 is_nested = True
@@ -665,6 +721,7 @@ class E2fsprogsDirectoryListedSource(DirectoryListedSource):
665721 "pkg:generic/barebox.*" ,
666722 "pkg:generic/linux.*" ,
667723 "pkg:generic/e2fsprogs.*" ,
724+ "pkg:generic/udhcp.*" ,
668725]
669726
670727DIR_LISTED_SOURCE_BY_PACKAGE_NAME = {
@@ -692,6 +749,7 @@ class E2fsprogsDirectoryListedSource(DirectoryListedSource):
692749 "barebox" : BareboxDirectoryListedSource ,
693750 "linux" : LinuxDirectoryListedSource ,
694751 "e2fsprogs" : E2fsprogsDirectoryListedSource ,
752+ "udhcp" : UdhcpDirectoryListedSource ,
695753}
696754
697755
0 commit comments