11# fetchcode is a free software tool from nexB Inc. and others.
2- # Visit https://github.com/nexB /fetchcode for support and download.
2+ # Visit https://github.com/aboutcode-org /fetchcode for support and download.
33#
44# Copyright (c) nexB Inc. and others. All rights reserved.
55# http://nexb.com and http://aboutcode.org
@@ -92,7 +92,8 @@ def get_cargo_data_from_purl(purl):
9292 )
9393 versions = response .get ("versions" , [])
9494 for version in versions :
95- version_purl = PackageURL (type = purl .type , name = name , version = version .get ("num" ))
95+ version_purl = PackageURL (
96+ type = purl .type , name = name , version = version .get ("num" ))
9697 dl_path = version .get ("dl_path" )
9798 if dl_path :
9899 download_url = f"{ base_url } /{ dl_path } "
@@ -355,7 +356,8 @@ def get_gnu_data_from_purl(purl):
355356 purl = PackageURL .from_string (purl )
356357 source_archive_url = f"https://ftp.gnu.org/pub/gnu/{ purl .name } /"
357358 version_regex_template = r"^({}-)(?P<version>[\w.-]*)(.tar.gz)$"
358- version_regex = re .compile (version_regex_template .format (re .escape (purl .name )))
359+ version_regex = re .compile (
360+ version_regex_template .format (re .escape (purl .name )))
359361
360362 yield from extract_packages_from_listing (
361363 purl , source_archive_url , version_regex , []
@@ -427,7 +429,8 @@ def get_package_info(cls, package_url):
427429
428430 else :
429431 for version , data in UDHCP_RELEASES .items ():
430- purl = PackageURL (type = "generic" , name = "udhcp" , version = version )
432+ purl = PackageURL (
433+ type = "generic" , name = "udhcp" , version = version )
431434 yield Package (
432435 homepage_url = cls .source_url ,
433436 download_url = data ["url" ],
@@ -481,39 +484,44 @@ class UtilLinuxDirectoryListedSource(DirectoryListedSource):
481484class BusyBoxDirectoryListedSource (DirectoryListedSource ):
482485 source_url = "https://www.busybox.net/downloads/"
483486 # Source archive ex: busybox-1.2.3.tar.bz2
484- source_archive_regex = re .compile (r"^(busybox-)(?P<version>[\w.-]*)(.tar.bz2)$" )
487+ source_archive_regex = re .compile (
488+ r"^(busybox-)(?P<version>[\w.-]*)(.tar.bz2)$" )
485489 is_nested = False
486490 ignored_files_and_dir = []
487491
488492
489493class UclibcDirectoryListedSource (DirectoryListedSource ):
490494 source_url = "https://www.uclibc.org/downloads/"
491495 # Source archive ex: uClibc-1.2.3.tar.gz
492- source_archive_regex = re .compile (r"^(uClibc-)(?P<version>[\w.-]*)(.tar.gz)$" )
496+ source_archive_regex = re .compile (
497+ r"^(uClibc-)(?P<version>[\w.-]*)(.tar.gz)$" )
493498 is_nested = False
494499 ignored_files_and_dir = []
495500
496501
497502class UclibcNGDirectoryListedSource (DirectoryListedSource ):
498503 source_url = "https://downloads.uclibc-ng.org/releases/"
499504 # Source archive ex: uClibc-ng-1.2.3.tar.gz
500- source_archive_regex = re .compile (r"^(uClibc-ng-)(?P<version>[\w.-]*)(.tar.gz)$" )
505+ source_archive_regex = re .compile (
506+ r"^(uClibc-ng-)(?P<version>[\w.-]*)(.tar.gz)$" )
501507 is_nested = True
502508 ignored_files_and_dir = []
503509
504510
505511class Bzip2DirectoryListedSource (DirectoryListedSource ):
506512 source_url = "https://sourceware.org/pub/bzip2/"
507513 # Source archive ex: bzip2-1.2.3.tar.gz
508- source_archive_regex = re .compile (r"^(bzip2-)(?P<version>[\w.-]*)(.tar.gz)$" )
514+ source_archive_regex = re .compile (
515+ r"^(bzip2-)(?P<version>[\w.-]*)(.tar.gz)$" )
509516 is_nested = False
510517 ignored_files_and_dir = []
511518
512519
513520class OpenSSHDirectoryListedSource (DirectoryListedSource ):
514521 source_url = "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/"
515522 # Source archive ex: openssh-1.2.3.tar.gz
516- source_archive_regex = re .compile (r"^(openssh-)(?P<version>[\w.-]*)(.tgz|.tar.gz)$" )
523+ source_archive_regex = re .compile (
524+ r"^(openssh-)(?P<version>[\w.-]*)(.tgz|.tar.gz)$" )
517525 is_nested = False
518526 ignored_files_and_dir = []
519527
@@ -531,15 +539,17 @@ class DnsmasqDirectoryListedSource(DirectoryListedSource):
531539class EbtablesDirectoryListedSource (DirectoryListedSource ):
532540 source_url = "https://www.netfilter.org/pub/ebtables/"
533541 # Source archive ex: ebtables-1.2.3.tar.gz
534- source_archive_regex = re .compile (r"^(ebtables-)(?P<version>[\w.-]*)(.tar.gz)$" )
542+ source_archive_regex = re .compile (
543+ r"^(ebtables-)(?P<version>[\w.-]*)(.tar.gz)$" )
535544 is_nested = False
536545 ignored_files_and_dir = []
537546
538547
539548class HostapdDirectoryListedSource (DirectoryListedSource ):
540549 source_url = "https://w1.fi/releases/"
541550 # Source archive ex: hostapd-1.2.3.tar.gz
542- source_archive_regex = re .compile (r"^(hostapd-)(?P<version>[\w.-]*)(.tar.gz)$" )
551+ source_archive_regex = re .compile (
552+ r"^(hostapd-)(?P<version>[\w.-]*)(.tar.gz)$" )
543553 is_nested = False
544554 ignored_files_and_dir = []
545555
@@ -557,23 +567,26 @@ class Iproute2DirectoryListedSource(DirectoryListedSource):
557567class IptablesDirectoryListedSource (DirectoryListedSource ):
558568 source_url = "https://www.netfilter.org/pub/iptables/"
559569 # Source archive ex: iptables-1.2.3.tar.bz2
560- source_archive_regex = re .compile (r"^(iptables-)(?P<version>[\w.-]*)(.tar.bz2)$" )
570+ source_archive_regex = re .compile (
571+ r"^(iptables-)(?P<version>[\w.-]*)(.tar.bz2)$" )
561572 is_nested = False
562573 ignored_files_and_dir = []
563574
564575
565576class LibnlDirectoryListedSource (DirectoryListedSource ):
566577 source_url = "https://www.infradead.org/~tgr/libnl/files/"
567578 # Source archive ex: libnl-1.2.3.tar.gz
568- source_archive_regex = re .compile (r"^(libnl-)(?P<version>[\w.-]*)(.tar.gz)$" )
579+ source_archive_regex = re .compile (
580+ r"^(libnl-)(?P<version>[\w.-]*)(.tar.gz)$" )
569581 is_nested = False
570582 ignored_files_and_dir = []
571583
572584
573585class LighttpdDirectoryListedSource (DirectoryListedSource ):
574586 source_url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/"
575587 # Source archive ex: lighttpd-1.2.3.tar.gz
576- source_archive_regex = re .compile (r"^(lighttpd-)(?P<version>[\w.-]*)(.tar.gz)$" )
588+ source_archive_regex = re .compile (
589+ r"^(lighttpd-)(?P<version>[\w.-]*)(.tar.gz)$" )
577590 is_nested = False
578591 ignored_files_and_dir = []
579592
@@ -601,15 +614,17 @@ class WpaSupplicantDirectoryListedSource(DirectoryListedSource):
601614class SyslinuxDirectoryListedSource (DirectoryListedSource ):
602615 source_url = "https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/"
603616 # Source archive ex: syslinux-1.2.3.tar.gz
604- source_archive_regex = re .compile (r"^(syslinux-)(?P<version>[\w.-]*)(.tar.gz)$" )
617+ source_archive_regex = re .compile (
618+ r"^(syslinux-)(?P<version>[\w.-]*)(.tar.gz)$" )
605619 is_nested = False
606620 ignored_files_and_dir = []
607621
608622
609623class SyslinuxDirectoryListedSource (DirectoryListedSource ):
610624 source_url = "https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/"
611625 # Source archive ex: syslinux-1.2.3.tar.gz
612- source_archive_regex = re .compile (r"^(syslinux-)(?P<version>[\w.-]*)(.tar.gz)$" )
626+ source_archive_regex = re .compile (
627+ r"^(syslinux-)(?P<version>[\w.-]*)(.tar.gz)$" )
613628 is_nested = False
614629 ignored_files_and_dir = []
615630
@@ -646,31 +661,35 @@ class DropbearDirectoryListedSource(DirectoryListedSource):
646661class SambaDirectoryListedSource (DirectoryListedSource ):
647662 source_url = "https://download.samba.org/pub/samba/stable/"
648663 # Source archive ex: samba-1.2.3.tar.gz
649- source_archive_regex = re .compile (r"^(samba-)(?P<version>[\w.-]*)(.tar.gz)$" )
664+ source_archive_regex = re .compile (
665+ r"^(samba-)(?P<version>[\w.-]*)(.tar.gz)$" )
650666 is_nested = False
651667 ignored_files_and_dir = []
652668
653669
654670class MtdUtilsDirectoryListedSource (DirectoryListedSource ):
655671 source_url = "https://infraroot.at/pub/mtd/"
656672 # Source archive ex: mtd-utils-1.2.3.tar.bz2
657- source_archive_regex = re .compile (r"^(mtd-utils-)(?P<version>[\w.-]*)(.tar.bz2)$" )
673+ source_archive_regex = re .compile (
674+ r"^(mtd-utils-)(?P<version>[\w.-]*)(.tar.bz2)$" )
658675 is_nested = False
659676 ignored_files_and_dir = []
660677
661678
662679class BareboxDirectoryListedSource (DirectoryListedSource ):
663680 source_url = "https://www.barebox.org/download/"
664681 # Source archive ex: barebox-1.2.3.tar.bz2
665- source_archive_regex = re .compile (r"^(barebox-)(?P<version>[\w.-]*)(.tar.bz2)$" )
682+ source_archive_regex = re .compile (
683+ r"^(barebox-)(?P<version>[\w.-]*)(.tar.bz2)$" )
666684 is_nested = False
667685 ignored_files_and_dir = []
668686
669687
670688class LinuxDirectoryListedSource (DirectoryListedSource ):
671689 source_url = "https://mirrors.edge.kernel.org/pub/linux/kernel/"
672690 # Source archive ex: linux-1.2.3.tar.gz
673- source_archive_regex = re .compile (r"^(linux-)(?P<version>[\w.-]*)(.tar.gz)$" )
691+ source_archive_regex = re .compile (
692+ r"^(linux-)(?P<version>[\w.-]*)(.tar.gz)$" )
674693 is_nested = True
675694 ignored_files_and_dir = [
676695 "Historic/" ,
@@ -692,7 +711,8 @@ class E2fsprogsDirectoryListedSource(DirectoryListedSource):
692711 "https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
693712 )
694713 # Source archive ex: e2fsprogs-1.2.3.tar.gz
695- source_archive_regex = re .compile (r"^(e2fsprogs-)(?P<version>[\w.-]*)(.tar.gz)$" )
714+ source_archive_regex = re .compile (
715+ r"^(e2fsprogs-)(?P<version>[\w.-]*)(.tar.gz)$" )
696716 is_nested = True
697717 ignored_files_and_dir = ["testing/" ]
698718
0 commit comments