From 298e82110091c765f67776a18091d0f8369a787d Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 27 Mar 2024 10:18:12 +0530 Subject: [PATCH] Add metadata support for linux kernel Signed-off-by: Keshav Priyadarshi --- src/fetchcode/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/fetchcode/package.py b/src/fetchcode/package.py index 2d8bb787..3994c22d 100644 --- a/src/fetchcode/package.py +++ b/src/fetchcode/package.py @@ -574,6 +574,24 @@ class BareboxDirectoryListedSource(DirectoryListedSource): is_nested = False ignored_files_and_dir = [] +class LinuxDirectoryListedSource(DirectoryListedSource): + source_url = "https://cdn.kernel.org/pub/linux/kernel/" + source_archive_regex = re.compile(r"^(linux-)(?P[\w.-]*)(.tar.gz)$") + is_nested = True + ignored_files_and_dir = [ + "Historic/", + "SillySounds/", + "crypto/", + "firmware/", + "next/", + "people/", + "ports/", + "projects/", + "testing/", + "tools/", + "uemacs/", + ] + DIR_SUPPORTED_PURLS = [ "pkg:generic/busybox.*", @@ -599,6 +617,7 @@ class BareboxDirectoryListedSource(DirectoryListedSource): "pkg:generic/ipkg.*", "pkg:generic/mtd-utils.*", "pkg:generic/barebox.*", + "pkg:generic/linux.*" ] DIR_LISTED_SOURCE_BY_PACKAGE_NAME = { @@ -624,6 +643,7 @@ class BareboxDirectoryListedSource(DirectoryListedSource): "ipkg": IpkgDirectoryListedSource, "mtd-utils": MtdUtilsDirectoryListedSource, "barebox": BareboxDirectoryListedSource, + "linux": LinuxDirectoryListedSource, }