Buildroot 2018-11 (#258)
* Update to buildroot 2018.11 * containerd update * runc update * runc docker engine * runc docker proxy * update rpi firmware * update network manager * update dhcpd * update wait on network * update rpi wifi * revert glibc
This commit is contained in:
@@ -251,3 +251,13 @@ class UselessFlag(_CheckFunction):
|
||||
"({}#_infrastructure_for_autotools_based_packages)"
|
||||
.format(self.filename, lineno, self.url_to_manual),
|
||||
text]
|
||||
|
||||
|
||||
class VariableWithBraces(_CheckFunction):
|
||||
VARIABLE_WITH_BRACES = re.compile(r"^[^#].*[^$]\${\w+}")
|
||||
|
||||
def check_line(self, lineno, text):
|
||||
if self.VARIABLE_WITH_BRACES.match(text.rstrip()):
|
||||
return ["{}:{}: use $() to delimit variables, not ${{}}"
|
||||
.format(self.filename, lineno),
|
||||
text]
|
||||
|
||||
@@ -28,14 +28,14 @@ If no config files are specified, .config and .config.old are used.
|
||||
|
||||
Example usage:
|
||||
$ diffconfig .config config-with-some-changes
|
||||
-LINUX_KERNEL_INTREE_DTS_NAME "vexpress-v2p-ca9"
|
||||
LINUX_KERNEL_DTS_SUPPORT y -> n
|
||||
LINUX_KERNEL_USE_INTREE_DTS y -> n
|
||||
PACKAGE_DFU_UTIL n -> y
|
||||
PACKAGE_LIBUSB n -> y
|
||||
TARGET_GENERIC_HOSTNAME "buildroot" -> "Tuxie"
|
||||
TARGET_GENERIC_ISSUE "Welcome to Buildroot" -> "Welcome to CustomBoard"
|
||||
+PACKAGE_LIBUSB_COMPAT n
|
||||
-BR2_LINUX_KERNEL_INTREE_DTS_NAME "vexpress-v2p-ca9"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT y -> n
|
||||
BR2_LINUX_KERNEL_USE_INTREE_DTS y -> n
|
||||
BR2_PACKAGE_DFU_UTIL n -> y
|
||||
BR2_PACKAGE_LIBUSB n -> y
|
||||
BR2_TARGET_GENERIC_HOSTNAME "buildroot" -> "Tuxie"
|
||||
BR2_TARGET_GENERIC_ISSUE "Welcome to Buildroot" -> "Welcome to CustomBoard"
|
||||
+BR2_PACKAGE_LIBUSB_COMPAT n
|
||||
|
||||
""")
|
||||
sys.exit(0)
|
||||
@@ -44,12 +44,14 @@ Example usage:
|
||||
def readconfig(config_file):
|
||||
d = {}
|
||||
for line in config_file:
|
||||
line = line[:-1]
|
||||
if line[:4] == "BR2_":
|
||||
name, val = line[4:].split("=", 1)
|
||||
d[name] = val
|
||||
line = line.strip()
|
||||
if len(line) == 0:
|
||||
continue
|
||||
if line[-11:] == " is not set":
|
||||
d[line[6:-11]] = "n"
|
||||
d[line[2:-11]] = "n"
|
||||
elif line[0] != "#":
|
||||
name, val = line.split("=", 1)
|
||||
d[name] = val
|
||||
return d
|
||||
|
||||
def print_config(op, config, value, new_value):
|
||||
@@ -58,9 +60,9 @@ def print_config(op, config, value, new_value):
|
||||
if merge_style:
|
||||
if new_value:
|
||||
if new_value=="n":
|
||||
print("# BR2_%s is not set" % config)
|
||||
print("# %s is not set" % config)
|
||||
else:
|
||||
print("BR2_%s=%s" % (config, new_value))
|
||||
print("%s=%s" % (config, new_value))
|
||||
else:
|
||||
if op=="-":
|
||||
print("-%s %s" % (config, value))
|
||||
|
||||
@@ -187,6 +187,7 @@ def is_toolchain_usable(configfile, config):
|
||||
if platform.machine() == 'x86_64':
|
||||
if 'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y\n' in configlines or \
|
||||
'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y\n' in configlines or \
|
||||
'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_BE=y\n' in configlines or \
|
||||
'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB=y\n' in configlines:
|
||||
ldd_version_output = subprocess.check_output(['ldd', '--version'])
|
||||
glibc_version = ldd_version_output.splitlines()[0].split()[-1]
|
||||
@@ -350,7 +351,7 @@ def gen_config(args):
|
||||
configlines += minimalf.readlines()
|
||||
|
||||
# Allow hosts with old certificates to download over https
|
||||
configlines.append("BR2_WGET=\"wget --passive-ftp -nd -t 3 --no-check-certificate\"")
|
||||
configlines.append("BR2_WGET=\"wget --passive-ftp -nd -t 3 --no-check-certificate\"\n")
|
||||
|
||||
# Amend the configuration with a few things.
|
||||
if randint(0, 20) == 0:
|
||||
|
||||
@@ -18,11 +18,15 @@ def parse_args():
|
||||
help='find developers in charge of these files')
|
||||
parser.add_argument('-c', dest='check', action='store_const',
|
||||
const=True, help='list files not handled by any developer')
|
||||
parser.add_argument('-e', dest='email', action='store_const',
|
||||
const=True, help='only list affected developer email addresses')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def __main__():
|
||||
devs = getdeveloperlib.parse_developers()
|
||||
# DEVELOPERS is one level up from here
|
||||
devs_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
|
||||
devs = getdeveloperlib.parse_developers(devs_dir)
|
||||
if devs is None:
|
||||
sys.exit(1)
|
||||
args = parse_args()
|
||||
@@ -48,7 +52,7 @@ def __main__():
|
||||
|
||||
# Handle the check action
|
||||
if args.check:
|
||||
files = getdeveloperlib.check_developers(devs)
|
||||
files = getdeveloperlib.check_developers(devs, devs_dir)
|
||||
for f in files:
|
||||
print(f)
|
||||
|
||||
@@ -90,12 +94,16 @@ def __main__():
|
||||
if i in dev.infras:
|
||||
matching_devs.add(dev.name)
|
||||
|
||||
result = "--to buildroot@buildroot.org"
|
||||
for dev in matching_devs:
|
||||
result += " --cc \"%s\"" % dev
|
||||
if args.email:
|
||||
for dev in matching_devs:
|
||||
print(dev)
|
||||
else:
|
||||
result = "--to buildroot@buildroot.org"
|
||||
for dev in matching_devs:
|
||||
result += " --cc \"%s\"" % dev
|
||||
|
||||
if result != "":
|
||||
print("git send-email %s" % result)
|
||||
if result != "":
|
||||
print("git send-email %s" % result)
|
||||
|
||||
|
||||
__main__()
|
||||
|
||||
@@ -158,6 +158,8 @@ def parse_developers(basepath=None):
|
||||
linen = 0
|
||||
if basepath is None:
|
||||
basepath = os.getcwd()
|
||||
else:
|
||||
basepath = os.path.abspath(basepath)
|
||||
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
|
||||
files = []
|
||||
name = None
|
||||
|
||||
@@ -483,6 +483,9 @@ use Module::CoreList;
|
||||
use HTTP::Tiny;
|
||||
use Safe;
|
||||
use MetaCPAN::API::Tiny;
|
||||
use Digest::SHA qw(sha256_hex);
|
||||
use Text::Wrap;
|
||||
$Text::Wrap::columns = 62;
|
||||
|
||||
# Below, 5.026 should be aligned with the version of perl actually
|
||||
# bundled in Buildroot:
|
||||
@@ -518,12 +521,22 @@ my %need_host; # name -> 1 if host package is needed
|
||||
my %need_dlopen; # name -> 1 if requires dynamic library
|
||||
my %deps_build; # name -> list of host dependencies
|
||||
my %deps_runtime; # name -> list of target dependencies
|
||||
my %deps_optional; # name -> list of optional target dependencies
|
||||
my %license_files; # name -> list of license files
|
||||
my %license_files; # name -> hash of license files
|
||||
my %checksum; # author -> list of checksum
|
||||
my $mirror = 'http://cpan.metacpan.org'; # a CPAN mirror
|
||||
my $mcpan = MetaCPAN::API::Tiny->new(base_url => 'http://fastapi.metacpan.org/v1');
|
||||
my $ua = HTTP::Tiny->new();
|
||||
my $new_pkgs;
|
||||
|
||||
my %white_list = (
|
||||
'ExtUtils-Config' => 1,
|
||||
'ExtUtils-InstallPaths' => 1,
|
||||
'ExtUtils-Helpers' => 1,
|
||||
'File-ShareDir-Install' => 1,
|
||||
'Module-Build' => 1,
|
||||
'Module-Build-Tiny' => 1,
|
||||
);
|
||||
my @info = ();
|
||||
|
||||
sub get_checksum {
|
||||
my ($url) = @_;
|
||||
@@ -556,7 +569,10 @@ sub find_license_files {
|
||||
if (scalar @license_files == 0 && $manifest =~ m/(README)[\n\s]/i) {
|
||||
@license_files = ($1);
|
||||
}
|
||||
return \@license_files;
|
||||
if (scalar @license_files == 0 && $manifest =~ m/(README\.md)[\n\s]/i) {
|
||||
@license_files = ($1);
|
||||
}
|
||||
return @license_files;
|
||||
}
|
||||
|
||||
sub fetch {
|
||||
@@ -567,16 +583,19 @@ sub fetch {
|
||||
say qq{fetch ${name}} unless $quiet;
|
||||
my $result = $mcpan->release( distribution => $name );
|
||||
$dist{$name} = $result;
|
||||
$license_files{$name} = {};
|
||||
eval {
|
||||
my $manifest = $mcpan->source( author => $result->{author},
|
||||
release => $name . q{-} . $result->{version},
|
||||
path => 'MANIFEST' );
|
||||
my $author = $result->{author};
|
||||
my $release = $name . q{-} . $result->{version};
|
||||
my $manifest = $mcpan->source( author => $author, release => $release, path => 'MANIFEST' );
|
||||
$need_dlopen{$name} = is_xs( $manifest );
|
||||
$license_files{$name} = find_license_files( $manifest );
|
||||
foreach my $fname (find_license_files( $manifest )) {
|
||||
my $license = $mcpan->source( author => $author, release => $release, path => $fname );
|
||||
$license_files{$name}->{$fname} = sha256_hex( $license );
|
||||
}
|
||||
};
|
||||
if ($@) {
|
||||
warn $@;
|
||||
$license_files{$name} = [];
|
||||
}
|
||||
my %build = ();
|
||||
my %runtime = ();
|
||||
@@ -591,6 +610,7 @@ sub fetch {
|
||||
# we could use the host Module::CoreList data, because host perl and
|
||||
# target perl have the same major version
|
||||
next if ${$dep}{phase} eq q{develop};
|
||||
next if ${$dep}{phase} eq q{x_Dist_Zilla};
|
||||
next if !($test && $top) && ${$dep}{phase} eq q{test};
|
||||
my $distname = $mcpan->module( $modname )->{distribution};
|
||||
if (${$dep}{phase} eq q{runtime}) {
|
||||
@@ -603,11 +623,12 @@ sub fetch {
|
||||
}
|
||||
else { # configure, build
|
||||
$build{$distname} = 1;
|
||||
push @info, qq{[$name] suspicious dependency on $distname}
|
||||
unless exists $white_list{$distname};
|
||||
}
|
||||
}
|
||||
$deps_build{$name} = [keys %build];
|
||||
$deps_runtime{$name} = [keys %runtime];
|
||||
$deps_optional{$name} = [keys %optional];
|
||||
foreach my $distname (@{$deps_build{$name}}) {
|
||||
fetch( $distname, 0, 1 );
|
||||
}
|
||||
@@ -615,7 +636,7 @@ sub fetch {
|
||||
fetch( $distname, $need_target, $need_host );
|
||||
$need_dlopen{$name} ||= $need_dlopen{$distname};
|
||||
}
|
||||
foreach my $distname (@{$deps_optional{$name}}) {
|
||||
foreach my $distname (keys %optional) {
|
||||
fetch( $distname, $need_target, $need_host );
|
||||
}
|
||||
}
|
||||
@@ -642,6 +663,24 @@ sub brname {
|
||||
return uc $name;
|
||||
}
|
||||
|
||||
# Buildroot requires license name as in http://spdx.org/licenses/
|
||||
sub brlicense {
|
||||
my $license = shift;
|
||||
$license =~ s|apache_1_1|Apache-1.1|;
|
||||
$license =~ s|apache_2_0|Apache-2.0|;
|
||||
$license =~ s|artistic_2|Artistic-2.0|;
|
||||
$license =~ s|artistic|Artistic-1.0|;
|
||||
$license =~ s|lgpl_2_1|LGPL-2.1|;
|
||||
$license =~ s|lgpl_3_0|LGPL-3.0|;
|
||||
$license =~ s|gpl_2|GPL-2.0|;
|
||||
$license =~ s|gpl_3|GPL-3.0|;
|
||||
$license =~ s|mit|MIT|;
|
||||
$license =~ s|mozilla_1_1|Mozilla-1.1|;
|
||||
$license =~ s|openssl|OpenSSL|;
|
||||
$license =~ s|perl_5|Artistic or GPL-1.0+|;
|
||||
return $license;
|
||||
}
|
||||
|
||||
while (my ($distname, $dist) = each %dist) {
|
||||
my $fsname = fsname( $distname );
|
||||
my $dirname = q{package/} . $fsname;
|
||||
@@ -649,9 +688,14 @@ while (my ($distname, $dist) = each %dist) {
|
||||
my $mkname = $dirname . q{/} . $fsname . q{.mk};
|
||||
my $hashname = $dirname . q{/} . $fsname . q{.hash};
|
||||
my $brname = brname( $fsname );
|
||||
mkdir $dirname unless -d $dirname;
|
||||
unless (-d $dirname) {
|
||||
mkdir $dirname;
|
||||
$new_pkgs = 1;
|
||||
}
|
||||
if ($need_target{$distname} && ($force || !-f $cfgname)) {
|
||||
my $abstract = $dist->{abstract};
|
||||
$dist->{abstract} =~ s|\s+$||;
|
||||
$dist->{abstract} .= q{.} unless $dist->{abstract} =~ m|\.$|;
|
||||
my $abstract = wrap( q{}, qq{\t }, $dist->{abstract} );
|
||||
my $homepage = $dist->{resources}->{homepage} || qq{https://metacpan.org/release/${distname}};
|
||||
say qq{write ${cfgname}} unless $quiet;
|
||||
open my $fh, q{>}, $cfgname;
|
||||
@@ -660,7 +704,7 @@ while (my ($distname, $dist) = each %dist) {
|
||||
say {$fh} qq{\tdepends on !BR2_STATIC_LIBS} if $need_dlopen{$distname};
|
||||
foreach my $dep (sort @{$deps_runtime{$distname}}) {
|
||||
my $brdep = brname( fsname( $dep ) );
|
||||
say {$fh} qq{\tselect BR2_PACKAGE_${brdep}};
|
||||
say {$fh} qq{\tselect BR2_PACKAGE_${brdep} # runtime};
|
||||
}
|
||||
say {$fh} qq{\thelp};
|
||||
say {$fh} qq{\t ${abstract}\n} if $abstract;
|
||||
@@ -679,20 +723,21 @@ while (my ($distname, $dist) = each %dist) {
|
||||
# the auth part is not used, because we use $(BR2_CPAN_MIRROR)
|
||||
my ($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
|
||||
$directories =~ s|/$||;
|
||||
my $dependencies = join q{ }, map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
|
||||
map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
|
||||
my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
|
||||
@{$deps_runtime{$distname}} );
|
||||
my $license = ref $dist->{license} eq 'ARRAY'
|
||||
? join q{ or }, @{$dist->{license}}
|
||||
: $dist->{license};
|
||||
# BR requires license name as in http://spdx.org/licenses/
|
||||
$license =~ s|apache_2_0|Apache-2.0|;
|
||||
$license =~ s|artistic_2|Artistic-2.0|;
|
||||
$license =~ s|mit|MIT|;
|
||||
$license =~ s|openssl|OpenSSL|;
|
||||
$license =~ s|perl_5|Artistic or GPL-1.0+|;
|
||||
my $license_files = join q{ }, @{$license_files{$distname}};
|
||||
my @dependencies = map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} );
|
||||
my $dependencies = join qq{ \\\n\t}, @dependencies;
|
||||
$dependencies = qq{\\\n\t} . $dependencies if scalar @dependencies > 1;
|
||||
my @host_dependencies = map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
|
||||
@{$deps_runtime{$distname}} );
|
||||
my $host_dependencies = join qq{ \\\n\t}, @host_dependencies;
|
||||
$host_dependencies = qq{\\\n\t} . $host_dependencies if scalar @host_dependencies > 1;
|
||||
my $license = brlicense( ref $dist->{license} eq 'ARRAY'
|
||||
? join q{ or }, @{$dist->{license}}
|
||||
: $dist->{license} );
|
||||
my $license_files = join q{ }, sort keys %{$license_files{$distname}};
|
||||
if ($license_files && (!$license || $license eq q{unknown})) {
|
||||
push @info, qq{[$distname] undefined LICENSE, see $license_files};
|
||||
$license = q{???};
|
||||
}
|
||||
say qq{write ${mkname}} unless $quiet;
|
||||
open my $fh, q{>}, $mkname;
|
||||
say {$fh} qq{################################################################################};
|
||||
@@ -706,18 +751,10 @@ while (my ($distname, $dist) = each %dist) {
|
||||
say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
|
||||
say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies;
|
||||
say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies;
|
||||
say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
|
||||
say {$fh} qq{${brname}_LICENSE = ${license}} if $license;
|
||||
say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files;
|
||||
say {$fh} qq{${brname}_DISTNAME = ${distname}};
|
||||
say {$fh} qq{};
|
||||
foreach (sort @{$deps_optional{$distname}}) {
|
||||
next if grep { $_ eq $distname; } @{$deps_runtime{$_}}; # avoid cyclic dependencies
|
||||
my $opt_brname = brname( $_ );
|
||||
my $opt_fsname = fsname( $_ );
|
||||
say {$fh} qq{ifeq (\$(BR2_PACKAGE_PERL_${opt_brname}),y)};
|
||||
say {$fh} qq{${brname}_DEPENDENCIES += ${opt_fsname}};
|
||||
say {$fh} qq{endif};
|
||||
say {$fh} qq{};
|
||||
}
|
||||
say {$fh} qq{\$(eval \$(perl-package))} if $need_target{$distname};
|
||||
say {$fh} qq{\$(eval \$(host-perl-package))} if $need_host{$distname};
|
||||
close $fh;
|
||||
@@ -731,28 +768,41 @@ while (my ($distname, $dist) = each %dist) {
|
||||
say {$fh} qq{# retrieved by scancpan from ${mirror}/};
|
||||
say {$fh} qq{md5 ${md5} ${filename}};
|
||||
say {$fh} qq{sha256 ${sha256} ${filename}};
|
||||
my %license_files = %{$license_files{$distname}};
|
||||
if (scalar keys %license_files) {
|
||||
say {$fh} q{};
|
||||
say {$fh} qq{# computed by scancpan};
|
||||
foreach my $license (sort keys %license_files) {
|
||||
my $digest = $license_files{$license};
|
||||
say {$fh} qq{sha256 ${digest} ${license}};
|
||||
}
|
||||
}
|
||||
close $fh;
|
||||
}
|
||||
}
|
||||
|
||||
my %pkg;
|
||||
my $cfgname = q{package/Config.in};
|
||||
if (-f $cfgname) {
|
||||
open my $fh, q{<}, $cfgname;
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
$pkg{$_} = 1 if m|package/perl-|;
|
||||
if ($new_pkgs) {
|
||||
my %pkg;
|
||||
my $cfgname = q{package/Config.in};
|
||||
if (-f $cfgname) {
|
||||
open my $fh, q{<}, $cfgname;
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
$pkg{$_} = 1 if m|package/perl-|;
|
||||
}
|
||||
close $fh;
|
||||
}
|
||||
close $fh;
|
||||
|
||||
foreach my $distname (keys %need_target) {
|
||||
my $fsname = fsname( $distname );
|
||||
$pkg{qq{\tsource "package/${fsname}/Config.in"}} = 1;
|
||||
}
|
||||
|
||||
say qq{${cfgname} must contain the following lines:};
|
||||
say join qq{\n}, sort keys %pkg;
|
||||
}
|
||||
|
||||
foreach my $distname (keys %need_target) {
|
||||
my $fsname = fsname( $distname );
|
||||
$pkg{qq{\tsource "package/${fsname}/Config.in"}} = 1;
|
||||
}
|
||||
|
||||
say qq{${cfgname} must contain the following lines:};
|
||||
say join qq{\n}, sort keys %pkg;
|
||||
say join qq{\n}, @info;
|
||||
|
||||
__END__
|
||||
|
||||
@@ -819,7 +869,6 @@ Perl/CPAN distributions required by the specified distnames. The
|
||||
dependencies and metadata are fetched from https://metacpan.org/.
|
||||
|
||||
After running this script, it is necessary to check the generated files.
|
||||
You have to manually add the license files (PERL_FOO_LICENSE_FILES variable).
|
||||
For distributions that link against a target library, you have to add the
|
||||
buildroot package name for that library to the DEPENDENCIES variable.
|
||||
|
||||
@@ -831,7 +880,7 @@ in order to work with the right CoreList data.
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
Copyright (C) 2013-2017 by Francois Perrad <francois.perrad@gadz.org>
|
||||
Copyright (C) 2013-2018 by Francois Perrad <francois.perrad@gadz.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -178,6 +178,7 @@ class BuildrootPackage():
|
||||
"""
|
||||
Download a package using metadata from pypi
|
||||
"""
|
||||
download = None
|
||||
try:
|
||||
self.metadata['urls'][0]['filename']
|
||||
except IndexError:
|
||||
@@ -201,7 +202,7 @@ class BuildrootPackage():
|
||||
continue
|
||||
try:
|
||||
print('Downloading package {pkg} from {url}...'.format(
|
||||
pkg=self.real_name, url=download_url['url']))
|
||||
pkg=self.real_name, url=download_url['url']))
|
||||
download = six.moves.urllib.request.urlopen(download_url['url'])
|
||||
except six.moves.urllib.error.HTTPError as http_error:
|
||||
download = http_error
|
||||
@@ -213,11 +214,14 @@ class BuildrootPackage():
|
||||
self.md5_sum = hashlib.md5(self.as_string).hexdigest()
|
||||
if self.md5_sum == download_url['digests']['md5']:
|
||||
break
|
||||
else:
|
||||
if download.__class__ == six.moves.urllib.error.HTTPError:
|
||||
raise download
|
||||
raise DownloadFailed('Failed to download package {pkg}'
|
||||
|
||||
if download is None:
|
||||
raise DownloadFailed('Failed to download package {pkg}: '
|
||||
'No source archive available'
|
||||
.format(pkg=self.real_name))
|
||||
elif download.__class__ == six.moves.urllib.error.HTTPError:
|
||||
raise download
|
||||
|
||||
self.filename = self.used_url['filename']
|
||||
self.url = self.used_url['url']
|
||||
|
||||
@@ -239,13 +243,14 @@ class BuildrootPackage():
|
||||
os.makedirs(tmp_pkg)
|
||||
except OSError as exception:
|
||||
if exception.errno != errno.EEXIST:
|
||||
print("ERROR: ", exception.message, file=sys.stderr)
|
||||
return None, None
|
||||
print('WARNING:', exception.message, file=sys.stderr)
|
||||
print("ERROR: ", exception.strerror, file=sys.stderr)
|
||||
return
|
||||
print('WARNING:', exception.strerror, file=sys.stderr)
|
||||
print('Removing {pkg}...'.format(pkg=tmp_pkg))
|
||||
shutil.rmtree(tmp_pkg)
|
||||
os.makedirs(tmp_pkg)
|
||||
as_zipfile.extractall(tmp_pkg)
|
||||
pkg_filename = self.filename.split(".zip")[0]
|
||||
else:
|
||||
with tarfile.open(fileobj=as_file) as as_tarfile:
|
||||
tmp_pkg = os.path.join(tmp_path, self.buildroot_name)
|
||||
@@ -253,19 +258,19 @@ class BuildrootPackage():
|
||||
os.makedirs(tmp_pkg)
|
||||
except OSError as exception:
|
||||
if exception.errno != errno.EEXIST:
|
||||
print("ERROR: ", exception.message, file=sys.stderr)
|
||||
return None, None
|
||||
print('WARNING:', exception.message, file=sys.stderr)
|
||||
print("ERROR: ", exception.strerror, file=sys.stderr)
|
||||
return
|
||||
print('WARNING:', exception.strerror, file=sys.stderr)
|
||||
print('Removing {pkg}...'.format(pkg=tmp_pkg))
|
||||
shutil.rmtree(tmp_pkg)
|
||||
os.makedirs(tmp_pkg)
|
||||
as_tarfile.extractall(tmp_pkg)
|
||||
pkg_filename = self.filename.split(".tar")[0]
|
||||
|
||||
tmp_extract = '{folder}/{name}-{version}'
|
||||
tmp_extract = '{folder}/{name}'
|
||||
self.tmp_extract = tmp_extract.format(
|
||||
folder=tmp_pkg,
|
||||
name=self.metadata_name,
|
||||
version=self.version)
|
||||
name=pkg_filename)
|
||||
|
||||
def load_setup(self):
|
||||
"""
|
||||
@@ -391,7 +396,7 @@ class BuildrootPackage():
|
||||
"""
|
||||
Try to determine the related license name.
|
||||
|
||||
There are two possibilities. Either the scripts tries to
|
||||
There are two possibilities. Either the script tries to
|
||||
get license name from package's metadata or, if spdx_lookup
|
||||
package is available, the script compares license files with
|
||||
SPDX database.
|
||||
@@ -400,7 +405,7 @@ class BuildrootPackage():
|
||||
if liclookup is None:
|
||||
license_dict = {
|
||||
'Apache Software License': 'Apache-2.0',
|
||||
'BSD License': 'BSD',
|
||||
'BSD License': 'FIXME: please specify the exact BSD version',
|
||||
'European Union Public Licence 1.0': 'EUPL-1.0',
|
||||
'European Union Public Licence 1.1': 'EUPL-1.1',
|
||||
"GNU General Public License": "GPL",
|
||||
@@ -440,6 +445,8 @@ class BuildrootPackage():
|
||||
match = liclookup.match(lic_file.read())
|
||||
if match is not None and match.confidence >= 90.0:
|
||||
license_names.append(match.license.id)
|
||||
else:
|
||||
license_names.append("FIXME: license id couldn't be detected")
|
||||
|
||||
if len(license_names) > 0:
|
||||
license_line = ('{name}_LICENSE ='
|
||||
|
||||
Reference in New Issue
Block a user