1
1
# 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.
3
3
#
4
4
# Copyright (c) nexB Inc. and others. All rights reserved.
5
5
# http://nexb.com and http://aboutcode.org
@@ -92,7 +92,8 @@ def get_cargo_data_from_purl(purl):
92
92
)
93
93
versions = response .get ("versions" , [])
94
94
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" ))
96
97
dl_path = version .get ("dl_path" )
97
98
if dl_path :
98
99
download_url = f"{ base_url } /{ dl_path } "
@@ -355,7 +356,8 @@ def get_gnu_data_from_purl(purl):
355
356
purl = PackageURL .from_string (purl )
356
357
source_archive_url = f"https://ftp.gnu.org/pub/gnu/{ purl .name } /"
357
358
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 )))
359
361
360
362
yield from extract_packages_from_listing (
361
363
purl , source_archive_url , version_regex , []
@@ -427,7 +429,8 @@ def get_package_info(cls, package_url):
427
429
428
430
else :
429
431
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 )
431
434
yield Package (
432
435
homepage_url = cls .source_url ,
433
436
download_url = data ["url" ],
@@ -481,39 +484,44 @@ class UtilLinuxDirectoryListedSource(DirectoryListedSource):
481
484
class BusyBoxDirectoryListedSource (DirectoryListedSource ):
482
485
source_url = "https://www.busybox.net/downloads/"
483
486
# 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)$" )
485
489
is_nested = False
486
490
ignored_files_and_dir = []
487
491
488
492
489
493
class UclibcDirectoryListedSource (DirectoryListedSource ):
490
494
source_url = "https://www.uclibc.org/downloads/"
491
495
# 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)$" )
493
498
is_nested = False
494
499
ignored_files_and_dir = []
495
500
496
501
497
502
class UclibcNGDirectoryListedSource (DirectoryListedSource ):
498
503
source_url = "https://downloads.uclibc-ng.org/releases/"
499
504
# 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)$" )
501
507
is_nested = True
502
508
ignored_files_and_dir = []
503
509
504
510
505
511
class Bzip2DirectoryListedSource (DirectoryListedSource ):
506
512
source_url = "https://sourceware.org/pub/bzip2/"
507
513
# 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)$" )
509
516
is_nested = False
510
517
ignored_files_and_dir = []
511
518
512
519
513
520
class OpenSSHDirectoryListedSource (DirectoryListedSource ):
514
521
source_url = "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/"
515
522
# 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)$" )
517
525
is_nested = False
518
526
ignored_files_and_dir = []
519
527
@@ -531,15 +539,17 @@ class DnsmasqDirectoryListedSource(DirectoryListedSource):
531
539
class EbtablesDirectoryListedSource (DirectoryListedSource ):
532
540
source_url = "https://www.netfilter.org/pub/ebtables/"
533
541
# 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)$" )
535
544
is_nested = False
536
545
ignored_files_and_dir = []
537
546
538
547
539
548
class HostapdDirectoryListedSource (DirectoryListedSource ):
540
549
source_url = "https://w1.fi/releases/"
541
550
# 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)$" )
543
553
is_nested = False
544
554
ignored_files_and_dir = []
545
555
@@ -557,23 +567,26 @@ class Iproute2DirectoryListedSource(DirectoryListedSource):
557
567
class IptablesDirectoryListedSource (DirectoryListedSource ):
558
568
source_url = "https://www.netfilter.org/pub/iptables/"
559
569
# 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)$" )
561
572
is_nested = False
562
573
ignored_files_and_dir = []
563
574
564
575
565
576
class LibnlDirectoryListedSource (DirectoryListedSource ):
566
577
source_url = "https://www.infradead.org/~tgr/libnl/files/"
567
578
# 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)$" )
569
581
is_nested = False
570
582
ignored_files_and_dir = []
571
583
572
584
573
585
class LighttpdDirectoryListedSource (DirectoryListedSource ):
574
586
source_url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/"
575
587
# 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)$" )
577
590
is_nested = False
578
591
ignored_files_and_dir = []
579
592
@@ -601,15 +614,17 @@ class WpaSupplicantDirectoryListedSource(DirectoryListedSource):
601
614
class SyslinuxDirectoryListedSource (DirectoryListedSource ):
602
615
source_url = "https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/"
603
616
# 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)$" )
605
619
is_nested = False
606
620
ignored_files_and_dir = []
607
621
608
622
609
623
class SyslinuxDirectoryListedSource (DirectoryListedSource ):
610
624
source_url = "https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/"
611
625
# 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)$" )
613
628
is_nested = False
614
629
ignored_files_and_dir = []
615
630
@@ -646,31 +661,35 @@ class DropbearDirectoryListedSource(DirectoryListedSource):
646
661
class SambaDirectoryListedSource (DirectoryListedSource ):
647
662
source_url = "https://download.samba.org/pub/samba/stable/"
648
663
# 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)$" )
650
666
is_nested = False
651
667
ignored_files_and_dir = []
652
668
653
669
654
670
class MtdUtilsDirectoryListedSource (DirectoryListedSource ):
655
671
source_url = "https://infraroot.at/pub/mtd/"
656
672
# 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)$" )
658
675
is_nested = False
659
676
ignored_files_and_dir = []
660
677
661
678
662
679
class BareboxDirectoryListedSource (DirectoryListedSource ):
663
680
source_url = "https://www.barebox.org/download/"
664
681
# 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)$" )
666
684
is_nested = False
667
685
ignored_files_and_dir = []
668
686
669
687
670
688
class LinuxDirectoryListedSource (DirectoryListedSource ):
671
689
source_url = "https://mirrors.edge.kernel.org/pub/linux/kernel/"
672
690
# 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)$" )
674
693
is_nested = True
675
694
ignored_files_and_dir = [
676
695
"Historic/" ,
@@ -692,7 +711,8 @@ class E2fsprogsDirectoryListedSource(DirectoryListedSource):
692
711
"https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/"
693
712
)
694
713
# 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)$" )
696
716
is_nested = True
697
717
ignored_files_and_dir = ["testing/" ]
698
718
0 commit comments