bump version to 2022.02.9

add miyoo_defconfig
This commit is contained in:
tiopex
2023-01-31 13:11:45 +01:00
parent 1fa746c353
commit dcdaa3599c
8423 changed files with 184305 additions and 91107 deletions

View File

@@ -1,4 +1,4 @@
from __future__ import print_function
from io import open
import os
import re
import glob
@@ -6,6 +6,8 @@ import subprocess
import sys
import unittest
brpath = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))
#
# Patch parsing functions
#
@@ -54,17 +56,6 @@ def fname_get_package_infra(fname):
return None
def get_infras(files):
"""Search in the list of files for .mk files, and collect the package
infrastructures used by those .mk files."""
infras = set()
for fname in files:
infra = fname_get_package_infra(fname)
if infra:
infras.add(infra)
return infras
def analyze_patches(patches):
"""Parse a list of patches and returns the list of files modified,
added or removed by the patches, as well as the list of package
@@ -75,7 +66,6 @@ def analyze_patches(patches):
(files, infras) = analyze_patch(patch)
allfiles = allfiles | files
allinfras = allinfras | infras
allinfras = allinfras | get_infras(allfiles)
return (allfiles, allinfras)
@@ -94,14 +84,14 @@ def get_all_test_cases(suite):
yield (suite.__module__, suite.__class__.__name__)
def list_unittests(path):
def list_unittests():
"""Use the unittest module to retreive all test cases from a given
directory"""
loader = unittest.TestLoader()
suite = loader.discover(path)
suite = loader.discover(os.path.join(brpath, "support", "testing"))
tests = {}
for module, test in get_all_test_cases(suite):
module_path = os.path.join(path, *module.split('.'))
module_path = os.path.join("support", "testing", *module.split('.'))
tests.setdefault(module_path, []).append('%s.%s' % (module, test))
return tests
@@ -124,7 +114,6 @@ class Developer:
self.defconfigs = parse_developer_defconfigs(files)
def hasfile(self, f):
f = os.path.abspath(f)
for fs in self.files:
if f.startswith(fs):
return True
@@ -157,7 +146,7 @@ def parse_developer_packages(fnames):
patterns, and return a list of those packages."""
packages = set()
for fname in fnames:
for root, dirs, files in os.walk(fname):
for root, dirs, files in os.walk(os.path.join(brpath, fname)):
for f in files:
path = os.path.join(root, f)
if fname_get_package_infra(path):
@@ -222,7 +211,7 @@ def parse_developer_runtime_tests(fnames):
# List all files recursively
for fname in fnames:
if os.path.isdir(fname):
for root, _dirs, files in os.walk(fname):
for root, _dirs, files in os.walk(os.path.join(brpath, fname)):
all_files += [os.path.join(root, f) for f in files]
else:
all_files.append(fname)
@@ -236,15 +225,14 @@ def parse_developer_runtime_tests(fnames):
return runtimes
def parse_developers(basepath=None):
def parse_developers():
"""Parse the DEVELOPERS file and return a list of Developer objects."""
developers = []
linen = 0
if basepath is None:
basepath = os.getcwd()
global unittests
unittests = list_unittests(os.path.join(basepath, 'support/testing'))
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
unittests = list_unittests()
developers_fname = os.path.join(brpath, 'DEVELOPERS')
with open(developers_fname, mode='r', encoding='utf_8') as f:
files = []
name = None
for line in f:
@@ -258,11 +246,16 @@ def parse_developers(basepath=None):
name = line[2:].strip()
elif line.startswith("F:"):
fname = line[2:].strip()
dev_files = glob.glob(os.path.join(basepath, fname))
dev_files = glob.glob(os.path.join(brpath, fname))
if len(dev_files) == 0:
print("WARNING: '%s' doesn't match any file" % fname,
file=sys.stderr)
files += dev_files
for f in dev_files:
dev_file = os.path.relpath(f, brpath)
dev_file = dev_file.replace(os.sep, '/') # force unix sep
if f[-1] == '/': # relpath removes the trailing /
dev_file = dev_file + '/'
files.append(dev_file)
elif line == "":
if not name:
continue
@@ -286,12 +279,12 @@ def check_developers(developers, basepath=None):
if basepath is None:
basepath = os.getcwd()
cmd = ["git", "--git-dir", os.path.join(basepath, ".git"), "ls-files"]
files = subprocess.check_output(cmd).strip().split("\n")
files = subprocess.check_output(cmd).decode(sys.stdout.encoding).strip().split("\n")
unhandled_files = []
for f in files:
handled = False
for d in developers:
if d.hasfile(os.path.join(basepath, f)):
if d.hasfile(f):
handled = True
break
if not handled: