mirror of
https://github.com/clearlinux/autospec.git
synced 2026-07-14 00:46:59 +00:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 936534a889 | |||
| d73a1e70d8 | |||
| f07e061437 | |||
| d4144f5efd | |||
| 07a959cc83 | |||
| e36a856c50 | |||
| 2618dc3eb1 | |||
| 8b9384758b | |||
| 94c6be068b | |||
| f4a13a5a93 | |||
| 5424026110 | |||
| e822d6e48d | |||
| 9bfe801c96 | |||
| 412ce5ee2e | |||
| 1fa3bdd6e0 | |||
| 4ea76c998e | |||
| b2d28bb55a | |||
| 4d029647d7 | |||
| 5279a11b53 | |||
| a19cdc79b4 | |||
| 185099bba8 | |||
| 7b01f0ba82 | |||
| 6a4b23bb3e | |||
| c6d7bdb41c | |||
| a16ede7440 | |||
| a62a849262 | |||
| eaa4f711da | |||
| f35655a0cc | |||
| 0c573b604b | |||
| 356da62750 | |||
| b5caddc404 | |||
| 2181c1fe68 | |||
| d6606ad5a8 | |||
| 4d708b6fe2 | |||
| 1bec16fc2e | |||
| 9f33e630cd | |||
| b858a2a990 | |||
| 43d564b0b7 | |||
| 2659038eaa | |||
| dc0ff31b43 | |||
| 3f1fa8e70b | |||
| 840d2ca0e2 | |||
| a5d3013703 | |||
| 381dfd88cc | |||
| f483b68c90 | |||
| 5d6bcfe2f7 | |||
| f9eab4897e | |||
| fbcebd0b3d | |||
| 1f398f5e7b | |||
| 8e89d0cb0e | |||
| 6fa3d52db4 | |||
| 5905be97e8 | |||
| 81e1eebe28 | |||
| 658bd0de10 | |||
| b628caf931 | |||
| 8142032e7c | |||
| 5a302d6c91 | |||
| f56f1fa18d | |||
| 0c408e7089 | |||
| 5471f10f61 | |||
| c02b2fec6a | |||
| 312e1714f2 | |||
| 652616b1b6 | |||
| f4bef72a70 | |||
| 6095ef84a0 | |||
| fa36e95657 | |||
| 3d985ebaf9 | |||
| 1ab68caa3d | |||
| e738c511eb | |||
| da8b975a56 | |||
| 213bb01a2f | |||
| 25ad860d7f | |||
| 750e50d160 | |||
| fae1327921 | |||
| 1eaf8cd10c | |||
| 8c949329a8 | |||
| 537da873db | |||
| e664610c0e | |||
| ab27b0e7ad |
+20
@@ -128,6 +128,14 @@ release
|
|||||||
``.spec``. This is also bumped and generated on existing and new packages,
|
``.spec``. This is also bumped and generated on existing and new packages,
|
||||||
respectively. This results in less manual work via automatic management.
|
respectively. This results in less manual work via automatic management.
|
||||||
|
|
||||||
|
license_skips
|
||||||
|
Each line in the file should be the path to a license file. That path needs
|
||||||
|
to account for the package tarfile prefix. Likely requires using '*' to be
|
||||||
|
effective (e.g. ``pkgname-*/path/to/license`` where ``*`` handles the version).
|
||||||
|
|
||||||
|
Files paths can contain a single '*' per directory such that
|
||||||
|
a line of ``/foo*/bar*`` is allowed but ``/foo*bar*`` is not.
|
||||||
|
|
||||||
$package.license
|
$package.license
|
||||||
In certain cases, the package license may not be automatically discovered. In
|
In certain cases, the package license may not be automatically discovered. In
|
||||||
this instance, ``autospec`` will exit with an error. Update this file to
|
this instance, ``autospec`` will exit with an error. Update this file to
|
||||||
@@ -204,6 +212,12 @@ ${custom}_provides_ban
|
|||||||
Controlling the build process
|
Controlling the build process
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
invalid_release_sig
|
||||||
|
This file contains the current version that will **not** have its package
|
||||||
|
file be processed for signature verification (overriding the config_opt).
|
||||||
|
This file will be automatically deleted after a new release and is intended
|
||||||
|
to override a single bad signed release.
|
||||||
|
|
||||||
extra_sources
|
extra_sources
|
||||||
This file contains a list of extra files to be added to the ``.spec`` and
|
This file contains a list of extra files to be added to the ``.spec`` and
|
||||||
optionally installed as well. Each non-blank and non-comment line should start
|
optionally installed as well. Each non-blank and non-comment line should start
|
||||||
@@ -268,6 +282,12 @@ prep_prepend
|
|||||||
resulting ``.spec``, and is used for situations where fine-grained
|
resulting ``.spec``, and is used for situations where fine-grained
|
||||||
control is required.
|
control is required.
|
||||||
|
|
||||||
|
copy_prepend
|
||||||
|
Additional actions that should take place directly before the source
|
||||||
|
directory is copied for other builds (32bit, avx2, etc). This will be
|
||||||
|
placed in the resulting ``.spec``, and is used for situations where
|
||||||
|
fine-grained control is required.
|
||||||
|
|
||||||
build_prepend
|
build_prepend
|
||||||
Additional actions that should take place after ``%build`` and before
|
Additional actions that should take place after ``%build`` and before
|
||||||
the ``%configure`` macro or equivalent (``%cmake``, etc.). If autospec
|
the ``%configure`` macro or equivalent (``%cmake``, etc.). If autospec
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ def is_file_valid(path):
|
|||||||
|
|
||||||
def dump_symbols(path):
|
def dump_symbols(path):
|
||||||
"""Get symbols from a file."""
|
"""Get symbols from a file."""
|
||||||
cmd = "nm --defined-only -g --dynamic \"{}\"".format(path)
|
cmd = "nm --defined-only -g --dynamic \"{}\" | c++filt".format(path)
|
||||||
lines = None
|
lines = None
|
||||||
|
|
||||||
ret = set()
|
ret = set()
|
||||||
@@ -163,7 +163,7 @@ def dump_symbols(path):
|
|||||||
try:
|
try:
|
||||||
lines = get_output(cmd)
|
lines = get_output(cmd)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Fatal error inspecting {}: {}".format(path, e))
|
util.print_fatal("Fatal error inspecting {}: {}".format(path, e))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
for line in lines.split("\n"):
|
for line in lines.split("\n"):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
@@ -236,6 +236,7 @@ def examine_abi_host(download_path, results_dir, name):
|
|||||||
cwd=download_path)
|
cwd=download_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
util.print_fatal("Error invoking abireport: {}".format(e))
|
util.print_fatal("Error invoking abireport: {}".format(e))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def examine_abi_fallback(download_path, results_dir, name):
|
def examine_abi_fallback(download_path, results_dir, name):
|
||||||
@@ -272,6 +273,7 @@ def examine_abi_fallback(download_path, results_dir, name):
|
|||||||
subprocess.check_call(cmd, shell=True)
|
subprocess.check_call(cmd, shell=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
util.print_fatal("Error extracting RPMS: {}".format(e))
|
util.print_fatal("Error extracting RPMS: {}".format(e))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
os.chdir(download_path)
|
os.chdir(download_path)
|
||||||
collected_files = set()
|
collected_files = set()
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import specfiles
|
|||||||
import tarball
|
import tarball
|
||||||
from abireport import examine_abi
|
from abireport import examine_abi
|
||||||
from logcheck import logcheck
|
from logcheck import logcheck
|
||||||
from util import binary_in_path, print_fatal, write_out
|
from util import binary_in_path, print_build_failed, print_fatal, write_out
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(__file__))
|
sys.path.append(os.path.dirname(__file__))
|
||||||
|
|
||||||
@@ -269,9 +269,13 @@ def package(args, url, name, archives, workingdir):
|
|||||||
pkg_integrity.check(url, conf, interactive=interactive_mode)
|
pkg_integrity.check(url, conf, interactive=interactive_mode)
|
||||||
pkg_integrity.load_specfile(specfile)
|
pkg_integrity.load_specfile(specfile)
|
||||||
|
|
||||||
specfile.write_spec()
|
spec_type = specfile.write_spec()
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
package.package(filemanager, args.mock_config, args.mock_opts, conf, requirements, content, args.cleanup)
|
package.package(filemanager, args.mock_config, args.mock_opts, conf, requirements, content, args.cleanup)
|
||||||
|
if spec_type == "template":
|
||||||
|
# specfile template is assumed "correct" and any failures need to be manually addressed
|
||||||
|
break
|
||||||
filemanager.load_specfile(specfile)
|
filemanager.load_specfile(specfile)
|
||||||
specfile.write_spec()
|
specfile.write_spec()
|
||||||
filemanager.newfiles_printed = 0
|
filemanager.newfiles_printed = 0
|
||||||
@@ -291,7 +295,7 @@ def package(args, url, name, archives, workingdir):
|
|||||||
|
|
||||||
if package.success == 0:
|
if package.success == 0:
|
||||||
conf.create_buildreq_cache(content.version, requirements.buildreqs_cache)
|
conf.create_buildreq_cache(content.version, requirements.buildreqs_cache)
|
||||||
print_fatal("Build failed, aborting")
|
print_build_failed()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif os.path.isfile("README.clear"):
|
elif os.path.isfile("README.clear"):
|
||||||
try:
|
try:
|
||||||
@@ -304,7 +308,8 @@ def package(args, url, name, archives, workingdir):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
check.check_regression(conf.download_path, conf.config_opts['skip_tests'], package.round - 1)
|
if spec_type == "generate":
|
||||||
|
check.check_regression(conf.download_path, conf.config_opts['skip_tests'], package.round - 1)
|
||||||
|
|
||||||
examine_abi(conf.download_path, content.name)
|
examine_abi(conf.download_path, content.name)
|
||||||
if os.path.exists("/var/lib/rpm"):
|
if os.path.exists("/var/lib/rpm"):
|
||||||
|
|||||||
+10
-9
@@ -22,6 +22,7 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ class Build(object):
|
|||||||
return True
|
return True
|
||||||
self.must_restart = 0
|
self.must_restart = 0
|
||||||
self.file_restart = 0
|
self.file_restart = 0
|
||||||
is_clean = True
|
fatals = []
|
||||||
util.call("sync")
|
util.call("sync")
|
||||||
with util.open_auto(filename, "r") as rootlog:
|
with util.open_auto(filename, "r") as rootlog:
|
||||||
loglines = rootlog.readlines()
|
loglines = rootlog.readlines()
|
||||||
@@ -161,9 +162,10 @@ class Build(object):
|
|||||||
for line in loglines:
|
for line in loglines:
|
||||||
match = missing_pat.match(line)
|
match = missing_pat.match(line)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
util.print_fatal("Cannot resolve dependency name: {}".format(match.group(1)))
|
fatals.append(f"Cannot resolve dependency name: {match.group(1)}")
|
||||||
is_clean = False
|
if fatals:
|
||||||
return is_clean
|
util.print_fatal('\n'.join(fatals))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def parse_build_results(self, filename, returncode, filemanager, config, requirements, content):
|
def parse_build_results(self, filename, returncode, filemanager, config, requirements, content):
|
||||||
"""Handle build log contents."""
|
"""Handle build log contents."""
|
||||||
@@ -283,7 +285,7 @@ class Build(object):
|
|||||||
mockopts,
|
mockopts,
|
||||||
]
|
]
|
||||||
|
|
||||||
if not cleanup and self.must_restart == 0 and self.file_restart > 0 and set(filemanager.excludes) == set(filemanager.manual_excludes):
|
if config.config_opts.get('avoid_rebuild') and not cleanup and self.must_restart == 0 and self.file_restart > 0 and set(filemanager.excludes) == set(filemanager.manual_excludes):
|
||||||
cmd_args.append("--no-clean")
|
cmd_args.append("--no-clean")
|
||||||
cmd_args.append("--short-circuit=binary")
|
cmd_args.append("--short-circuit=binary")
|
||||||
|
|
||||||
@@ -295,12 +297,11 @@ class Build(object):
|
|||||||
# sanity check the build log
|
# sanity check the build log
|
||||||
if not os.path.exists(config.download_path + "/results/build.log"):
|
if not os.path.exists(config.download_path + "/results/build.log"):
|
||||||
util.print_fatal("Mock command failed, results log does not exist. User may not have correct permissions.")
|
util.print_fatal("Mock command failed, results log does not exist. User may not have correct permissions.")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not self.parse_buildroot_log(config.download_path + "/results/root.log", ret):
|
self.parse_buildroot_log(config.download_path + "/results/root.log", ret)
|
||||||
return
|
|
||||||
|
|
||||||
self.parse_build_results(config.download_path + "/results/build.log", ret, filemanager, config, requirements, content)
|
self.parse_build_results(config.download_path + "/results/build.log", ret, filemanager, config, requirements, content)
|
||||||
if filemanager.has_banned:
|
if filemanager.has_banned:
|
||||||
util.print_fatal("Content in banned paths found, aborting build")
|
util.print_fatal("Content in banned paths found, aborting build")
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
+39
-6
@@ -147,7 +147,7 @@ def parse_modules_list(modules_string, is_cmake=False):
|
|||||||
modules = [m for m in re.split(r'\s*([><]?=|\${?[^}]*}?)\s*', modules_string)]
|
modules = [m for m in re.split(r'\s*([><]?=|\${?[^}]*}?)\s*', modules_string)]
|
||||||
modules = filter(None, modules)
|
modules = filter(None, modules)
|
||||||
else:
|
else:
|
||||||
modules = [m.strip('[]') for m in modules_string.split()]
|
modules = [m.strip('[]').strip('"') for m in modules_string.split()]
|
||||||
res = []
|
res = []
|
||||||
next_is_ver = False
|
next_is_ver = False
|
||||||
for mod in modules:
|
for mod in modules:
|
||||||
@@ -483,21 +483,50 @@ class Requirements(object):
|
|||||||
def set_build_req(self, config):
|
def set_build_req(self, config):
|
||||||
"""Add build requirements based on the build pattern."""
|
"""Add build requirements based on the build pattern."""
|
||||||
|
|
||||||
|
def findpackage_parse_lines(self, fp_line, line_iter, cmake_modules):
|
||||||
|
"""Parse find_package multiline segment of the line_iter."""
|
||||||
|
qt6module = re.compile(r"^[^#]*find_package\(\s*\bQt6.*", re.I)
|
||||||
|
kf6module = re.compile(r"^[^#]*find_package\(\s*\bKF6.*", re.I)
|
||||||
|
ns = ''
|
||||||
|
if qt6module.search(fp_line):
|
||||||
|
ns = 'qt6'
|
||||||
|
elif kf6module.search(fp_line):
|
||||||
|
ns = 'kf6'
|
||||||
|
while True:
|
||||||
|
ln = next(line_iter).strip()
|
||||||
|
if not ln:
|
||||||
|
continue
|
||||||
|
modules = ln.strip(')').split(' ')
|
||||||
|
for module in modules:
|
||||||
|
if module:
|
||||||
|
if pkg := cmake_modules.get(f"{ns}.{module}"):
|
||||||
|
self.add_buildreq(pkg)
|
||||||
|
if ')' in ln:
|
||||||
|
break
|
||||||
|
|
||||||
def parse_cmake(self, filename, cmake_modules, conf32):
|
def parse_cmake(self, filename, cmake_modules, conf32):
|
||||||
"""Scan a .cmake or CMakeLists.txt file for what's it's actually looking for."""
|
"""Scan a .cmake or CMakeLists.txt file for what's it's actually looking for."""
|
||||||
findpackage = re.compile(r"^[^#]*find_package\((\w+)\b.*\)", re.I)
|
findpackage = re.compile(r"^[^#]*find_package\((\w+)\b.*\)", re.I)
|
||||||
pkgconfig = re.compile(r"^[^#]*pkg_check_modules\s*\(\w+ (.*)\)", re.I)
|
findpackage_multiline = re.compile(r"^[^#]*find_package\((\w+)\b.*", re.I)
|
||||||
|
pkgconfig = re.compile(r"^[^#]*pkg_check_modules\s*\([\w\-]+ (.*)\)", re.I)
|
||||||
pkg_search_modifiers = {'REQUIRED', 'QUIET', 'NO_CMAKE_PATH',
|
pkg_search_modifiers = {'REQUIRED', 'QUIET', 'NO_CMAKE_PATH',
|
||||||
'NO_CMAKE_ENVIRONMENT_PATH', 'IMPORTED_TARGET'}
|
'NO_CMAKE_ENVIRONMENT_PATH', 'IMPORTED_TARGET'}
|
||||||
extractword = re.compile(r'(?:"([^"]+)"|(\S+))(.*)')
|
extractword = re.compile(r'(?:"([^"]+)"|(\S+))(.*)')
|
||||||
|
|
||||||
with util.open_auto(filename, "r") as f:
|
with util.open_auto(filename, "r") as f:
|
||||||
lines = f.readlines()
|
lines = iter(f.readlines())
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if match := findpackage.search(line):
|
if match := findpackage.search(line):
|
||||||
module = match.group(1)
|
module = match.group(1)
|
||||||
if pkg := cmake_modules.get(module):
|
if pkgs := cmake_modules.get(module):
|
||||||
self.add_buildreq(pkg)
|
# Some of the entries in cmake_modules list multiple packages, space-separated, so we need to split.
|
||||||
|
# Otherwise, anything in buildreq_ban would have to match the entire string, not just a single package name.
|
||||||
|
# For example: Png2Ico, extra-cmake-modules png2ico
|
||||||
|
# buildreq_ban would have to contain "extra-cmake-modules png2ico" to match, instead of just "png2ico"
|
||||||
|
for pkg in pkgs.split():
|
||||||
|
self.add_buildreq(pkg)
|
||||||
|
elif findpackage_multiline.search(line):
|
||||||
|
self.findpackage_parse_lines(line, lines, cmake_modules)
|
||||||
|
|
||||||
if match := pkgconfig.search(line):
|
if match := pkgconfig.search(line):
|
||||||
rest = match.group(1)
|
rest = match.group(1)
|
||||||
@@ -727,10 +756,14 @@ class Requirements(object):
|
|||||||
configure_ac_files = []
|
configure_ac_files = []
|
||||||
qmake_profiles = []
|
qmake_profiles = []
|
||||||
cmake_files = []
|
cmake_files = []
|
||||||
|
|
||||||
|
if config.config_opts['use_ninja']:
|
||||||
|
self.add_buildreq('ninja')
|
||||||
|
|
||||||
for dirpath, _, files in os.walk(dirn):
|
for dirpath, _, files in os.walk(dirn):
|
||||||
default_score = 2 if dirpath == dirn else 1
|
default_score = 2 if dirpath == dirn else 1
|
||||||
|
|
||||||
if "Cargo.toml" in files:
|
if "Cargo.toml" in files and 'Makefile' not in files:
|
||||||
config.set_build_pattern('cargo', default_score)
|
config.set_build_pattern('cargo', default_score)
|
||||||
|
|
||||||
if "CMakeLists.txt" in files and "configure.ac" not in files:
|
if "CMakeLists.txt" in files and "configure.ac" not in files:
|
||||||
|
|||||||
+18
-21
@@ -64,50 +64,54 @@ def scan_for_tests(src_dir, config, requirements, content):
|
|||||||
if config.config_opts.get('skip_tests') or tests_config:
|
if config.config_opts.get('skip_tests') or tests_config:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
make_command = "ninja" if config.config_opts.get('use_ninja') else "make"
|
||||||
makeflags = "%{?_smp_mflags} " if config.parallel_build else ""
|
makeflags = "%{?_smp_mflags} " if config.parallel_build else ""
|
||||||
make_check = "make {}check".format(makeflags)
|
make_check = "{} {}check".format(make_command, makeflags)
|
||||||
cmake_check = "make test"
|
cmake_check = "{} test".format(make_command)
|
||||||
make_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
make_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
||||||
"make {}check\nmodule unload openmpi".format(makeflags)
|
"{} {}check\nmodule unload openmpi".format(make_command, makeflags)
|
||||||
cmake_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
cmake_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
||||||
"make test\nmodule unload openmpi"
|
"{} test\nmodule unload openmpi".format(make_command)
|
||||||
|
|
||||||
if config.config_opts.get('allow_test_failures'):
|
if config.config_opts.get('allow_test_failures'):
|
||||||
make_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
make_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
||||||
"make {}check || :\nmodule unload openmpi".format(makeflags)
|
"{} {}check || :\nmodule unload openmpi".format(make_command, makeflags)
|
||||||
cmake_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
cmake_check_openmpi = "module load openmpi\nexport OMPI_MCA_rmaps_base_oversubscribe=1\n" \
|
||||||
"make test || :\nmodule unload openmpi"
|
"{} test || :\nmodule unload openmpi".format(make_command)
|
||||||
|
|
||||||
perl_check = "make TEST_VERBOSE=1 test"
|
perl_check = "{} TEST_VERBOSE=1 test".format(make_command)
|
||||||
setup_check = """PYTHONPATH=%{buildroot}$(python -c "import sys; print(sys.path[-1])") python setup.py test"""
|
|
||||||
meson_check = "meson test -C builddir --print-errorlogs"
|
meson_check = "meson test -C builddir --print-errorlogs"
|
||||||
if config.config_opts.get('allow_test_failures'):
|
if config.config_opts.get('allow_test_failures'):
|
||||||
make_check += " || :"
|
make_check += " || :"
|
||||||
cmake_check += " || :"
|
cmake_check += " || :"
|
||||||
perl_check += " || :"
|
perl_check += " || :"
|
||||||
setup_check += " || :"
|
|
||||||
meson_check += " || :"
|
meson_check += " || :"
|
||||||
|
|
||||||
testsuites = {
|
testsuites = {
|
||||||
"makecheck": make_check,
|
"makecheck": make_check,
|
||||||
"perlcheck": perl_check,
|
"perlcheck": perl_check,
|
||||||
"setup.py": setup_check,
|
|
||||||
"cmake": "cd clr-build; " + cmake_check,
|
"cmake": "cd clr-build; " + cmake_check,
|
||||||
"meson": meson_check,
|
"meson": meson_check,
|
||||||
}
|
}
|
||||||
if config.config_opts.get('32bit'):
|
if config.config_opts.get('32bit'):
|
||||||
testsuites["makecheck"] += "\ncd ../build32;\n" + make_check + " || :"
|
testsuites["makecheck"] += "\ncd ../build32;\n" + make_check + " || :"
|
||||||
testsuites["cmake"] += "\ncd ../clr-build32;\n" + cmake_check + " || :"
|
testsuites["cmake"] += "\ncd ../../build32/clr-build32;\n" + cmake_check + " || :"
|
||||||
testsuites["meson"] += "\ncd ../build32;\n" + meson_check + " || :"
|
testsuites["meson"] += "\ncd ../build32;\n" + meson_check + " || :"
|
||||||
if config.config_opts.get('use_avx2'):
|
if config.config_opts.get('use_avx2'):
|
||||||
testsuites["makecheck"] += "\ncd ../buildavx2;\n" + make_check + " || :"
|
testsuites["makecheck"] += "\ncd ../buildavx2;\n" + make_check + " || :"
|
||||||
testsuites["cmake"] += "\ncd ../clr-build-avx2;\n" + cmake_check + " || :"
|
testsuites["cmake"] += "\ncd ../../buildavx2/clr-build-avx2;\n" + cmake_check + " || :"
|
||||||
|
testsuites["meson"] += "\ncd ../buildavx2;\n" + meson_check + " || :"
|
||||||
if config.config_opts.get('use_avx512'):
|
if config.config_opts.get('use_avx512'):
|
||||||
testsuites["makecheck"] += "\ncd ../buildavx512;\n" + make_check + " || :"
|
testsuites["makecheck"] += "\ncd ../buildavx512;\n" + make_check + " || :"
|
||||||
testsuites["cmake"] += "\ncd ../clr-build-avx512;\n" + cmake_check + " || :"
|
testsuites["cmake"] += "\ncd ../../buildavx512/clr-build-avx512;\n" + cmake_check + " || :"
|
||||||
|
testsuites["meson"] += "\ncd ../buildavx512;\n" + meson_check + " || :"
|
||||||
|
if config.config_opts.get('use_apx'):
|
||||||
|
testsuites["makecheck"] += "\ncd ../buildapx;\n" + make_check + " || :"
|
||||||
|
testsuites["cmake"] += "\ncd ../../buildapx/clr-build-apx;\n" + cmake_check + " || :"
|
||||||
|
testsuites["meson"] += "\ncd ../buildapx;\n" + meson_check + " || :"
|
||||||
if config.config_opts.get('openmpi'):
|
if config.config_opts.get('openmpi'):
|
||||||
testsuites["makecheck"] += "\ncd ../build-openmpi;\n" + make_check_openmpi
|
testsuites["makecheck"] += "\ncd ../build-openmpi;\n" + make_check_openmpi
|
||||||
testsuites["cmake"] += "\ncd ../clr-build-openmpi;\n" + cmake_check_openmpi
|
testsuites["cmake"] += "\ncd ../../build-openmpi/clr-build-openmpi;\n" + cmake_check_openmpi
|
||||||
|
|
||||||
files = os.listdir(src_dir)
|
files = os.listdir(src_dir)
|
||||||
|
|
||||||
@@ -138,13 +142,6 @@ def scan_for_tests(src_dir, config, requirements, content):
|
|||||||
elif config.default_pattern in ["cpan"] and "Makefile.PL" in files:
|
elif config.default_pattern in ["cpan"] and "Makefile.PL" in files:
|
||||||
tests_config = testsuites["perlcheck"]
|
tests_config = testsuites["perlcheck"]
|
||||||
|
|
||||||
elif config.default_pattern == "distutils3" and "setup.py" in files:
|
|
||||||
with util.open_auto(os.path.join(src_dir, "setup.py"), 'r') as setup_fp:
|
|
||||||
setup_contents = setup_fp.read()
|
|
||||||
|
|
||||||
if "test_suite" in setup_contents or "pbr=True" in setup_contents:
|
|
||||||
tests_config = testsuites["setup.py"]
|
|
||||||
|
|
||||||
elif config.default_pattern == "R":
|
elif config.default_pattern == "R":
|
||||||
tests_config = "export _R_CHECK_FORCE_SUGGESTS_=false\n" \
|
tests_config = "export _R_CHECK_FORCE_SUGGESTS_=false\n" \
|
||||||
"R CMD check --no-manual --no-examples --no-codoc . " \
|
"R CMD check --no-manual --no-examples --no-codoc . " \
|
||||||
|
|||||||
+19
-2
@@ -266,6 +266,7 @@ KSMServerDBusInterface, plasma-workspace-dev
|
|||||||
KSaneCore, ksanecore-dev
|
KSaneCore, ksanecore-dev
|
||||||
KScreenLocker, kscreenlocker-dev
|
KScreenLocker, kscreenlocker-dev
|
||||||
KSysGuard, libksysguard-dev
|
KSysGuard, libksysguard-dev
|
||||||
|
KUserFeedback, kuserfeedback-dev
|
||||||
KWaylandServer, kwayland-server-dev
|
KWaylandServer, kwayland-server-dev
|
||||||
KWinDBusInterface, kwin-dev
|
KWinDBusInterface, kwin-dev
|
||||||
KWinEffects, kwin-dev
|
KWinEffects, kwin-dev
|
||||||
@@ -288,7 +289,6 @@ LibIcal, libical-dev
|
|||||||
LibKEduVocDocument, libkeduvocdocument-dev
|
LibKEduVocDocument, libkeduvocdocument-dev
|
||||||
LibKWorkspace, plasma-workspace-dev
|
LibKWorkspace, plasma-workspace-dev
|
||||||
LibKompareDiff2, libkomparediff2-dev
|
LibKompareDiff2, libkomparediff2-dev
|
||||||
LibLZMA, xz-dev
|
|
||||||
LibNotificationManager, plasma-workspace-dev
|
LibNotificationManager, plasma-workspace-dev
|
||||||
LibObs, obs-studio-dev
|
LibObs, obs-studio-dev
|
||||||
LibTaskManager, plasma-workspace-dev
|
LibTaskManager, plasma-workspace-dev
|
||||||
@@ -329,6 +329,7 @@ PerlLibs, perl
|
|||||||
Phonon4Qt5, phonon-dev
|
Phonon4Qt5, phonon-dev
|
||||||
Phonon4Qt5Experimental, phonon-dev
|
Phonon4Qt5Experimental, phonon-dev
|
||||||
PkgConfig, pkg-config
|
PkgConfig, pkg-config
|
||||||
|
PlasmaActivities, plasma-activities-dev
|
||||||
PlasmaPotdProvider, kdeplasma-addons-dev
|
PlasmaPotdProvider, kdeplasma-addons-dev
|
||||||
PlasmaWaylandProtocols, plasma-wayland-protocols-dev
|
PlasmaWaylandProtocols, plasma-wayland-protocols-dev
|
||||||
Png2Ico, extra-cmake-modules png2ico
|
Png2Ico, extra-cmake-modules png2ico
|
||||||
@@ -346,7 +347,7 @@ Python3, python3-dev
|
|||||||
PythonInterp, python3
|
PythonInterp, python3
|
||||||
PythonLibs, python3-dev
|
PythonLibs, python3-dev
|
||||||
QGpgme, gpgme-dev gpgme-extras
|
QGpgme, gpgme-dev gpgme-extras
|
||||||
QHelpGenerator, extra-cmake-modules qttools-dev
|
QHelpGenerator, extra-cmake-modules qt6tools-dev
|
||||||
QMobipocket, kdegraphics-mobipocket-dev
|
QMobipocket, kdegraphics-mobipocket-dev
|
||||||
Qca-qt5, qca-qt5-dev
|
Qca-qt5, qca-qt5-dev
|
||||||
Qt3DTests, qt6base-dev
|
Qt3DTests, qt6base-dev
|
||||||
@@ -901,6 +902,19 @@ igsc, igsc-dev
|
|||||||
json-c, json-c-dev
|
json-c, json-c-dev
|
||||||
kColorPicker, kcolorpicker-dev
|
kColorPicker, kcolorpicker-dev
|
||||||
kImageAnnotator, kimageannotator-dev
|
kImageAnnotator, kimageannotator-dev
|
||||||
|
kf6.Config, kconfig-dev
|
||||||
|
kf6.CoreAddons, kcoreaddons-dev
|
||||||
|
kf6.Crash, kcrash-dev
|
||||||
|
kf6.DBusAddons, kdbusaddons-dev
|
||||||
|
kf6.FileMetaData, kfilemetadata-dev
|
||||||
|
kf6.I18n, ki18n-dev
|
||||||
|
kf6.JobWidgets, kjobwidgets-dev
|
||||||
|
kf6.KIO, kio-dev
|
||||||
|
kf6.Notifications, knotifications-dev
|
||||||
|
kf6.Purpose, purpose-dev
|
||||||
|
kf6.Runner, krunner-dev
|
||||||
|
kf6.Service, kservice-dev
|
||||||
|
kf6.StatusNotifierItem, kstatusnotifieritem-dev
|
||||||
kim-api, kim-api-data
|
kim-api, kim-api-data
|
||||||
leveldb, leveldb-dev
|
leveldb, leveldb-dev
|
||||||
libavif, libavif-dev
|
libavif, libavif-dev
|
||||||
@@ -926,6 +940,9 @@ pugixml, pugixml-dev
|
|||||||
pybind11, pypi(pybind11)
|
pybind11, pypi(pybind11)
|
||||||
qt5xdg, libqtxdg-data
|
qt5xdg, libqtxdg-data
|
||||||
qt5xdgiconloader, libqtxdg-data
|
qt5xdgiconloader, libqtxdg-data
|
||||||
|
qt6.DBus, qt6base-dev
|
||||||
|
qt6.Gui, qt6base-dev
|
||||||
|
qt6.Widgets, qt6base-dev
|
||||||
qtxdg-tools, qtxdg-tools-data
|
qtxdg-tools, qtxdg-tools-data
|
||||||
rabbitmq-c, rabbitmq-c-dev
|
rabbitmq-c, rabbitmq-c-dev
|
||||||
realsense2, librealsense-dev
|
realsense2, librealsense-dev
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def scan_for_changes(download_path, directory, transforms):
|
|||||||
shutil.copy(source, target)
|
shutil.copy(source, target)
|
||||||
os.chmod(target, 0o644)
|
os.chmod(target, 0o644)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Error copying file: {}".format(e))
|
util.print_fatal("Error copying file: {}".format(e))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
found.append(item)
|
found.append(item)
|
||||||
|
|
||||||
|
|||||||
+56
-10
@@ -28,7 +28,8 @@ from collections import OrderedDict
|
|||||||
|
|
||||||
import check
|
import check
|
||||||
import license
|
import license
|
||||||
from util import call, open_auto, print_info, print_warning, write_out
|
from util import (call, open_auto, print_fatal, print_info, print_warning,
|
||||||
|
write_out)
|
||||||
|
|
||||||
|
|
||||||
def read_pattern_conf(filename, dest, list_format=False, path=None):
|
def read_pattern_conf(filename, dest, list_format=False, path=None):
|
||||||
@@ -68,12 +69,14 @@ class Config(object):
|
|||||||
|
|
||||||
def __init__(self, download_path):
|
def __init__(self, download_path):
|
||||||
"""Initialize Default configuration settings."""
|
"""Initialize Default configuration settings."""
|
||||||
|
self.cargo_vendors = ""
|
||||||
self.content = None # hack to avoid circular init dependency
|
self.content = None # hack to avoid circular init dependency
|
||||||
self.extra_configure = ""
|
self.extra_configure = ""
|
||||||
self.extra_configure32 = ""
|
self.extra_configure32 = ""
|
||||||
self.extra_configure64 = ""
|
self.extra_configure64 = ""
|
||||||
self.extra_configure_avx2 = ""
|
self.extra_configure_avx2 = ""
|
||||||
self.extra_configure_avx512 = ""
|
self.extra_configure_avx512 = ""
|
||||||
|
self.extra_configure_apx = ""
|
||||||
self.extra_configure_openmpi = ""
|
self.extra_configure_openmpi = ""
|
||||||
self.config_files = set()
|
self.config_files = set()
|
||||||
self.parallel_build = " %{?_smp_mflags} "
|
self.parallel_build = " %{?_smp_mflags} "
|
||||||
@@ -90,6 +93,7 @@ class Config(object):
|
|||||||
self.install_macro = "%make_install"
|
self.install_macro = "%make_install"
|
||||||
self.disable_static = "--disable-static"
|
self.disable_static = "--disable-static"
|
||||||
self.prep_prepend = []
|
self.prep_prepend = []
|
||||||
|
self.copy_prepend = []
|
||||||
self.build_prepend = []
|
self.build_prepend = []
|
||||||
self.build_prepend_once = []
|
self.build_prepend_once = []
|
||||||
self.build_append = []
|
self.build_append = []
|
||||||
@@ -106,6 +110,7 @@ class Config(object):
|
|||||||
self.custom_summ = ""
|
self.custom_summ = ""
|
||||||
self.license_fetch = None
|
self.license_fetch = None
|
||||||
self.license_show = None
|
self.license_show = None
|
||||||
|
self.license_skips = []
|
||||||
self.git_uri = None
|
self.git_uri = None
|
||||||
self.os_packages = set()
|
self.os_packages = set()
|
||||||
self.config_file = None
|
self.config_file = None
|
||||||
@@ -114,12 +119,15 @@ class Config(object):
|
|||||||
self.old_keyid = None
|
self.old_keyid = None
|
||||||
self.profile_payload = None
|
self.profile_payload = None
|
||||||
self.signature = None
|
self.signature = None
|
||||||
|
self.signature_macro = None
|
||||||
|
self.pkey_macro = None
|
||||||
self.yum_conf = None
|
self.yum_conf = None
|
||||||
self.failed_pattern_dir = None
|
self.failed_pattern_dir = None
|
||||||
self.alias = None
|
self.alias = None
|
||||||
self.failed_commands = {}
|
self.failed_commands = {}
|
||||||
self.ignored_commands = {}
|
self.ignored_commands = {}
|
||||||
self.gems = {}
|
self.gems = {}
|
||||||
|
self.keyid_blocklist = {}
|
||||||
self.license_hashes = {}
|
self.license_hashes = {}
|
||||||
self.license_translations = {}
|
self.license_translations = {}
|
||||||
self.license_blacklist = {}
|
self.license_blacklist = {}
|
||||||
@@ -150,9 +158,11 @@ class Config(object):
|
|||||||
}
|
}
|
||||||
self.config_opts = {}
|
self.config_opts = {}
|
||||||
self.config_options = {
|
self.config_options = {
|
||||||
|
"avoid_rebuild": "Try to use mock short circuit to avoid full rebuilds",
|
||||||
"broken_c++": "extend flags with '-std=gnu++98",
|
"broken_c++": "extend flags with '-std=gnu++98",
|
||||||
"cargo_vendor": "create vendor archive with cargo",
|
"cargo_vendor": "create vendor archive with cargo",
|
||||||
"use_lto": "configure build for lto",
|
"use_lto": "configure build for lto",
|
||||||
|
"use_apx": "configure build for APX",
|
||||||
"use_avx2": "configure build for avx2",
|
"use_avx2": "configure build for avx2",
|
||||||
"use_avx512": "configure build for avx512",
|
"use_avx512": "configure build for avx512",
|
||||||
"keepstatic": "do not remove static libraries",
|
"keepstatic": "do not remove static libraries",
|
||||||
@@ -180,7 +190,9 @@ class Config(object):
|
|||||||
"nodebug": "do not generate debuginfo for this package",
|
"nodebug": "do not generate debuginfo for this package",
|
||||||
"openmpi": "configure build also for openmpi",
|
"openmpi": "configure build also for openmpi",
|
||||||
"server": "Package is only used by servers",
|
"server": "Package is only used by servers",
|
||||||
"no_glob": "Do not use the replacement pattern for file matching"
|
"no_glob": "Do not use the replacement pattern for file matching",
|
||||||
|
"allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged",
|
||||||
|
"use_ninja": "Use ninja build files",
|
||||||
}
|
}
|
||||||
# simple_pattern_pkgconfig patterns
|
# simple_pattern_pkgconfig patterns
|
||||||
# contains patterns for parsing build.log for missing dependencies
|
# contains patterns for parsing build.log for missing dependencies
|
||||||
@@ -260,6 +272,7 @@ class Config(object):
|
|||||||
(r"Can't locate [a-zA-Z0-9_\-\/\.]+ in @INC \(you may need to install the ([a-zA-Z0-9_\-:]+) module\)", 0, 'perl'),
|
(r"Can't locate [a-zA-Z0-9_\-\/\.]+ in @INC \(you may need to install the ([a-zA-Z0-9_\-:]+) module\)", 0, 'perl'),
|
||||||
(r"Cannot find ([a-zA-Z0-9\-_\.]*)", 1, None),
|
(r"Cannot find ([a-zA-Z0-9\-_\.]*)", 1, None),
|
||||||
(r"Checking for (.*?)\.\.\.no", 0, None),
|
(r"Checking for (.*?)\.\.\.no", 0, None),
|
||||||
|
(r"checking for (.*?) \(using pkg-config\)\.\.\. no", 0, None),
|
||||||
(r"Checking for (.*?)\s*: not found", 0, None),
|
(r"Checking for (.*?)\s*: not found", 0, None),
|
||||||
(r"Checking for (.*?)\s>=.*\s*: not found", 0, None),
|
(r"Checking for (.*?)\s>=.*\s*: not found", 0, None),
|
||||||
(r"Could not find suitable distribution for Requirement.parse\('([a-zA-Z\-\.]*)", 0, None),
|
(r"Could not find suitable distribution for Requirement.parse\('([a-zA-Z\-\.]*)", 0, None),
|
||||||
@@ -282,10 +295,12 @@ class Config(object):
|
|||||||
(r"No rule to make target `(.*)',", 0, None),
|
(r"No rule to make target `(.*)',", 0, None),
|
||||||
(r"Package (.*) was not found in the pkg-config search path.", 0, 'pkgconfig'),
|
(r"Package (.*) was not found in the pkg-config search path.", 0, 'pkgconfig'),
|
||||||
(r"Package '([a-zA-Z0-9\-:]*)', required by '.*', not found", 0, 'pkgconfig'),
|
(r"Package '([a-zA-Z0-9\-:]*)', required by '.*', not found", 0, 'pkgconfig'),
|
||||||
|
(r"The file `([a-zA-Z0-9\-:]*)\.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory\.", 0, 'pkgconfig'),
|
||||||
(r"Package which this enhances but not available for checking: ['‘]([a-zA-Z0-9\-]*)['’]", 0, 'R'),
|
(r"Package which this enhances but not available for checking: ['‘]([a-zA-Z0-9\-]*)['’]", 0, 'R'),
|
||||||
(r"Perhaps you should add the directory containing `([a-zA-Z0-9\-:]*)\.pc'", 0, 'pkgconfig'),
|
(r"Perhaps you should add the directory containing `([a-zA-Z0-9\-:]*)\.pc'", 0, 'pkgconfig'),
|
||||||
(r"Program (.*) found: NO", 0, None),
|
(r"Program (.*) found: NO", 0, None),
|
||||||
(r"Target '[a-zA-Z0-9\-]' can't be generated as '(.*)' could not be found", 0, None),
|
(r"Target '[a-zA-Z0-9\-]' can't be generated as '(.*)' could not be found", 0, None),
|
||||||
|
(r"The missing Perl modules are:\s*(\S+)", 0, 'perl'),
|
||||||
(r"Unable to `import (.*)`", 0, None),
|
(r"Unable to `import (.*)`", 0, None),
|
||||||
(r"Unable to find '(.*)'", 0, None),
|
(r"Unable to find '(.*)'", 0, None),
|
||||||
(r"Warning: prerequisite ([a-zA-Z:]+) [0-9\.]+ not found.", 0, 'perl'),
|
(r"Warning: prerequisite ([a-zA-Z:]+) [0-9\.]+ not found.", 0, 'perl'),
|
||||||
@@ -306,6 +321,7 @@ class Config(object):
|
|||||||
(r"checking for [a-zA-Z0-9\_\-]+ in (.*?)\.\.\. no", 0, None),
|
(r"checking for [a-zA-Z0-9\_\-]+ in (.*?)\.\.\. no", 0, None),
|
||||||
(r"checking for library containing (.*)... no", 0, None),
|
(r"checking for library containing (.*)... no", 0, None),
|
||||||
(r"checking for perl module ([a-zA-Z:]+) [0-9\.]+... no", 0, 'perl'),
|
(r"checking for perl module ([a-zA-Z:]+) [0-9\.]+... no", 0, 'perl'),
|
||||||
|
("checking if (.*) is available...", 0, None),
|
||||||
(r"configure: error: (?:pkg-config missing|Unable to locate) (.*)", 0, None),
|
(r"configure: error: (?:pkg-config missing|Unable to locate) (.*)", 0, None),
|
||||||
(r"configure: error: ([a-zA-Z0-9]+) (?:is required to build|not found)", 0, None),
|
(r"configure: error: ([a-zA-Z0-9]+) (?:is required to build|not found)", 0, None),
|
||||||
(r"configure: error: Cannot find (.*)\. Make sure", 0, None),
|
(r"configure: error: Cannot find (.*)\. Make sure", 0, None),
|
||||||
@@ -331,7 +347,7 @@ class Config(object):
|
|||||||
def detect_build_from_url(self, url):
|
def detect_build_from_url(self, url):
|
||||||
"""Detect build patterns and build requirements from the patterns detected in the url."""
|
"""Detect build patterns and build requirements from the patterns detected in the url."""
|
||||||
# R package
|
# R package
|
||||||
if "cran.r-project.org" in url or "cran.rstudio.com" in url:
|
if "cran.r-project.org" in url or "cran.rstudio.com" in url or "/pub/cran/" in url:
|
||||||
self.set_build_pattern("R", 10)
|
self.set_build_pattern("R", 10)
|
||||||
|
|
||||||
# python
|
# python
|
||||||
@@ -428,20 +444,24 @@ class Config(object):
|
|||||||
# next the options
|
# next the options
|
||||||
config_f['autospec'] = {}
|
config_f['autospec'] = {}
|
||||||
for fname, comment in sorted(self.config_options.items()):
|
for fname, comment in sorted(self.config_options.items()):
|
||||||
|
fpath = os.path.join(self.download_path, fname)
|
||||||
config_f.set('autospec', '# {}'.format(comment))
|
config_f.set('autospec', '# {}'.format(comment))
|
||||||
if os.path.exists(fname):
|
if os.path.isfile(fpath):
|
||||||
config_f['autospec'][fname] = 'true'
|
config_f['autospec'][fname] = 'true'
|
||||||
os.remove(fname)
|
os.remove(fpath)
|
||||||
else:
|
else:
|
||||||
config_f['autospec'][fname] = 'false'
|
config_f['autospec'][fname] = 'false'
|
||||||
|
|
||||||
# default lto to true for new things
|
# default lto to true for new things
|
||||||
config_f['autospec']['use_lto'] = 'true'
|
config_f['autospec']['use_lto'] = 'true'
|
||||||
|
# default autoupdate to true for new things
|
||||||
|
config_f['autospec']['autoupdate'] = 'true'
|
||||||
|
|
||||||
# renamed options need special care
|
# renamed options need special care
|
||||||
if os.path.exists("skip_test_suite"):
|
skip_path = os.path.join(self.download_path, "skip_test_suite")
|
||||||
|
if os.path.exists(skip_path):
|
||||||
config_f['autospec']['skip_tests'] = 'true'
|
config_f['autospec']['skip_tests'] = 'true'
|
||||||
os.remove("skip_test_suite")
|
os.remove(skip_path)
|
||||||
self.write_config(config_f)
|
self.write_config(config_f)
|
||||||
|
|
||||||
def create_buildreq_cache(self, version, buildreqs_cache):
|
def create_buildreq_cache(self, version, buildreqs_cache):
|
||||||
@@ -472,7 +492,7 @@ class Config(object):
|
|||||||
config_f = configparser.ConfigParser(interpolation=None)
|
config_f = configparser.ConfigParser(interpolation=None)
|
||||||
config_f.read(opts_path)
|
config_f.read(opts_path)
|
||||||
if "autospec" not in config_f.sections():
|
if "autospec" not in config_f.sections():
|
||||||
print("Missing autospec section in options.conf")
|
print_fatal("Missing autospec section in options.conf")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if 'package' in config_f.sections() and config_f['package'].get('alias'):
|
if 'package' in config_f.sections() and config_f['package'].get('alias'):
|
||||||
@@ -600,6 +620,7 @@ class Config(object):
|
|||||||
read_pattern_conf("license_blacklist", self.license_blacklist, list_format=True, path=path)
|
read_pattern_conf("license_blacklist", self.license_blacklist, list_format=True, path=path)
|
||||||
read_pattern_conf("qt_modules", self.qt_modules, path=path)
|
read_pattern_conf("qt_modules", self.qt_modules, path=path)
|
||||||
read_pattern_conf("cmake_modules", self.cmake_modules, path=path)
|
read_pattern_conf("cmake_modules", self.cmake_modules, path=path)
|
||||||
|
read_pattern_conf("keyid_blocklist", self.keyid_blocklist, list_format=True, path=path)
|
||||||
|
|
||||||
def parse_existing_spec(self, name):
|
def parse_existing_spec(self, name):
|
||||||
"""Determine the old version, old patch list, old keyid, and cves from old spec file."""
|
"""Determine the old version, old patch list, old keyid, and cves from old spec file."""
|
||||||
@@ -693,7 +714,7 @@ class Config(object):
|
|||||||
config.read(self.config_file)
|
config.read(self.config_file)
|
||||||
|
|
||||||
if "autospec" not in config.sections():
|
if "autospec" not in config.sections():
|
||||||
print("Missing autospec section..")
|
print_fatal("Missing autospec section..")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
self.git_uri = config['autospec'].get('git', None)
|
self.git_uri = config['autospec'].get('git', None)
|
||||||
@@ -816,6 +837,18 @@ class Config(object):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print_warning(f"Unable to remove buildreq_cache file: {e}")
|
print_warning(f"Unable to remove buildreq_cache file: {e}")
|
||||||
|
|
||||||
|
invalid_release_sig_file = os.path.join(self.download_path, "invalid_release_sig")
|
||||||
|
content = self.read_conf_file(invalid_release_sig_file)
|
||||||
|
if content and content[0] == version:
|
||||||
|
self.config_opts['verify_required'] = False
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
os.unlink(invalid_release_sig_file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
print_warning(f"Unable to remove invalid_release_sig file: {e}")
|
||||||
|
|
||||||
content = self.read_conf_file(os.path.join(self.download_path, "pkgconfig_add"))
|
content = self.read_conf_file(os.path.join(self.download_path, "pkgconfig_add"))
|
||||||
for extra in content:
|
for extra in content:
|
||||||
extra = pkgconfig_re.sub(r'\1', extra)
|
extra = pkgconfig_re.sub(r'\1', extra)
|
||||||
@@ -875,7 +908,7 @@ class Config(object):
|
|||||||
|
|
||||||
self.patches += self.read_conf_file(os.path.join(self.download_path, "series"))
|
self.patches += self.read_conf_file(os.path.join(self.download_path, "series"))
|
||||||
pfiles = [("%s/%s" % (self.download_path, x.split(" ")[0])) for x in self.patches]
|
pfiles = [("%s/%s" % (self.download_path, x.split(" ")[0])) for x in self.patches]
|
||||||
cmd = "grep -E \"(\+\+\+|\-\-\-).*((Makefile.am)|(aclocal.m4)|(configure.ac|configure.in))\" %s" % " ".join(pfiles) # noqa: W605
|
cmd = "grep -E \"(+++|---).*((Makefile.am)|(aclocal.m4)|(configure.ac|configure.in))\" %s" % " ".join(pfiles) # noqa: W605
|
||||||
if self.patches and call(cmd,
|
if self.patches and call(cmd,
|
||||||
check=False,
|
check=False,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
@@ -908,6 +941,9 @@ class Config(object):
|
|||||||
content = self.read_conf_file(os.path.join(self.download_path, "configure_avx512"))
|
content = self.read_conf_file(os.path.join(self.download_path, "configure_avx512"))
|
||||||
self.extra_configure_avx512 = " \\\n".join(content)
|
self.extra_configure_avx512 = " \\\n".join(content)
|
||||||
|
|
||||||
|
content = self.read_conf_file(os.path.join(self.download_path, "configure_apx"))
|
||||||
|
self.extra_configure_apx = " \\\n".join(content)
|
||||||
|
|
||||||
content = self.read_conf_file(os.path.join(self.download_path, "configure_openmpi"))
|
content = self.read_conf_file(os.path.join(self.download_path, "configure_openmpi"))
|
||||||
self.extra_configure_openmpi = " \\\n".join(content)
|
self.extra_configure_openmpi = " \\\n".join(content)
|
||||||
|
|
||||||
@@ -973,6 +1009,15 @@ class Config(object):
|
|||||||
if not license.add_license(word, self.license_translations, self.license_blacklist):
|
if not license.add_license(word, self.license_translations, self.license_blacklist):
|
||||||
print_warning("{}: blacklisted license {} ignored.".format(self.content.name + ".license", word))
|
print_warning("{}: blacklisted license {} ignored.".format(self.content.name + ".license", word))
|
||||||
|
|
||||||
|
content = self.read_conf_file(os.path.join(self.download_path, "license_skips"))
|
||||||
|
if content:
|
||||||
|
self.license_skips = self.validate_extras_content(content, "license_skips")
|
||||||
|
|
||||||
|
# cargo_vendors is the output of 'cargo vendor' and should be read as is
|
||||||
|
content = self.read_file(os.path.join(self.download_path, "cargo_vendors"), track=True)
|
||||||
|
if content:
|
||||||
|
self.cargo_vendors = "".join(content)
|
||||||
|
|
||||||
if self.config_opts['use_clang']:
|
if self.config_opts['use_clang']:
|
||||||
self.config_opts['funroll-loops'] = False
|
self.config_opts['funroll-loops'] = False
|
||||||
requirements.add_buildreq("llvm")
|
requirements.add_buildreq("llvm")
|
||||||
@@ -991,6 +1036,7 @@ class Config(object):
|
|||||||
requirements.add_buildreq("openssh")
|
requirements.add_buildreq("openssh")
|
||||||
|
|
||||||
self.prep_prepend = self.read_script_file(os.path.join(self.download_path, "prep_prepend"))
|
self.prep_prepend = self.read_script_file(os.path.join(self.download_path, "prep_prepend"))
|
||||||
|
self.copy_prepend = self.read_script_file(os.path.join(self.download_path, "copy_prepend"))
|
||||||
if os.path.isfile(os.path.join(self.download_path, "prep_append")):
|
if os.path.isfile(os.path.join(self.download_path, "prep_append")):
|
||||||
os.rename(os.path.join(self.download_path, "prep_append"), os.path.join(self.download_path, "build_prepend"))
|
os.rename(os.path.join(self.download_path, "prep_append"), os.path.join(self.download_path, "build_prepend"))
|
||||||
self.make_prepend = self.read_script_file(os.path.join(self.download_path, "make_prepend"))
|
self.make_prepend = self.read_script_file(os.path.join(self.download_path, "make_prepend"))
|
||||||
|
|||||||
+109
-20
@@ -12,6 +12,7 @@
|
|||||||
-lICE, pkgconfig(ice)
|
-lICE, pkgconfig(ice)
|
||||||
-lIlmThread, ilmbase-dev
|
-lIlmThread, ilmbase-dev
|
||||||
-lSM, pkgconfig(sm)
|
-lSM, pkgconfig(sm)
|
||||||
|
-lTerminfo, ncurses-dev
|
||||||
-lX11, pkgconfig(x11)
|
-lX11, pkgconfig(x11)
|
||||||
-lXau, libXau-dev
|
-lXau, libXau-dev
|
||||||
-lXaw, pkgconfig(xaw)
|
-lXaw, pkgconfig(xaw)
|
||||||
@@ -75,7 +76,6 @@
|
|||||||
-lkrb5, krb5-dev
|
-lkrb5, krb5-dev
|
||||||
-lldap, openldap-dev
|
-lldap, openldap-dev
|
||||||
-lldb, ldb-dev
|
-lldb, ldb-dev
|
||||||
-llzma, xz-dev
|
|
||||||
-llzo, lzo-dev
|
-llzo, lzo-dev
|
||||||
-lmagic, file-dev
|
-lmagic, file-dev
|
||||||
-lmenu, ncurses-dev
|
-lmenu, ncurses-dev
|
||||||
@@ -99,11 +99,11 @@
|
|||||||
-lrdmacm, rdma-core-dev
|
-lrdmacm, rdma-core-dev
|
||||||
-lreadline, readline-dev
|
-lreadline, readline-dev
|
||||||
-lsecret, libsecret-dev
|
-lsecret, libsecret-dev
|
||||||
|
-lsecret, pkgconfig(libsecret-1)
|
||||||
-lsensors, lm-sensors-dev
|
-lsensors, lm-sensors-dev
|
||||||
-lsqlite3, sqlite-autoconf-dev
|
-lsqlite3, sqlite-autoconf-dev
|
||||||
-lssh, libssh-dev
|
-lssh, libssh-dev
|
||||||
-lssl, openssl-dev
|
-lssl, openssl-dev
|
||||||
-lTerminfo, ncurses-dev
|
|
||||||
-ltermcap, ncurses-dev
|
-ltermcap, ncurses-dev
|
||||||
-ltinfo, ncurses-dev
|
-ltinfo, ncurses-dev
|
||||||
-ltinfow, ncurses-dev
|
-ltinfow, ncurses-dev
|
||||||
@@ -124,11 +124,14 @@ ACL_TYPE_EXTENDED, acl-dev
|
|||||||
ALSA, alsa-lib-dev
|
ALSA, alsa-lib-dev
|
||||||
APR, apr-dev
|
APR, apr-dev
|
||||||
APR-util, apr-util-dev
|
APR-util, apr-util-dev
|
||||||
|
ARPACK-NG, arpack-ng-dev
|
||||||
ASSIMP, assimp-dev
|
ASSIMP, assimp-dev
|
||||||
|
Adwaita, libadwaita-dev
|
||||||
Analitza, analitza-dev
|
Analitza, analitza-dev
|
||||||
Analitza5, analitza-dev
|
Analitza5, analitza-dev
|
||||||
BABL, babl-dev
|
BABL, babl-dev
|
||||||
BISON, bison
|
BISON, bison
|
||||||
|
BROTLI, brotli-dev
|
||||||
BZ2_bzCompress, bzip2-dev
|
BZ2_bzCompress, bzip2-dev
|
||||||
BZip2, bzip2-dev
|
BZip2, bzip2-dev
|
||||||
Berkeley DB, db
|
Berkeley DB, db
|
||||||
@@ -138,6 +141,7 @@ Boost, boost-dev
|
|||||||
Breeze, breeze-dev
|
Breeze, breeze-dev
|
||||||
CAIRO, cairo-dev
|
CAIRO, cairo-dev
|
||||||
CARES, c-ares-dev
|
CARES, c-ares-dev
|
||||||
|
CFITSIO, cfitsio-dev
|
||||||
CGAL, CGAL-dev
|
CGAL, CGAL-dev
|
||||||
CHECK, check
|
CHECK, check
|
||||||
CLUTTER, clutter-dev
|
CLUTTER, clutter-dev
|
||||||
@@ -173,7 +177,9 @@ EXPAT, expat-dev
|
|||||||
Eet.h, eet-dev
|
Eet.h, eet-dev
|
||||||
Eigen/Core, eigen-dev
|
Eigen/Core, eigen-dev
|
||||||
Eigen/Dense, eigen-dev
|
Eigen/Dense, eigen-dev
|
||||||
|
Eigen/Sparse, eigen-dev
|
||||||
Eigen3, eigen-dev
|
Eigen3, eigen-dev
|
||||||
|
Epoxy, pkgconfig(epoxy)
|
||||||
Exiv2, exiv2-dev
|
Exiv2, exiv2-dev
|
||||||
Expat 1.95.x, expat-dev
|
Expat 1.95.x, expat-dev
|
||||||
Expat XML Parser, expat-dev
|
Expat XML Parser, expat-dev
|
||||||
@@ -254,6 +260,7 @@ Fontconfig, pkgconfig(fontconfig)
|
|||||||
FreeType 2, freetype-dev
|
FreeType 2, freetype-dev
|
||||||
Freetype, freetype-dev
|
Freetype, freetype-dev
|
||||||
GCRYPT, libgcrypt-dev
|
GCRYPT, libgcrypt-dev
|
||||||
|
GCrypt, libgcrypt-dev
|
||||||
GD, gd-dev
|
GD, gd-dev
|
||||||
GDBM, gdbm-dev
|
GDBM, gdbm-dev
|
||||||
GDM_PAM_EXTENSIONS, gdm-dev
|
GDM_PAM_EXTENSIONS, gdm-dev
|
||||||
@@ -280,9 +287,11 @@ GSTREAMER, gstreamer-dev
|
|||||||
GSettingSchemas, gsettings-desktop-schemas
|
GSettingSchemas, gsettings-desktop-schemas
|
||||||
GSettingSchemas, gsettings-desktop-schemas-dev
|
GSettingSchemas, gsettings-desktop-schemas-dev
|
||||||
GTK, gtk+-dev
|
GTK, gtk+-dev
|
||||||
|
GTK4, gtk4-dev
|
||||||
GnuTLS, gnutls-dev
|
GnuTLS, gnutls-dev
|
||||||
GooglePerftools, gperftools-dev
|
GooglePerftools, gperftools-dev
|
||||||
Gperf, gperf
|
Gperf, gperf
|
||||||
|
Gpgme, pkgconfig(gpgme)
|
||||||
Gpgmepp, gpgme-dev
|
Gpgmepp, gpgme-dev
|
||||||
Gphoto2, libgphoto2-dev
|
Gphoto2, libgphoto2-dev
|
||||||
Grantlee5, grantlee-dev
|
Grantlee5, grantlee-dev
|
||||||
@@ -375,6 +384,7 @@ KF5KMahjongglib, libkmahjongg-dev
|
|||||||
KF5KdepimDBusInterfaces, kdepim-apps-libs-dev
|
KF5KdepimDBusInterfaces, kdepim-apps-libs-dev
|
||||||
KF5Kipi, libkipi-dev
|
KF5Kipi, libkipi-dev
|
||||||
KF5Kirigami2, kirigami2-dev
|
KF5Kirigami2, kirigami2-dev
|
||||||
|
KF5KirigamiAddons, kirigami2-dev
|
||||||
KF5KontactInterface, kontactinterface-dev
|
KF5KontactInterface, kontactinterface-dev
|
||||||
KF5Kross, kross-dev
|
KF5Kross, kross-dev
|
||||||
KF5Ldap, kldap-dev
|
KF5Ldap, kldap-dev
|
||||||
@@ -416,6 +426,8 @@ KF5Su, kdesu-dev
|
|||||||
KF5Syndication, syndication-dev
|
KF5Syndication, syndication-dev
|
||||||
KF5SyntaxHighlighting, syntax-highlighting-dev
|
KF5SyntaxHighlighting, syntax-highlighting-dev
|
||||||
KF5SysGuard, libksysguard-dev
|
KF5SysGuard, libksysguard-dev
|
||||||
|
KF5TextAutoCorrection, ktextaddons-dev
|
||||||
|
KF5TextAutoCorrectionWidgets, ktextaddons-dev
|
||||||
KF5TextEditor, ktexteditor-dev
|
KF5TextEditor, ktexteditor-dev
|
||||||
KF5TextWidgets, ktextwidgets-dev
|
KF5TextWidgets, ktextwidgets-dev
|
||||||
KF5ThreadWeaver, threadweaver-dev
|
KF5ThreadWeaver, threadweaver-dev
|
||||||
@@ -428,16 +440,75 @@ KF5WidgetsAddons, kwidgetsaddons-dev
|
|||||||
KF5WindowSystem, kwindowsystem-dev
|
KF5WindowSystem, kwindowsystem-dev
|
||||||
KF5XmlGui, kxmlgui-dev
|
KF5XmlGui, kxmlgui-dev
|
||||||
KF5XmlRpcClient, kxmlrpcclient-dev
|
KF5XmlRpcClient, kxmlrpcclient-dev
|
||||||
|
KF6Attica, attica-dev
|
||||||
|
KF6Baloo, baloo-dev
|
||||||
|
KF6BalooWidgets, baloo-widgets-dev
|
||||||
|
KF6ColorScheme, kcolorscheme-dev
|
||||||
|
KF6Config, kconfig-dev
|
||||||
|
KF6Contacts, kcontacts-dev
|
||||||
|
KF6DNSSD, kdnssd-dev
|
||||||
|
KF6FileMetaData, kfilemetadata-dev
|
||||||
|
KF6GlobalAccel, kglobalaccel-dev
|
||||||
|
KF6Holidays, kholidays-dev
|
||||||
|
KF6IdleTime, kidletime-dev
|
||||||
|
KF6JobWidgets, kjobwidgets-dev
|
||||||
|
KF6KCMUtils, kcmutils-dev
|
||||||
|
KF6Kirigami, kirigami-dev
|
||||||
|
KF6Kirigami2, kirigami-dev
|
||||||
|
KF6KirigamiAddons, kirigami-addons-dev
|
||||||
|
KF6KirigamiAddons2, kirigami-addons-dev
|
||||||
|
KF6KirigamiPlatform, kirigami-dev
|
||||||
|
KF6NetworkManagerQt, networkmanager-qt-dev
|
||||||
|
KF6NewStuff, knewstuff-def
|
||||||
|
KF6Notifications, knotifications-dev
|
||||||
|
KF6NotifyConfig, knotifyconfig-dev
|
||||||
|
KF6Package, kpackage-dev
|
||||||
|
KF6Prison, kprison-dev
|
||||||
|
KF6Purpose, purpose-dev
|
||||||
|
KF6QuickCharts, kquickcharts-dev
|
||||||
|
KF6Runner, krunner-dev
|
||||||
|
KF6Screen, libkscreen-dev
|
||||||
|
KF6StatusNotifierItem, kstatusnotifieritem-dev
|
||||||
|
KF6SyntaxHighlighting, syntax-highlighting-dev
|
||||||
|
KF6TextEditor, ktexteditor-dev
|
||||||
KGantt, kdiagram-dev
|
KGantt, kdiagram-dev
|
||||||
|
KPim5Akonadi, akonadi-dev
|
||||||
|
KPim5AkonadiContact, akonadi-contacts-dev
|
||||||
|
KPim5AkonadiMime, akonadi-mime-dev
|
||||||
|
KPim5AkonadiNotes, akonadi-notes-dev
|
||||||
|
KPim5GrantleeTheme, grantleetheme-dev
|
||||||
|
KPim5Gravatar, libgravatar-dev
|
||||||
|
KPim5IMAP, kimap-staticdev
|
||||||
|
KPim5Ldap, kldap-dev
|
||||||
|
KPim5LibKSieve, libksieve-dev
|
||||||
|
KPim5Libkdepim, libkdepim-dev
|
||||||
|
KPim5Libkleo, libkleo-dev
|
||||||
|
KPim5MailImporter, mailimporter-dev
|
||||||
|
KPim5MailTransport, kmailtransport-dev
|
||||||
|
KPim5MailTransportAkonadi, kmailtransport-dev
|
||||||
|
KPim5MessageComposer, messagelib-dev
|
||||||
|
KPim5MessageCore, messagelib-dev
|
||||||
|
KPim5Mime, kmime-dev
|
||||||
|
KPim5PimCommon, pimcommon-dev
|
||||||
|
KPim5TextEdit, kpimtextedit-dev
|
||||||
|
KPim6IMAP, kimap-dev
|
||||||
|
KPim6Libkdepim, libkdepim-dev
|
||||||
|
KPim6Libkleo, libkleo-dev
|
||||||
|
KPim6MailTransport, kmailtransport-dev
|
||||||
|
KPim6MessageCore, messagelib-dev
|
||||||
|
KPim6Mime, kmime-dev
|
||||||
|
KPim6PimCommon, pimcommon-dev
|
||||||
KPimGAPI, libkgapi-dev
|
KPimGAPI, libkgapi-dev
|
||||||
KPimKDAV, kdav-dev
|
KPimKDAV, kdav-dev
|
||||||
KPimPkPass, kpkpass-dev
|
KPimPkPass, kpkpass-dev
|
||||||
KPimSMTP, ksmtp-dev
|
KPimSMTP, ksmtp-dev
|
||||||
KPimSMTPConfig, ksmtp-dev
|
KPimSMTPConfig, ksmtp-dev
|
||||||
|
KPipeWire, kpipewire-dev
|
||||||
KScreenLocker, kscreenlocker-dev
|
KScreenLocker, kscreenlocker-dev
|
||||||
KTP, ktp-common-internals-dev
|
KTP, ktp-common-internals-dev
|
||||||
KdepimLibs, kdepimlibs-dev
|
KdepimLibs, kdepimlibs-dev
|
||||||
Kerberos 5, krb5-dev
|
Kerberos 5, krb5-dev
|
||||||
|
KirigamiAddons, kirigami-addons-dev
|
||||||
LEX, flex bison
|
LEX, flex bison
|
||||||
LIBCAP_NG_PATH, libcap-ng-dev
|
LIBCAP_NG_PATH, libcap-ng-dev
|
||||||
LIBEXIF, libexif-dev
|
LIBEXIF, libexif-dev
|
||||||
@@ -445,7 +516,6 @@ LIBGCRYPT - version >= 1.5.0, libgcrypt-dev
|
|||||||
LIBGD, libgd-dev
|
LIBGD, libgd-dev
|
||||||
LIBICAL, libical-dev
|
LIBICAL, libical-dev
|
||||||
LIBKONQ, kde-baseapps-dev
|
LIBKONQ, kde-baseapps-dev
|
||||||
LIBLZMA, xz-dev
|
|
||||||
LIBNOTIFY, libnotify-dev
|
LIBNOTIFY, libnotify-dev
|
||||||
LIBPCREVERSION, pcre-dev
|
LIBPCREVERSION, pcre-dev
|
||||||
LIBRSVG, librsvg-dev
|
LIBRSVG, librsvg-dev
|
||||||
@@ -467,12 +537,12 @@ LibExiv2, pkgconfig(exiv2)
|
|||||||
LibKEduVocDocument, libkeduvocdocument-dev
|
LibKEduVocDocument, libkeduvocdocument-dev
|
||||||
LibKWorkspace, plasma-workspace-dev
|
LibKWorkspace, plasma-workspace-dev
|
||||||
LibKrb5, krb5-dev
|
LibKrb5, krb5-dev
|
||||||
LibLZMA, xz-dev
|
|
||||||
LibR, R-dev
|
LibR, R-dev
|
||||||
LibSSH, libssh-dev
|
LibSSH, libssh-dev
|
||||||
LibXml2, libxml2-dev
|
LibXml2, libxml2-dev
|
||||||
LibXslt, libxslt-bin
|
LibXslt, libxslt-bin
|
||||||
Libcap, libcap-dev
|
Libcap, libcap-dev
|
||||||
|
Libev, libev-dev
|
||||||
Lua51, lua-dev
|
Lua51, lua-dev
|
||||||
LuaJIT, LuaJIT-dev
|
LuaJIT, LuaJIT-dev
|
||||||
MDDS, mdds-dev
|
MDDS, mdds-dev
|
||||||
@@ -483,6 +553,7 @@ NETTLE, nettle-dev
|
|||||||
NUMA, numactl-dev
|
NUMA, numactl-dev
|
||||||
Nepomuk, nepomuk-core-dev
|
Nepomuk, nepomuk-core-dev
|
||||||
NetworkManager, NetworkManager-dev
|
NetworkManager, NetworkManager-dev
|
||||||
|
Nice, libnice-dev
|
||||||
NumPy, pypi-numpy
|
NumPy, pypi-numpy
|
||||||
Numa, numactl-dev
|
Numa, numactl-dev
|
||||||
OPENEXR, openexr-dev
|
OPENEXR, openexr-dev
|
||||||
@@ -503,12 +574,16 @@ PAM, Linux-PAM-dev
|
|||||||
PCAP, libpcap-dev
|
PCAP, libpcap-dev
|
||||||
PCIUTILS, pciutils-dev
|
PCIUTILS, pciutils-dev
|
||||||
PCRE, pcre-dev
|
PCRE, pcre-dev
|
||||||
|
PCRE2, pcre2-dev
|
||||||
PNG, pkgconfig(libpng)
|
PNG, pkgconfig(libpng)
|
||||||
POPT, popt-dev
|
POPT, popt-dev
|
||||||
POSIX ACL, acl-dev
|
POSIX ACL, acl-dev
|
||||||
PULSEAUDIO, pulseaudio-dev
|
PULSEAUDIO, pulseaudio-dev
|
||||||
Phonon, phonon-dev
|
Phonon, phonon-dev
|
||||||
Phonon4Qt5, phonon-dev
|
Phonon4Qt5, phonon-dev
|
||||||
|
Phonon4Qt6, phonon-dev
|
||||||
|
PlasmaActivities, plasma-activities-dev
|
||||||
|
PlasmaActivitiesStats, plasma-activities-stats-dev
|
||||||
PolkitQt5-1, polkit-qt-dev
|
PolkitQt5-1, polkit-qt-dev
|
||||||
Poppler, poppler-dev
|
Poppler, poppler-dev
|
||||||
PopplerQt4, poppler-dev
|
PopplerQt4, poppler-dev
|
||||||
@@ -522,13 +597,12 @@ Python, python3-dev
|
|||||||
Python.h, python3-dev
|
Python.h, python3-dev
|
||||||
PythonLibs, python3-dev
|
PythonLibs, python3-dev
|
||||||
PythonLibsUnix, python3-dev
|
PythonLibsUnix, python3-dev
|
||||||
|
QCoro5, qcoro-dev
|
||||||
QGpgme, gpgme-dev
|
QGpgme, gpgme-dev
|
||||||
QImageBlitz, qimageblitz-dev
|
QImageBlitz, qimageblitz-dev
|
||||||
QREncode, qrencode-dev
|
QREncode, qrencode-dev
|
||||||
QRencode, qrencode-dev
|
QRencode, qrencode-dev
|
||||||
QT, buildreq-kde
|
QT, buildreq-kde
|
||||||
Qt::Quick, qt6declarative-dev
|
|
||||||
Qt::Svg, qt6svg-dev
|
|
||||||
Qalculate, libqalculate-dev
|
Qalculate, libqalculate-dev
|
||||||
Qca-qt5, qca-qt5-dev
|
Qca-qt5, qca-qt5-dev
|
||||||
Qt4, qt-everywhere-opensource-src-dev
|
Qt4, qt-everywhere-opensource-src-dev
|
||||||
@@ -539,6 +613,7 @@ Qt5Keychain, qtkeychain-dev
|
|||||||
Qt5LinguistTools, qttools-dev
|
Qt5LinguistTools, qttools-dev
|
||||||
Qt5Multimedia, qtmultimedia-dev
|
Qt5Multimedia, qtmultimedia-dev
|
||||||
Qt5Network, qtbase-dev
|
Qt5Network, qtbase-dev
|
||||||
|
Qt5NetworkAuth, pkgconfig(Qt5NetworkAuth)
|
||||||
Qt5QuickControls2, pkgconfig(Qt5QuickControls2)
|
Qt5QuickControls2, pkgconfig(Qt5QuickControls2)
|
||||||
Qt5QuickTemplates2, pkgconfig(Qt5QuickTemplates2)
|
Qt5QuickTemplates2, pkgconfig(Qt5QuickTemplates2)
|
||||||
Qt5QuickTest, pkgconfig(Qt5QuickTest)
|
Qt5QuickTest, pkgconfig(Qt5QuickTest)
|
||||||
@@ -552,9 +627,13 @@ Qt5Xdg, libqtxdg-dev
|
|||||||
Qt5XdgIconLoader, libqtxdg-dev
|
Qt5XdgIconLoader, libqtxdg-dev
|
||||||
Qt5XmlPatterns, qtxmlpatterns-dev
|
Qt5XmlPatterns, qtxmlpatterns-dev
|
||||||
Qt6Positioning, qt6positioning-dev
|
Qt6Positioning, qt6positioning-dev
|
||||||
|
Qt6Qml, qt6declarative-dev
|
||||||
Qt6Quick, qt6declarative-dev
|
Qt6Quick, qt6declarative-dev
|
||||||
Qt6QuickTimeline, qt6quicktimeline-dev
|
Qt6QuickTimeline, qt6quicktimeline-dev
|
||||||
Qt6ShaderTools, qt6shadertools-dev
|
Qt6ShaderTools, qt6shadertools-dev
|
||||||
|
Qt6WaylandClient, qt6wayland-dev
|
||||||
|
Qt::Quick, qt6declarative-dev
|
||||||
|
Qt::Svg, qt6svg-dev
|
||||||
R, R
|
R, R
|
||||||
READLINE, readline-dev
|
READLINE, readline-dev
|
||||||
RSVG, librsvg-dev
|
RSVG, librsvg-dev
|
||||||
@@ -578,6 +657,7 @@ Soprano, soprano-dev
|
|||||||
SpatialIndex, libspatialindex-dev
|
SpatialIndex, libspatialindex-dev
|
||||||
Sphinx, pypi-sphinx
|
Sphinx, pypi-sphinx
|
||||||
Sqlite, sqlite-autoconf-dev
|
Sqlite, sqlite-autoconf-dev
|
||||||
|
Srtp2, libsrtp-dev
|
||||||
Startup notification library, libnotify-dev
|
Startup notification library, libnotify-dev
|
||||||
TBB, tbb-dev
|
TBB, tbb-dev
|
||||||
TIFF, tiff-dev
|
TIFF, tiff-dev
|
||||||
@@ -598,6 +678,7 @@ WEBKIT, webkitgtk-dev
|
|||||||
WEBPMUX, libwebp-dev
|
WEBPMUX, libwebp-dev
|
||||||
WSME, WSME
|
WSME, WSME
|
||||||
Wayland, wayland-dev
|
Wayland, wayland-dev
|
||||||
|
WaylandProtocols, wayland-protocols-dev plasma-wayland-protocols-dev
|
||||||
WaylandScanner, wayland
|
WaylandScanner, wayland
|
||||||
WebOb, pypi-webob
|
WebOb, pypi-webob
|
||||||
X, pkgconfig(x11)
|
X, pkgconfig(x11)
|
||||||
@@ -778,7 +859,7 @@ debtcollector, debtcollector
|
|||||||
decorator, pypi-decorator
|
decorator, pypi-decorator
|
||||||
deflate, zlib-dev
|
deflate, zlib-dev
|
||||||
deflateBound in -lz, zlib-dev
|
deflateBound in -lz, zlib-dev
|
||||||
designer, qttools-dev
|
designer, qt6tools-dev
|
||||||
desktop-file-install, desktop-file-utils
|
desktop-file-install, desktop-file-utils
|
||||||
desktop-file-validate, desktop-file-utils
|
desktop-file-validate, desktop-file-utils
|
||||||
dialog, dialog
|
dialog, dialog
|
||||||
@@ -817,6 +898,7 @@ ez_setup, pypi-setuptools
|
|||||||
ffi.h, libffi-dev
|
ffi.h, libffi-dev
|
||||||
ffi_call, libffi-dev
|
ffi_call, libffi-dev
|
||||||
fftw3.h, fftw-dev
|
fftw3.h, fftw-dev
|
||||||
|
file, file
|
||||||
find_packages, pypi-setuptools
|
find_packages, pypi-setuptools
|
||||||
flatbuffers/flatbuffers.h, FlatBuffers-dev
|
flatbuffers/flatbuffers.h, FlatBuffers-dev
|
||||||
flatpak, flatpak-dev
|
flatpak, flatpak-dev
|
||||||
@@ -829,6 +911,7 @@ fontconfig.h, fontconfig-dev
|
|||||||
fontconfig/fontconfig.h, fontconfig-dev
|
fontconfig/fontconfig.h, fontconfig-dev
|
||||||
freerdp2, freerdp-dev
|
freerdp2, freerdp-dev
|
||||||
freetype-config, freetype-dev
|
freetype-config, freetype-dev
|
||||||
|
frozen/unordered_map.h, frozen-dev
|
||||||
fuse (via pkg-config), compat-fuse-soname2-dev fuse-dev
|
fuse (via pkg-config), compat-fuse-soname2-dev fuse-dev
|
||||||
fuse, fuse-dev
|
fuse, fuse-dev
|
||||||
fuse.h, fuse-dev
|
fuse.h, fuse-dev
|
||||||
@@ -842,6 +925,7 @@ gawk, gawk
|
|||||||
gc/gc.h, gc-dev
|
gc/gc.h, gc-dev
|
||||||
gcj, gcj
|
gcj, gcj
|
||||||
gconftool-2, GConf-dev
|
gconftool-2, GConf-dev
|
||||||
|
gcr-3, pkgconfig(gcr-3)
|
||||||
gcrypt.h, libgcrypt-dev
|
gcrypt.h, libgcrypt-dev
|
||||||
gdal-config, gdal-dev
|
gdal-config, gdal-dev
|
||||||
gdbm.h, gdbm-dev
|
gdbm.h, gdbm-dev
|
||||||
@@ -858,6 +942,7 @@ gevent, pypi-gevent
|
|||||||
gflags, gflags-dev
|
gflags, gflags-dev
|
||||||
gfortran, gfortran
|
gfortran, gfortran
|
||||||
gi, pygobject
|
gi, pygobject
|
||||||
|
gi-docgen, gi-docgen
|
||||||
gif_lib.h, giflib-dev
|
gif_lib.h, giflib-dev
|
||||||
gio-2.0, glib-dev
|
gio-2.0, glib-dev
|
||||||
giomm-2.4, glibmm-dev
|
giomm-2.4, glibmm-dev
|
||||||
@@ -979,7 +1064,7 @@ lber.h, openldap-dev
|
|||||||
lcms2, lcms2-dev
|
lcms2, lcms2-dev
|
||||||
lcms2.h, lcms2-dev
|
lcms2.h, lcms2-dev
|
||||||
lcms2/lcms2.h, lcms2-dev
|
lcms2/lcms2.h, lcms2-dev
|
||||||
lconvert, qttools-dev
|
lconvert, qt6tools-dev
|
||||||
ldap.h, openldap-dev
|
ldap.h, openldap-dev
|
||||||
ldap_parse_sort_control, openldap-dev
|
ldap_parse_sort_control, openldap-dev
|
||||||
ldap_search in -lldap, openldap-dev
|
ldap_search in -lldap, openldap-dev
|
||||||
@@ -1020,7 +1105,6 @@ libhandy-0.0, libhandy-dev
|
|||||||
libiberty.h, binutils-dev
|
libiberty.h, binutils-dev
|
||||||
libkmod.h, kmod-dev
|
libkmod.h, kmod-dev
|
||||||
libksba, libksba-dev
|
libksba, libksba-dev
|
||||||
liblzma, xz-dev
|
|
||||||
libmnl/libmnl.h, libmnl-dev
|
libmnl/libmnl.h, libmnl-dev
|
||||||
libmpfr, mpfr-dev
|
libmpfr, mpfr-dev
|
||||||
libmspack >= 0.0.20040308alpha (via pkg-config), libmspack-dev
|
libmspack >= 0.0.20040308alpha (via pkg-config), libmspack-dev
|
||||||
@@ -1029,6 +1113,7 @@ libnettle, nettle-dev nettle-lib
|
|||||||
libnftnl, libnftnl-dev
|
libnftnl, libnftnl-dev
|
||||||
libnl-1, libnl-dev
|
libnl-1, libnl-dev
|
||||||
libnotify, libnotify-dev
|
libnotify, libnotify-dev
|
||||||
|
libnova, libnova-dev
|
||||||
libpeas-1.0, libpeas-dev
|
libpeas-1.0, libpeas-dev
|
||||||
libpipewire-0.2, pipewire-dev
|
libpipewire-0.2, pipewire-dev
|
||||||
libpng, pkgconfig(libpng)
|
libpng, pkgconfig(libpng)
|
||||||
@@ -1047,6 +1132,7 @@ libsecret-unstable, libsecret-dev
|
|||||||
libsoup-2.4, libsoup-dev
|
libsoup-2.4, libsoup-dev
|
||||||
libssh, libssh-dev
|
libssh, libssh-dev
|
||||||
libssh2.h, libssh2-dev
|
libssh2.h, libssh2-dev
|
||||||
|
libssl, openssl-dev
|
||||||
libsystemd, pkgconfig(systemd)
|
libsystemd, pkgconfig(systemd)
|
||||||
libtirpc (via pkg-config), pkgconfig(libtirpc)
|
libtirpc (via pkg-config), pkgconfig(libtirpc)
|
||||||
libudev.h, systemd-dev
|
libudev.h, systemd-dev
|
||||||
@@ -1065,14 +1151,14 @@ libxml2 devel libraries, libxml2-dev
|
|||||||
libxml2 library, libxml2-dev
|
libxml2 library, libxml2-dev
|
||||||
libxslt/pattern.h, libxslt-dev
|
libxslt/pattern.h, libxslt-dev
|
||||||
libz, zlib-dev
|
libz, zlib-dev
|
||||||
linguist, qttools-dev
|
linguist, qt6tools-dev
|
||||||
linux/xattr.h, attr-dev
|
linux/xattr.h, attr-dev
|
||||||
llvm-config, llvm-dev
|
llvm-config, llvm-dev
|
||||||
loadkeys, kbd
|
loadkeys, kbd
|
||||||
lrelease, qttools-dev
|
lrelease, qt6tools-dev
|
||||||
ltdl.h, libtool-dev
|
ltdl.h, libtool-dev
|
||||||
lua, lua-dev
|
lua, lua-dev
|
||||||
lupdate, qttools-dev
|
lupdate, qt6tools-dev
|
||||||
lvm2app.h, LVM2-dev
|
lvm2app.h, LVM2-dev
|
||||||
lxml, pypi-lxml
|
lxml, pypi-lxml
|
||||||
lxqt, liblxqt-dev
|
lxqt, liblxqt-dev
|
||||||
@@ -1080,8 +1166,6 @@ lxqt-build-tools, lxqt-build-tools
|
|||||||
lxqt-globalkeys, lxqt-globalkeys-dev
|
lxqt-globalkeys, lxqt-globalkeys-dev
|
||||||
lxqt-globalkeys-ui, lxqt-globalkeys-dev
|
lxqt-globalkeys-ui, lxqt-globalkeys-dev
|
||||||
lz4.h, lz4-dev
|
lz4.h, lz4-dev
|
||||||
lzma, xz-dev
|
|
||||||
lzma.h, xz-dev
|
|
||||||
lzo/lzoconf.h, lzo-dev
|
lzo/lzoconf.h, lzo-dev
|
||||||
magic, file-dev
|
magic, file-dev
|
||||||
magic.h, file-dev
|
magic.h, file-dev
|
||||||
@@ -1194,7 +1278,7 @@ pg_config, postgresql-dev
|
|||||||
php, php
|
php, php
|
||||||
php-config7, php
|
php-config7, php
|
||||||
pip, pypi-pip
|
pip, pypi-pip
|
||||||
pixeltool, qttools-dev
|
pixeltool, qt6tools-dev
|
||||||
pixman, pkgconfig(pixman-1)
|
pixman, pkgconfig(pixman-1)
|
||||||
pkg-config, pkg-config
|
pkg-config, pkg-config
|
||||||
pkg.m4, pkg-config-dev
|
pkg.m4, pkg-config-dev
|
||||||
@@ -1223,6 +1307,8 @@ pycparser, pypi(pycparser)
|
|||||||
pycurl, pypi(pycurl)
|
pycurl, pypi(pycurl)
|
||||||
pylint, pypi(pylint)
|
pylint, pypi(pylint)
|
||||||
pyperclip, pypi(pyperclip)
|
pyperclip, pypi(pyperclip)
|
||||||
|
pypi(openvino), openvino-python3
|
||||||
|
pypi(pytorch), pytorch-python3
|
||||||
pytest, pypi-pytest
|
pytest, pypi-pytest
|
||||||
pytest-cov, pypi(pytest_cov)
|
pytest-cov, pypi(pytest_cov)
|
||||||
python lxml, pypi(lxml)
|
python lxml, pypi(lxml)
|
||||||
@@ -1232,11 +1318,11 @@ python-pcre, python-pcre
|
|||||||
python-subunit, pypi(python_subunit)
|
python-subunit, pypi(python_subunit)
|
||||||
pytz, pypi(pytz)
|
pytz, pypi(pytz)
|
||||||
pyyaml, PyYAML
|
pyyaml, PyYAML
|
||||||
qcollectiongenerator, qttools-dev
|
qcollectiongenerator, qt6tools-dev
|
||||||
qdbuscpp2xml, qtbase-dev
|
qdbuscpp2xml, qtbase-dev
|
||||||
qdbusxml2cpp, qtbase-dev
|
qdbusxml2cpp, qtbase-dev
|
||||||
qhelpconverter, qttools-dev
|
qhelpconverter, qt6tools-dev
|
||||||
qhelpgenerator, qttools-dev
|
qhelpgenerator, qt6tools-dev
|
||||||
qhull/libqhull.h, qhull-dev
|
qhull/libqhull.h, qhull-dev
|
||||||
qjson/parser.h, qjson-dev
|
qjson/parser.h, qjson-dev
|
||||||
qlalr, qtbase-dev
|
qlalr, qtbase-dev
|
||||||
@@ -1250,8 +1336,8 @@ qmlplugindump, qtdeclarative-dev
|
|||||||
qmltestrunner, qtdeclarative-dev
|
qmltestrunner, qtdeclarative-dev
|
||||||
qscxmlc, qtscxml-dev
|
qscxmlc, qtscxml-dev
|
||||||
qt5, buildreq-kde
|
qt5, buildreq-kde
|
||||||
qtattributionsscanner, qttools-dev
|
qtattributionsscanner, qt6tools-dev
|
||||||
qtplugininfo, qttools-dev
|
qtplugininfo, qt6tools-dev
|
||||||
qtwaylandscanner, qtwayland-dev
|
qtwaylandscanner, qtwayland-dev
|
||||||
qvkgen, qtbase-dev
|
qvkgen, qtbase-dev
|
||||||
raptor, raptor2-dev
|
raptor, raptor2-dev
|
||||||
@@ -1267,6 +1353,7 @@ requests, pypi-requests
|
|||||||
rest-0.7, rest-dev
|
rest-0.7, rest-dev
|
||||||
retrying, retrying
|
retrying, retrying
|
||||||
rpm, pkgconfig(rpm)
|
rpm, pkgconfig(rpm)
|
||||||
|
rst2man rst2man.py, pypi-docutils
|
||||||
rst2man, pypi-docutils
|
rst2man, pypi-docutils
|
||||||
rsvg-convert, librsvg
|
rsvg-convert, librsvg
|
||||||
ruby, ruby
|
ruby, ruby
|
||||||
@@ -1279,6 +1366,7 @@ sbc, sbc-dev
|
|||||||
scrollkeeper-config, rarian
|
scrollkeeper-config, rarian
|
||||||
scrollkeeper-preinstall, rarian
|
scrollkeeper-preinstall, rarian
|
||||||
sdl2, SDL2-dev
|
sdl2, SDL2-dev
|
||||||
|
sdl2-config, SDL2-dev
|
||||||
security/pam_appl.h, Linux-PAM-dev
|
security/pam_appl.h, Linux-PAM-dev
|
||||||
selenium, pypi-selenium
|
selenium, pypi-selenium
|
||||||
setcap, libcap-dev
|
setcap, libcap-dev
|
||||||
@@ -1415,6 +1503,7 @@ yaml-cpp, yaml-cpp-dev
|
|||||||
yarg, pypi-yarg
|
yarg, pypi-yarg
|
||||||
yasm, yasm
|
yasm, yasm
|
||||||
yytext is a pointer, flex
|
yytext is a pointer, flex
|
||||||
|
zconf.h, zlib-dev
|
||||||
zenity, zenity
|
zenity, zenity
|
||||||
zip, zip
|
zip, zip
|
||||||
zlib, zlib-dev
|
zlib, zlib-dev
|
||||||
|
|||||||
+24
-33
@@ -59,7 +59,7 @@ class FileManager(object):
|
|||||||
r"/usr/src.*",
|
r"/usr/src.*",
|
||||||
r"/var.*"]
|
r"/var.*"]
|
||||||
for bpath in banned_paths:
|
for bpath in banned_paths:
|
||||||
if re.search(r"^(/V3|/V4)?" + bpath, path):
|
if re.search(r"^(/V3|/V4|/VA)?" + bpath, path):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class FileManager(object):
|
|||||||
|
|
||||||
exclude = True
|
exclude = True
|
||||||
for pat in patterns:
|
for pat in patterns:
|
||||||
pat = re.compile(r"^(/V3|/V4)?" + pat)
|
pat = re.compile(r"^(/V3|/V4|/VA)?" + pat)
|
||||||
if pat.search(filename):
|
if pat.search(filename):
|
||||||
exclude = False
|
exclude = False
|
||||||
break
|
break
|
||||||
@@ -126,10 +126,10 @@ class FileManager(object):
|
|||||||
# All patterns at this time and should always be prefixed by '^'
|
# All patterns at this time and should always be prefixed by '^'
|
||||||
# but just in case add the following to strip just the '^'
|
# but just in case add the following to strip just the '^'
|
||||||
pattern = pattern if not pattern.startswith('^') else pattern[1:]
|
pattern = pattern if not pattern.startswith('^') else pattern[1:]
|
||||||
pat = re.compile(r"^(/V3|/V4)?" + pattern)
|
pat = re.compile(r"^(/V3|/V4|/VA)?" + pattern)
|
||||||
match = pat.search(filename)
|
match = pat.search(filename)
|
||||||
if match:
|
if match:
|
||||||
if len(match.groups()) > 0 and match.groups()[0] in ['/V3', '/V4']:
|
if len(match.groups()) > 0 and match.groups()[0] in ['/V3', '/V4', '/VA']:
|
||||||
norm_filename = filename.removeprefix(match.groups()[0])
|
norm_filename = filename.removeprefix(match.groups()[0])
|
||||||
if replacement != filename:
|
if replacement != filename:
|
||||||
replacement = match.groups()[0] + replacement
|
replacement = match.groups()[0] + replacement
|
||||||
@@ -197,33 +197,6 @@ class FileManager(object):
|
|||||||
|
|
||||||
return removed
|
return removed
|
||||||
|
|
||||||
def globlike_match(self, filename, match_name):
|
|
||||||
"""Compare the filename to the match_name in a way that simulates the shell glob '*'."""
|
|
||||||
fsplit = filename.split('/')
|
|
||||||
if len(fsplit) != len(match_name):
|
|
||||||
return False
|
|
||||||
match = True
|
|
||||||
for fpart, mpart in zip(fsplit, match_name):
|
|
||||||
if fpart != mpart:
|
|
||||||
if '*' not in mpart:
|
|
||||||
match = False
|
|
||||||
break
|
|
||||||
if len(mpart) > len(fpart) + 1:
|
|
||||||
match = False
|
|
||||||
break
|
|
||||||
mpl, mpr = mpart.split('*')
|
|
||||||
try:
|
|
||||||
if fpart.index(mpl) != 0:
|
|
||||||
match = False
|
|
||||||
break
|
|
||||||
if fpart.rindex(mpr) != len(fpart) - len(mpr):
|
|
||||||
match = False
|
|
||||||
break
|
|
||||||
except ValueError:
|
|
||||||
match = False
|
|
||||||
break
|
|
||||||
return match
|
|
||||||
|
|
||||||
def push_file(self, filename, pkg_name):
|
def push_file(self, filename, pkg_name):
|
||||||
"""Perform a number of checks against the filename and push the filename if appropriate."""
|
"""Perform a number of checks against the filename and push the filename if appropriate."""
|
||||||
if filename in self.files or filename in self.files_blacklist:
|
if filename in self.files or filename in self.files_blacklist:
|
||||||
@@ -236,7 +209,7 @@ class FileManager(object):
|
|||||||
# Explicit file packaging
|
# Explicit file packaging
|
||||||
for k, v in self.file_maps.items():
|
for k, v in self.file_maps.items():
|
||||||
for match_name in v['files']:
|
for match_name in v['files']:
|
||||||
match = re.search(r"^/(V3|V4)", filename)
|
match = re.search(r"^/(V3|V4|VA)", filename)
|
||||||
norm_filename = filename if not match else filename.removeprefix(match.group())
|
norm_filename = filename if not match else filename.removeprefix(match.group())
|
||||||
if isinstance(match_name, str):
|
if isinstance(match_name, str):
|
||||||
if norm_filename == match_name:
|
if norm_filename == match_name:
|
||||||
@@ -245,7 +218,7 @@ class FileManager(object):
|
|||||||
elif len('/'.join(match_name)) <= (len(norm_filename) + 1):
|
elif len('/'.join(match_name)) <= (len(norm_filename) + 1):
|
||||||
# the match name may be 1 longer due to a glob
|
# the match name may be 1 longer due to a glob
|
||||||
# being able to match an empty string
|
# being able to match an empty string
|
||||||
if self.globlike_match(norm_filename, match_name):
|
if util.globlike_match(norm_filename, match_name):
|
||||||
path_prefix = '/' if not match else match.group()
|
path_prefix = '/' if not match else match.group()
|
||||||
self.push_package_file(os.path.join(path_prefix, *match_name), k)
|
self.push_package_file(os.path.join(path_prefix, *match_name), k)
|
||||||
return
|
return
|
||||||
@@ -272,6 +245,16 @@ class FileManager(object):
|
|||||||
if self.want_dev_split and self.file_pat_match(filename, r"^/usr/.*/include/.*\.h$", "dev"):
|
if self.want_dev_split and self.file_pat_match(filename, r"^/usr/.*/include/.*\.h$", "dev"):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Exclude Windows executables and DLLs unless otherwise configured
|
||||||
|
# Can't just skip them because they could be swept up in a python lib wildcard, for example
|
||||||
|
if re.search(r"[^/]+\.(exe|dll)$", filename):
|
||||||
|
if self.config.config_opts.get('allow_exe'):
|
||||||
|
util.print_warning("Allowing {} because allow_exe is true".format(filename))
|
||||||
|
else:
|
||||||
|
util.print_warning("Blocking {} because allow_exe is false".format(filename))
|
||||||
|
self.excludes.append(filename)
|
||||||
|
return
|
||||||
|
|
||||||
# if configured to do so, add .so files to the lib package instead of
|
# if configured to do so, add .so files to the lib package instead of
|
||||||
# the dev package. THis is useful for packages with a plugin
|
# the dev package. THis is useful for packages with a plugin
|
||||||
# architecture like elfutils and mesa.
|
# architecture like elfutils and mesa.
|
||||||
@@ -291,6 +274,7 @@ class FileManager(object):
|
|||||||
(r"^/usr/share/info/", "info"),
|
(r"^/usr/share/info/", "info"),
|
||||||
(r"^/usr/share/abi/", "abi"),
|
(r"^/usr/share/abi/", "abi"),
|
||||||
(r"^/usr/share/qt5/examples/", "examples"),
|
(r"^/usr/share/qt5/examples/", "examples"),
|
||||||
|
(r"^/usr/share/qt6/examples/", "examples"),
|
||||||
(r"^/usr/share/omf", "main", "/usr/share/omf/*"),
|
(r"^/usr/share/omf", "main", "/usr/share/omf/*"),
|
||||||
(r"^/usr/share/installed-tests/", "tests"),
|
(r"^/usr/share/installed-tests/", "tests"),
|
||||||
(r"^/usr/libexec/installed-tests/", "tests"),
|
(r"^/usr/libexec/installed-tests/", "tests"),
|
||||||
@@ -339,11 +323,17 @@ class FileManager(object):
|
|||||||
(r"^/usr/lib64/cmake/", "dev"),
|
(r"^/usr/lib64/cmake/", "dev"),
|
||||||
(r"^/usr/lib32/cmake/", "dev32"),
|
(r"^/usr/lib32/cmake/", "dev32"),
|
||||||
(r"^/usr/lib/qt5/mkspecs/", "dev"),
|
(r"^/usr/lib/qt5/mkspecs/", "dev"),
|
||||||
|
(r"^/usr/lib/qt6/mkspecs/", "dev"),
|
||||||
(r"^/usr/lib64/qt5/mkspecs/", "dev"),
|
(r"^/usr/lib64/qt5/mkspecs/", "dev"),
|
||||||
(r"^/usr/lib32/qt5/mkspecs/", "dev32"),
|
(r"^/usr/lib32/qt5/mkspecs/", "dev32"),
|
||||||
|
(r"^/usr/lib64/qt6/mkspecs/", "dev"),
|
||||||
|
(r"^/usr/lib32/qt6/mkspecs/", "dev32"),
|
||||||
(r"^/usr/lib/qt5/", "lib"),
|
(r"^/usr/lib/qt5/", "lib"),
|
||||||
|
(r"^/usr/lib/qt6/", "lib"),
|
||||||
(r"^/usr/lib64/qt5/", "lib"),
|
(r"^/usr/lib64/qt5/", "lib"),
|
||||||
(r"^/usr/lib32/qt5/", "lib32"),
|
(r"^/usr/lib32/qt5/", "lib32"),
|
||||||
|
(r"^/usr/lib64/qt6/", "lib"),
|
||||||
|
(r"^/usr/lib32/qt6/", "lib32"),
|
||||||
(r"^/usr/lib/[a-zA-Z0-9._+-]*\.so$", so_dest),
|
(r"^/usr/lib/[a-zA-Z0-9._+-]*\.so$", so_dest),
|
||||||
(r"^/usr/lib64/libkdeinit5_[a-zA-Z0-9._+-]*\.so$", "lib"),
|
(r"^/usr/lib64/libkdeinit5_[a-zA-Z0-9._+-]*\.so$", "lib"),
|
||||||
(r"^/usr/lib32/libkdeinit5_[a-zA-Z0-9._+-]*\.so$", "lib32"),
|
(r"^/usr/lib32/libkdeinit5_[a-zA-Z0-9._+-]*\.so$", "lib32"),
|
||||||
@@ -387,6 +377,7 @@ class FileManager(object):
|
|||||||
(r"^/lib/systemd/user/", "services"),
|
(r"^/lib/systemd/user/", "services"),
|
||||||
(r"^/usr/lib/systemd/system/", "services"),
|
(r"^/usr/lib/systemd/system/", "services"),
|
||||||
(r"^/usr/lib/systemd/user/", "services"),
|
(r"^/usr/lib/systemd/user/", "services"),
|
||||||
|
(r"^/usr/lib/udev/hwdb.d", "config"),
|
||||||
(r"^/usr/lib/udev/rules.d", "config"),
|
(r"^/usr/lib/udev/rules.d", "config"),
|
||||||
(r"^/usr/lib/modules-load.d", "config"),
|
(r"^/usr/lib/modules-load.d", "config"),
|
||||||
(r"^/usr/lib/tmpfiles.d", "config"),
|
(r"^/usr/lib/tmpfiles.d", "config"),
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ def commit_to_git(config, name, success):
|
|||||||
call("git add profile_payload", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add profile_payload", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add options.conf", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add options.conf", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add configure_misses", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add configure_misses", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
|
call("git add etc_files", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add whatrequires", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add whatrequires", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add description", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add description", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
call("git add attrs", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
call("git add attrs", check=False, stderr=subprocess.DEVNULL, cwd=path)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
59FCF207FEA7F445
|
||||||
+28
-11
@@ -29,7 +29,7 @@ import urllib.parse
|
|||||||
|
|
||||||
import chardet
|
import chardet
|
||||||
import download
|
import download
|
||||||
from util import get_contents, get_sha1sum, print_fatal, print_warning
|
import util
|
||||||
|
|
||||||
default_license = "TO BE DETERMINED"
|
default_license = "TO BE DETERMINED"
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ def decode_license(license):
|
|||||||
def license_from_copying_hash(copying, srcdir, config, name):
|
def license_from_copying_hash(copying, srcdir, config, name):
|
||||||
"""Add licenses based on the hash of the copying file."""
|
"""Add licenses based on the hash of the copying file."""
|
||||||
try:
|
try:
|
||||||
data = get_contents(copying)
|
data = util.get_contents(copying)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# LICENSE file is a bad symlink (qemu-4.2.0!)
|
# LICENSE file is a bad symlink (qemu-4.2.0!)
|
||||||
return
|
return
|
||||||
@@ -109,7 +109,7 @@ def license_from_copying_hash(copying, srcdir, config, name):
|
|||||||
if not data:
|
if not data:
|
||||||
return
|
return
|
||||||
|
|
||||||
hash_sum = get_sha1sum(copying)
|
hash_sum = util.get_sha1sum(copying)
|
||||||
|
|
||||||
if config.license_fetch:
|
if config.license_fetch:
|
||||||
values = {'hash': hash_sum, 'text': data, 'package': name}
|
values = {'hash': hash_sum, 'text': data, 'package': name}
|
||||||
@@ -142,9 +142,24 @@ def license_from_copying_hash(copying, srcdir, config, name):
|
|||||||
else:
|
else:
|
||||||
if not config.license_show:
|
if not config.license_show:
|
||||||
return
|
return
|
||||||
print_warning("Unknown license {0} with hash {1}".format(copying, hash_sum))
|
util.print_warning("Unknown license {0} with hash {1}".format(copying, hash_sum))
|
||||||
hash_url = config.license_show % {'HASH': hash_sum}
|
hash_url = config.license_show % {'HASH': hash_sum}
|
||||||
print_warning("Visit {0} to enter".format(hash_url))
|
util.print_warning("Visit {0} to enter".format(hash_url))
|
||||||
|
|
||||||
|
|
||||||
|
def skip_license(license_path, config):
|
||||||
|
"""Check if a given license file path should be skipped."""
|
||||||
|
skip_name = False
|
||||||
|
for skip in config.license_skips:
|
||||||
|
# handle the common tempfile prefix and normalize for
|
||||||
|
# skip lines without a starting '/'
|
||||||
|
skip = skip if skip[0] != '' else skip[1:]
|
||||||
|
skip_path = ['', 'tmp', '*'] + skip
|
||||||
|
if util.globlike_match(license_path, skip_path):
|
||||||
|
util.print_warning(f"Skip license detected for file at {license_path}")
|
||||||
|
skip_name = True
|
||||||
|
break
|
||||||
|
return skip_name
|
||||||
|
|
||||||
|
|
||||||
def scan_for_licenses(srcdir, config, pkg_name):
|
def scan_for_licenses(srcdir, config, pkg_name):
|
||||||
@@ -166,8 +181,9 @@ def scan_for_licenses(srcdir, config, pkg_name):
|
|||||||
for dirpath, dirnames, files in os.walk(srcdir):
|
for dirpath, dirnames, files in os.walk(srcdir):
|
||||||
for name in files:
|
for name in files:
|
||||||
if name.lower() in targets or target_pat.search(name.lower()):
|
if name.lower() in targets or target_pat.search(name.lower()):
|
||||||
license_from_copying_hash(os.path.join(dirpath, name),
|
license_path = os.path.join(dirpath, name)
|
||||||
srcdir, config, pkg_name)
|
if not skip_license(license_path, config):
|
||||||
|
license_from_copying_hash(license_path, srcdir, config, pkg_name)
|
||||||
# Also search for license texts in project trees that are
|
# Also search for license texts in project trees that are
|
||||||
# REUSE-compliant, or are in process of adopting this standard (for
|
# REUSE-compliant, or are in process of adopting this standard (for
|
||||||
# example, KDE ecosystem packages). See https://reuse.software for
|
# example, KDE ecosystem packages). See https://reuse.software for
|
||||||
@@ -178,12 +194,13 @@ def scan_for_licenses(srcdir, config, pkg_name):
|
|||||||
# seen in the DPDK 20.11.3 tree, where the `LICENSES` directory is
|
# seen in the DPDK 20.11.3 tree, where the `LICENSES` directory is
|
||||||
# named `license` instead.
|
# named `license` instead.
|
||||||
dirbase = os.path.basename(dirpath)
|
dirbase = os.path.basename(dirpath)
|
||||||
if re.search(r'^(LICENSES|license)$', dirbase) and re.search(r'\.txt$', name):
|
if re.search(r'^(LICENSES|licenses?|licensing)$', dirbase) and re.search(r'\.txt$', name):
|
||||||
license_from_copying_hash(os.path.join(dirpath, name),
|
license_path = os.path.join(dirpath, name)
|
||||||
srcdir, config, pkg_name)
|
if not skip_license(license_path, config):
|
||||||
|
license_from_copying_hash(license_path, srcdir, config, pkg_name)
|
||||||
|
|
||||||
if not licenses:
|
if not licenses:
|
||||||
print_fatal(" Cannot find any license or a valid {}.license file!\n".format(pkg_name))
|
util.print_fatal(" Cannot find any license or a valid {}.license file!\n".format(pkg_name))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print("Licenses : ", " ".join(sorted(licenses)))
|
print("Licenses : ", " ".join(sorted(licenses)))
|
||||||
|
|||||||
+43
-11
@@ -3,12 +3,12 @@
|
|||||||
# This file is sorted with LC_COLLATE=C
|
# This file is sorted with LC_COLLATE=C
|
||||||
# Lines beginning with '#' are ignored.
|
# Lines beginning with '#' are ignored.
|
||||||
# For strings that start with '#', escape the '#' as '\#'.
|
# For strings that start with '#', escape the '#' as '\#'.
|
||||||
=========================
|
|
||||||
%
|
%
|
||||||
%license
|
%license
|
||||||
(LGPL)
|
(LGPL)
|
||||||
(new)
|
(new)
|
||||||
(specified
|
(specified
|
||||||
|
*
|
||||||
+
|
+
|
||||||
-
|
-
|
||||||
-MIT
|
-MIT
|
||||||
@@ -26,6 +26,8 @@
|
|||||||
3-Clause
|
3-Clause
|
||||||
3-clause
|
3-clause
|
||||||
3BSD
|
3BSD
|
||||||
|
=========================
|
||||||
|
>=-2
|
||||||
@CPACK_RPM_PACKAGE_LICENSE@
|
@CPACK_RPM_PACKAGE_LICENSE@
|
||||||
AGPLv3+
|
AGPLv3+
|
||||||
ALv2
|
ALv2
|
||||||
@@ -35,7 +37,12 @@ APPLICATION__TYPE
|
|||||||
ASL
|
ASL
|
||||||
Artistic
|
Artistic
|
||||||
BSD
|
BSD
|
||||||
|
BSD(2
|
||||||
BSD(3
|
BSD(3
|
||||||
|
BSD-2-Clause-Views
|
||||||
|
BSD-3
|
||||||
|
BSD-compatible
|
||||||
|
BSD-derived(Repoze)
|
||||||
BSD-like
|
BSD-like
|
||||||
BSD-style
|
BSD-style
|
||||||
BSDL
|
BSDL
|
||||||
@@ -43,6 +50,7 @@ BSD_3_clause
|
|||||||
BSDish
|
BSDish
|
||||||
BSL
|
BSL
|
||||||
CC-BY
|
CC-BY
|
||||||
|
Clause
|
||||||
Commercial
|
Commercial
|
||||||
Corp.
|
Corp.
|
||||||
Distribution
|
Distribution
|
||||||
@@ -53,6 +61,7 @@ EPL
|
|||||||
Eclipse
|
Eclipse
|
||||||
Expat(MIT/X11)
|
Expat(MIT/X11)
|
||||||
Expat/MIT
|
Expat/MIT
|
||||||
|
FOUNDATION
|
||||||
Foundation
|
Foundation
|
||||||
FreeBSD
|
FreeBSD
|
||||||
GENERAL
|
GENERAL
|
||||||
@@ -60,30 +69,39 @@ GFDL
|
|||||||
GNU
|
GNU
|
||||||
GPL
|
GPL
|
||||||
GPL+
|
GPL+
|
||||||
|
GPL-1.0-only
|
||||||
GPL/BSD
|
GPL/BSD
|
||||||
GPL/BSD/CPL
|
GPL/BSD/CPL
|
||||||
GPLv2.1
|
GPLv2.1
|
||||||
General
|
General
|
||||||
IBM
|
IBM
|
||||||
|
Jupyter
|
||||||
LESSER
|
LESSER
|
||||||
LGPL
|
LGPL
|
||||||
LGPL+BSD
|
LGPL+BSD
|
||||||
LGPL/MIT
|
LGPL/MIT
|
||||||
LICENCE
|
LICENCE
|
||||||
Lesser
|
Lesser
|
||||||
|
Library
|
||||||
Licences
|
Licences
|
||||||
License
|
License
|
||||||
License(2.0)
|
License(2.0)
|
||||||
License(==-2.0)
|
License(==-2.0)
|
||||||
|
License(>=-2)
|
||||||
License(>=-2.0)
|
License(>=-2.0)
|
||||||
|
License(LGPL)
|
||||||
|
License(MIT)
|
||||||
License,
|
License,
|
||||||
License-2
|
License-2
|
||||||
License-2.0
|
License-2.0
|
||||||
License-2.0(MPL-2.0)
|
License-2.0(MPL-2.0)
|
||||||
|
License-3(GPLv3)
|
||||||
Licensing
|
Licensing
|
||||||
Lucent
|
Lucent
|
||||||
|
MIT-0
|
||||||
MIT/Expat
|
MIT/Expat
|
||||||
MPL
|
MPL
|
||||||
|
Minpack
|
||||||
Modified
|
Modified
|
||||||
Mozilla
|
Mozilla
|
||||||
Muddy-MIT
|
Muddy-MIT
|
||||||
@@ -95,9 +113,13 @@ Open
|
|||||||
PIL
|
PIL
|
||||||
PSF-2+
|
PSF-2+
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
PYTHON
|
||||||
|
Permission
|
||||||
Public
|
Public
|
||||||
Revised
|
Revised
|
||||||
SIL
|
SIL
|
||||||
|
SIP
|
||||||
|
SOFTWARE
|
||||||
See
|
See
|
||||||
Set
|
Set
|
||||||
Software
|
Software
|
||||||
@@ -111,31 +133,46 @@ UNKNOWN
|
|||||||
Unknown
|
Unknown
|
||||||
Unkown
|
Unkown
|
||||||
Unlimited
|
Unlimited
|
||||||
|
VERSION-2
|
||||||
Version
|
Version
|
||||||
Version-2.0
|
Version-2.0
|
||||||
|
Version-3
|
||||||
|
WITH
|
||||||
What
|
What
|
||||||
\#
|
\#
|
||||||
|
a
|
||||||
advertising
|
advertising
|
||||||
and
|
and
|
||||||
any
|
any
|
||||||
bsd
|
bsd
|
||||||
|
charge
|
||||||
classifiers)
|
classifiers)
|
||||||
clause)
|
clause)
|
||||||
|
copy
|
||||||
|
cryptsetup-OpenSSL-exception
|
||||||
details
|
details
|
||||||
domain
|
domain
|
||||||
|
domain.
|
||||||
dual
|
dual
|
||||||
exceptions
|
exceptions
|
||||||
for
|
for
|
||||||
|
free
|
||||||
gpl
|
gpl
|
||||||
|
granted
|
||||||
|
hereby
|
||||||
http://nmap.org/man/man-legal.html
|
http://nmap.org/man/man-legal.html
|
||||||
|
into
|
||||||
is
|
is
|
||||||
it
|
it
|
||||||
later
|
later
|
||||||
later(LGPLv2+)
|
later(LGPLv2+)
|
||||||
license
|
license
|
||||||
|
licensing
|
||||||
ndg/httpsclient/LICENCE
|
ndg/httpsclient/LICENCE
|
||||||
new
|
new
|
||||||
none
|
none
|
||||||
|
obtaining
|
||||||
|
of
|
||||||
on
|
on
|
||||||
open_source
|
open_source
|
||||||
option
|
option
|
||||||
@@ -143,11 +180,16 @@ option)
|
|||||||
or
|
or
|
||||||
or(at
|
or(at
|
||||||
others
|
others
|
||||||
|
person
|
||||||
public
|
public
|
||||||
|
released
|
||||||
|
software
|
||||||
style
|
style
|
||||||
terms
|
terms
|
||||||
the
|
the
|
||||||
|
to
|
||||||
under?
|
under?
|
||||||
|
unencumbered
|
||||||
unknown
|
unknown
|
||||||
unrestricted
|
unrestricted
|
||||||
uses
|
uses
|
||||||
@@ -160,13 +202,3 @@ with
|
|||||||
your
|
your
|
||||||
|
|
|
|
||||||
~
|
~
|
||||||
Permission
|
|
||||||
a
|
|
||||||
charge
|
|
||||||
copy
|
|
||||||
granted
|
|
||||||
hereby
|
|
||||||
obtaining
|
|
||||||
of
|
|
||||||
person
|
|
||||||
to
|
|
||||||
|
|||||||
@@ -16,9 +16,11 @@ Apache License 2.0, Apache-2.0
|
|||||||
Apache License, Version 2.0, Apache-2.0
|
Apache License, Version 2.0, Apache-2.0
|
||||||
Apache, Apache-2.0
|
Apache, Apache-2.0
|
||||||
Apache-2, Apache-2.0
|
Apache-2, Apache-2.0
|
||||||
|
Apache2, Apache-2.0
|
||||||
Apache2.0, Apache-2.0
|
Apache2.0, Apache-2.0
|
||||||
Apachev2, Apache-2.0
|
Apachev2, Apache-2.0
|
||||||
Artistic-1.0+GPL-1.0, Artistic-1.0 GPL-1.0
|
Artistic-1.0+GPL-1.0, Artistic-1.0 GPL-1.0
|
||||||
|
Artistic/GPL, Artistic-1.0-Perl GPL-1.0-or-later
|
||||||
Artistic_2, Artistic-2.0
|
Artistic_2, Artistic-2.0
|
||||||
BSD(3-clause), BSD-3-Clause
|
BSD(3-clause), BSD-3-Clause
|
||||||
BSD-2-clause, BSD-2-Clause
|
BSD-2-clause, BSD-2-Clause
|
||||||
|
|||||||
+27
-7
@@ -18,10 +18,25 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
from util import print_fatal, write_out
|
from util import print_fatal, write_out
|
||||||
|
|
||||||
|
|
||||||
|
def log_etc(lines):
|
||||||
|
"""Return the content of the START/etc ... END/etc section."""
|
||||||
|
etc = []
|
||||||
|
while True:
|
||||||
|
line = next(lines)
|
||||||
|
line = line.strip()
|
||||||
|
if line == 'END/etc':
|
||||||
|
break
|
||||||
|
if line.startswith('+'):
|
||||||
|
continue
|
||||||
|
etc.append(line)
|
||||||
|
return etc
|
||||||
|
|
||||||
|
|
||||||
def logcheck(pkg_loc):
|
def logcheck(pkg_loc):
|
||||||
"""Try to discover configuration options that were automatically switched off."""
|
"""Try to discover configuration options that were automatically switched off."""
|
||||||
log = os.path.join(pkg_loc, 'results', 'build.log')
|
log = os.path.join(pkg_loc, 'results', 'build.log')
|
||||||
@@ -52,7 +67,12 @@ def logcheck(pkg_loc):
|
|||||||
|
|
||||||
pat = re.compile(r"^checking (?:for )?(.*?)\.\.\. no")
|
pat = re.compile(r"^checking (?:for )?(.*?)\.\.\. no")
|
||||||
misses = []
|
misses = []
|
||||||
for line in lines:
|
iter_lines = iter(lines)
|
||||||
|
for line in iter_lines:
|
||||||
|
if line.strip() == "START/etc":
|
||||||
|
etc = log_etc(iter_lines)
|
||||||
|
if etc:
|
||||||
|
write_log(pkg_loc, "etc_files", etc)
|
||||||
match = None
|
match = None
|
||||||
m = pat.search(line)
|
m = pat.search(line)
|
||||||
if m:
|
if m:
|
||||||
@@ -70,8 +90,8 @@ def logcheck(pkg_loc):
|
|||||||
if match in blacklist:
|
if match in blacklist:
|
||||||
print_fatal("Blacklisted configure-miss is forbidden: " + match)
|
print_fatal("Blacklisted configure-miss is forbidden: " + match)
|
||||||
misses.append("Blacklisted configure-miss is forbidden: " + match)
|
misses.append("Blacklisted configure-miss is forbidden: " + match)
|
||||||
write_misses(pkg_loc, misses)
|
write_log(pkg_loc, 'configure_misses', misses)
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print("Configure miss: " + match)
|
print("Configure miss: " + match)
|
||||||
misses.append("Configure miss: " + match)
|
misses.append("Configure miss: " + match)
|
||||||
@@ -79,9 +99,9 @@ def logcheck(pkg_loc):
|
|||||||
if not misses:
|
if not misses:
|
||||||
return
|
return
|
||||||
|
|
||||||
write_misses(pkg_loc, misses)
|
write_log(pkg_loc, 'configure_misses', misses)
|
||||||
|
|
||||||
|
|
||||||
def write_misses(pkg_loc, misses):
|
def write_log(pkg_loc, fname, content):
|
||||||
"""Create configure_misses file with automatically disabled configuration options."""
|
"""Create log file with content."""
|
||||||
write_out(os.path.join(pkg_loc, 'configure_misses'), '\n'.join(sorted(misses)))
|
write_out(os.path.join(pkg_loc, fname), '\n'.join(sorted(content)))
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ KEYID_TRY = ""
|
|||||||
KEYID = ""
|
KEYID = ""
|
||||||
IMPORTED = ""
|
IMPORTED = ""
|
||||||
EMAIL = ""
|
EMAIL = ""
|
||||||
GNUPGCONF = """keyserver keys.gnupg.net"""
|
GNUPGCONF = """keyserver keyserver.ubuntu.com"""
|
||||||
CMD_TIMEOUT = 20
|
CMD_TIMEOUT = 20
|
||||||
ENV = os.environ
|
ENV = os.environ
|
||||||
INPUT_GETTER_TIMEOUT = 60
|
INPUT_GETTER_TIMEOUT = 60
|
||||||
@@ -205,9 +205,9 @@ class Verifier(object):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def quit():
|
def quit():
|
||||||
"""Stop verification."""
|
"""Stop verification."""
|
||||||
print('Critical error quitting...')
|
util.print_fatal("Verification required for build (verify_required option set)")
|
||||||
print(SEPT)
|
print(SEPT)
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def calc_sum(filepath, digest_algo):
|
def calc_sum(filepath, digest_algo):
|
||||||
@@ -264,12 +264,12 @@ def get_signature_file(package_url, package_path):
|
|||||||
def compare_keys(newkey, oldkey):
|
def compare_keys(newkey, oldkey):
|
||||||
"""Key comparison to check against key tampering."""
|
"""Key comparison to check against key tampering."""
|
||||||
if newkey != oldkey:
|
if newkey != oldkey:
|
||||||
util.print_error('Public key has changed:\n'
|
util.print_fatal('Public key has changed:\n'
|
||||||
' old key: {}\n'
|
' old key: {}\n'
|
||||||
' new key: {}\n'
|
' new key: {}\n'
|
||||||
'this is a critical security error, quitting...'
|
'this is a critical security error, quitting...'
|
||||||
.format(oldkey, newkey))
|
.format(oldkey, newkey))
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
# sha256sum Verifier
|
# sha256sum Verifier
|
||||||
@@ -483,6 +483,10 @@ class GPGVerifier(Verifier):
|
|||||||
return None
|
return None
|
||||||
# valid signature exists at package_sign_path, operate on it now
|
# valid signature exists at package_sign_path, operate on it now
|
||||||
keyid = get_keyid(self.package_sign_path)
|
keyid = get_keyid(self.package_sign_path)
|
||||||
|
if keyid in self.config.keyid_blocklist:
|
||||||
|
self.print_result(False, err_msg='KNOWNBADACTOR: {}'.format(keyid))
|
||||||
|
self.quit()
|
||||||
|
|
||||||
# default location first
|
# default location first
|
||||||
pubkey_loc = self.pubkey_path.format(keyid)
|
pubkey_loc = self.pubkey_path.format(keyid)
|
||||||
cache_key = os.path.join(KEY_CACHE_DIR, pubkey_loc)
|
cache_key = os.path.join(KEY_CACHE_DIR, pubkey_loc)
|
||||||
@@ -517,7 +521,6 @@ class GPGVerifier(Verifier):
|
|||||||
|
|
||||||
def quit_verify():
|
def quit_verify():
|
||||||
"""Halt build due to verification being required."""
|
"""Halt build due to verification being required."""
|
||||||
util.print_error("Verification required for build (verify_required option set)")
|
|
||||||
Verifier.quit()
|
Verifier.quit()
|
||||||
|
|
||||||
|
|
||||||
@@ -528,6 +531,7 @@ VERIFIER_TYPES = {
|
|||||||
'.bz2': GPGVerifier,
|
'.bz2': GPGVerifier,
|
||||||
'.xz': GPGVerifier,
|
'.xz': GPGVerifier,
|
||||||
'.zip': GPGVerifier,
|
'.zip': GPGVerifier,
|
||||||
|
'.zst': GPGVerifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ def main():
|
|||||||
pkg_name = sys.argv[1]
|
pkg_name = sys.argv[1]
|
||||||
pypi_name = get_pypi_name(pkg_name)
|
pypi_name = get_pypi_name(pkg_name)
|
||||||
if not pypi_name:
|
if not pypi_name:
|
||||||
print(f"Couldn't find {pkg_name} in pypi")
|
util.print_fatal(f"Couldn't find {pkg_name} in pypi")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
pypi_metadata = get_pypi_metadata(pypi_name)
|
pypi_metadata = get_pypi_metadata(pypi_name)
|
||||||
print(pypi_metadata)
|
print(pypi_metadata)
|
||||||
|
|||||||
+64
-64
@@ -2,67 +2,67 @@
|
|||||||
# pkgconfig equivalent, to be added to BuildRequires. Please keep sorted.
|
# pkgconfig equivalent, to be added to BuildRequires. Please keep sorted.
|
||||||
# This file is sorted with LC_COLLATE=C
|
# This file is sorted with LC_COLLATE=C
|
||||||
# Format: <qmake key>, <pkgconfig value>
|
# Format: <qmake key>, <pkgconfig value>
|
||||||
3danimation, Qt53DAnimation
|
3danimation, Qt63DAnimation
|
||||||
3dcore, Qt53DCore
|
3dcore, Qt63DCore
|
||||||
3dextras, Qt53DExtras
|
3dextras, Qt63DExtras
|
||||||
3dinput, Qt53DInput
|
3dinput, Qt63DInput
|
||||||
3dlogic, Qt53DLogic
|
3dlogic, Qt63DLogic
|
||||||
3dquick, Qt53DQuick
|
3dquick, Qt63DQuick
|
||||||
3dquickanimation, Qt53DQuickAnimation
|
3dquickanimation, Qt63DQuickAnimation
|
||||||
3dquickextras, Qt53DQuickExtras
|
3dquickextras, Qt63DQuickExtras
|
||||||
3dquickinput, Qt53DQuickInput
|
3dquickinput, Qt63DQuickInput
|
||||||
3dquickrender, Qt53DQuickRender
|
3dquickrender, Qt63DQuickRender
|
||||||
3dquickscene2d, Qt53DQuickScene2D
|
3dquickscene2d, Qt63DQuickScene2D
|
||||||
3drender, Qt53DRender
|
3drender, Qt63DRender
|
||||||
bluetooth, Qt5Bluetooth
|
bluetooth, Qt6Bluetooth
|
||||||
charts, Qt5Charts
|
charts, Qt6Charts
|
||||||
concurrent, Qt5Concurrent
|
concurrent, Qt6Concurrent
|
||||||
core, Qt5Core
|
core, Qt6Core
|
||||||
datavisualization, Qt5DataVisualization
|
datavisualization, Qt6DataVisualization
|
||||||
dbus, Qt5DBus
|
dbus, Qt6DBus
|
||||||
declarative, Qt5Declarative
|
declarative, Qt6Declarative
|
||||||
designer, Qt5Designer
|
designer, Qt6Designer
|
||||||
gamepad, Qt5Gamepad
|
gamepad, Qt6Gamepad
|
||||||
gui, Qt5Gui
|
gui, Qt6Gui
|
||||||
help, Qt5Help
|
help, Qt6Help
|
||||||
location, Qt5Location
|
location, Qt6Location
|
||||||
multimedia, Qt5Multimedia
|
multimedia, Qt6Multimedia
|
||||||
multimediawidgets, Qt5MultimediaWidgets
|
multimediawidgets, Qt6MultimediaWidgets
|
||||||
network, Qt5Network
|
network, Qt6Network
|
||||||
networkauth, Qt5NetworkAuth
|
networkauth, Qt6NetworkAuth
|
||||||
nfc, Qt5Nfc
|
nfc, Qt6Nfc
|
||||||
opengl, Qt5OpenGL
|
opengl, Qt6OpenGL
|
||||||
openglextensions, Qt5OpenGLExtensions
|
openglextensions, Qt6OpenGLExtensions
|
||||||
positioning, Qt5Positioning
|
positioning, Qt6Positioning
|
||||||
printsupport, Qt5PrintSupport
|
printsupport, Qt6PrintSupport
|
||||||
purchasing, Qt5Purchasing
|
purchasing, Qt6Purchasing
|
||||||
qml, Qt5Qml
|
qml, Qt6Qml
|
||||||
qmltest, Qt5QuickTest
|
qmltest, Qt6QuickTest
|
||||||
quick, Qt5Quick
|
quick, Qt6Quick
|
||||||
quickcontrols2, Qt5QuickControls2
|
quickcontrols2, Qt6QuickControls2
|
||||||
quickwidgets, Qt5QuickWidgets
|
quickwidgets, Qt6QuickWidgets
|
||||||
remoteobjects, Qt5RemoteObjects
|
remoteobjects, Qt6RemoteObjects
|
||||||
script, Qt5Script
|
script, Qt6Script
|
||||||
scripttools, Qt5ScriptTools
|
scripttools, Qt6ScriptTools
|
||||||
scxml, Qt5Scxml
|
scxml, Qt6Scxml
|
||||||
sensors, Qt5Sensors
|
sensors, Qt6Sensors
|
||||||
serialbus, Qt5SerialBus
|
serialbus, Qt6SerialBus
|
||||||
serialport, Qt5SerialPort
|
serialport, Qt6SerialPort
|
||||||
sql, Qt5Sql
|
sql, Qt6Sql
|
||||||
svg, Qt5Svg
|
svg, Qt6Svg
|
||||||
testlib, Qt5Test
|
testlib, Qt6Test
|
||||||
texttospeech, Qt5TextToSpeech
|
texttospeech, Qt6TextToSpeech
|
||||||
uitools, Qt5UiTools
|
uitools, Qt6UiTools
|
||||||
waylandclient, Qt5WaylandClient
|
waylandclient, Qt6WaylandClient
|
||||||
waylandcompositor, Qt5WaylandCompositor
|
waylandcompositor, Qt6WaylandCompositor
|
||||||
webchannel, Qt5WebChannel
|
webchannel, Qt6WebChannel
|
||||||
webengine, Qt5WebEngine
|
webengine, Qt6WebEngine
|
||||||
webenginecore, Qt5WebEngineCore
|
webenginecore, Qt6WebEngineCore
|
||||||
webenginewidgets, Qt5WebEngineWidgets
|
webenginewidgets, Qt6WebEngineWidgets
|
||||||
webkit, Qt5WebKit
|
webkit, Qt6WebKit
|
||||||
webkitwidgets, Qt5WebKitWidgets
|
webkitwidgets, Qt6WebKitWidgets
|
||||||
websockets, Qt5WebSockets
|
websockets, Qt6WebSockets
|
||||||
widgets, Qt5Widgets
|
widgets, Qt6Widgets
|
||||||
x11extras, Qt5X11Extras
|
x11extras, Qt6X11Extras
|
||||||
xml, Qt5Xml
|
xml, Qt6Xml
|
||||||
xmlpatterns, Qt5XmlPatterns
|
xmlpatterns, Qt6XmlPatterns
|
||||||
|
|||||||
+545
-195
File diff suppressed because it is too large
Load Diff
+42
-5
@@ -17,6 +17,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import bz2
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -25,6 +26,7 @@ import tarfile
|
|||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
import download
|
import download
|
||||||
|
import zstandard as zstd
|
||||||
from util import do_regex, get_sha1sum, print_fatal, write_out
|
from util import do_regex, get_sha1sum, print_fatal, write_out
|
||||||
|
|
||||||
|
|
||||||
@@ -50,6 +52,10 @@ class Source():
|
|||||||
"""Determine compression type."""
|
"""Determine compression type."""
|
||||||
if self.url.lower().endswith(('.zip', 'jar')):
|
if self.url.lower().endswith(('.zip', 'jar')):
|
||||||
self.type = 'zip'
|
self.type = 'zip'
|
||||||
|
elif self.url.lower().endswith(('.bz2')) and not self.url.lower().endswith(('.tar.bz2')):
|
||||||
|
self.type = 'bz2'
|
||||||
|
elif self.url.lower().endswith('.zst'):
|
||||||
|
self.type = 'zst'
|
||||||
else:
|
else:
|
||||||
self.type = 'tar'
|
self.type = 'tar'
|
||||||
|
|
||||||
@@ -78,6 +84,19 @@ class Source():
|
|||||||
print_fatal("Not a valid tar file.")
|
print_fatal("Not a valid tar file.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def set_zst_prefix(self):
|
||||||
|
"""Determine prefix folder name of tar.zst file."""
|
||||||
|
with tarfile.open(fileobj=zstd.open(self.path, 'rb'), mode='r|') as content:
|
||||||
|
lines = content.getnames()
|
||||||
|
if len(lines) == 0:
|
||||||
|
print_fatal("Zstd compressed tar file doesn't appear to have any content")
|
||||||
|
sys.exit(1)
|
||||||
|
elif len(lines) > 1:
|
||||||
|
self.prefix = os.path.commonpath(lines)
|
||||||
|
|
||||||
|
def set_bz2_prefix(self):
|
||||||
|
"""No prefix for plain bz2 archives."""
|
||||||
|
|
||||||
def set_zip_prefix(self):
|
def set_zip_prefix(self):
|
||||||
"""Determine prefix folder name of zip file."""
|
"""Determine prefix folder name of zip file."""
|
||||||
if zipfile.is_zipfile(self.path):
|
if zipfile.is_zipfile(self.path):
|
||||||
@@ -101,18 +120,35 @@ class Source():
|
|||||||
extraction_path = base_path
|
extraction_path = base_path
|
||||||
|
|
||||||
extract_method = getattr(self, 'extract_{}'.format(self.type))
|
extract_method = getattr(self, 'extract_{}'.format(self.type))
|
||||||
extract_method(extraction_path)
|
try:
|
||||||
|
extract_method(extraction_path)
|
||||||
|
except tarfile.AbsoluteLinkError:
|
||||||
|
pass
|
||||||
|
|
||||||
def extract_tar(self, extraction_path):
|
def extract_tar(self, extraction_path):
|
||||||
"""Extract tar in path."""
|
"""Extract tar in path."""
|
||||||
with tarfile.open(self.path) as content:
|
with tarfile.open(self.path) as content:
|
||||||
content.extractall(path=extraction_path)
|
content.extractall(path=extraction_path, filter='data')
|
||||||
|
|
||||||
|
def extract_bz2(self, extraction_path):
|
||||||
|
"""Extract plain bz2 file in path."""
|
||||||
|
with bz2.BZ2File(self.path, 'rb') as content:
|
||||||
|
data = content.read()
|
||||||
|
newfile = self.path.rsplit('/', 1)[1]
|
||||||
|
newfile = newfile.rsplit('.bz2', 1)[0]
|
||||||
|
with open(os.path.join(extraction_path), mode='wb') as f:
|
||||||
|
f.write(data)
|
||||||
|
|
||||||
def extract_zip(self, extraction_path):
|
def extract_zip(self, extraction_path):
|
||||||
"""Extract zip in path."""
|
"""Extract zip in path."""
|
||||||
with zipfile.ZipFile(self.path, 'r') as content:
|
with zipfile.ZipFile(self.path, 'r') as content:
|
||||||
content.extractall(path=extraction_path)
|
content.extractall(path=extraction_path)
|
||||||
|
|
||||||
|
def extract_zst(self, extraction_path):
|
||||||
|
"""Extract zst in path."""
|
||||||
|
with tarfile.open(fileobj=zstd.open(self.path, 'rb'), mode='r|') as content:
|
||||||
|
content.extractall(path=extraction_path, filter='data')
|
||||||
|
|
||||||
|
|
||||||
def convert_version(ver_str, name):
|
def convert_version(ver_str, name):
|
||||||
"""Remove disallowed characters from the version."""
|
"""Remove disallowed characters from the version."""
|
||||||
@@ -120,7 +156,7 @@ def convert_version(ver_str, name):
|
|||||||
# them out with expensive regular expressions
|
# them out with expensive regular expressions
|
||||||
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
||||||
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
||||||
"jurko", "%2f", "%2F", "%20"]
|
"jurko", "%2f", "%2F", "%20", "x265", "autotools"]
|
||||||
|
|
||||||
# package names may be modified in the version string by adding "lib" for
|
# package names may be modified in the version string by adding "lib" for
|
||||||
# example. Remove these from the name before trying to remove the name from
|
# example. Remove these from the name before trying to remove the name from
|
||||||
@@ -136,7 +172,7 @@ def convert_version(ver_str, name):
|
|||||||
ver_str = ver_str.replace(name.replace(mod, ""), "")
|
ver_str = ver_str.replace(name.replace(mod, ""), "")
|
||||||
|
|
||||||
# replace illegal characters
|
# replace illegal characters
|
||||||
ver_str = ver_str.strip().replace('-', '.').replace('_', '.')
|
ver_str = ver_str.strip().replace('-', '.').replace('_', '.').replace('+', '.')
|
||||||
|
|
||||||
# remove banned substrings
|
# remove banned substrings
|
||||||
for sub in banned_subs:
|
for sub in banned_subs:
|
||||||
@@ -262,7 +298,8 @@ class Content():
|
|||||||
if "github.com" in self.url:
|
if "github.com" in self.url:
|
||||||
# define regex accepted for valid packages, important for specific
|
# define regex accepted for valid packages, important for specific
|
||||||
# patterns to come before general ones
|
# patterns to come before general ones
|
||||||
github_patterns = [r"https?://github.com/(.*)/(.*?)/archive/refs/tags/[vVrR]?(.*)\.tar",
|
github_patterns = [r"https?://github.com/(.*)/(.*?)/archive/refs/tags/.*/(.*).tar",
|
||||||
|
r"https?://github.com/(.*)/(.*?)/archive/refs/tags/[vVrR]?(.*)\.tar",
|
||||||
r"https?://github.com/(.*)/(.*?)/archive/[v|r]?.*/(.*).tar",
|
r"https?://github.com/(.*)/(.*?)/archive/[v|r]?.*/(.*).tar",
|
||||||
r"https?://github.com/(.*)/(.*?)/archive/[-a-zA-Z_]*-(.*).tar",
|
r"https?://github.com/(.*)/(.*?)/archive/[-a-zA-Z_]*-(.*).tar",
|
||||||
r"https?://github.com/(.*)/(.*?)/archive/[vVrR]?(.*).tar",
|
r"https?://github.com/(.*)/(.*?)/archive/[vVrR]?(.*).tar",
|
||||||
|
|||||||
@@ -27,6 +27,101 @@ import sys
|
|||||||
dictionary_filename = os.path.dirname(__file__) + "/translate.dic"
|
dictionary_filename = os.path.dirname(__file__) + "/translate.dic"
|
||||||
dictionary = [line.strip() for line in open(dictionary_filename, 'r')]
|
dictionary = [line.strip() for line in open(dictionary_filename, 'r')]
|
||||||
os_paths = None
|
os_paths = None
|
||||||
|
ERROR_FILE = 'pumpAutospec'
|
||||||
|
ERROR_ENV = 'AUTOSPEC_UPDATE'
|
||||||
|
|
||||||
|
|
||||||
|
def _log_error(error):
|
||||||
|
write_out(ERROR_FILE, f"{error}\n", mode='a')
|
||||||
|
|
||||||
|
|
||||||
|
def _commit_result():
|
||||||
|
if not os.path.isfile(ERROR_FILE):
|
||||||
|
return
|
||||||
|
call(f"git add {ERROR_FILE}", check=False, stderr=subprocess.DEVNULL)
|
||||||
|
call(f"git commit {ERROR_FILE} -m 'Notes update'", check=False, stderr=subprocess.DEVNULL)
|
||||||
|
call("git push", check=False, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
|
||||||
|
def _process_line(line, prev_line, current_patch, reported_patches, error):
|
||||||
|
if m := re.match('^Patch #[0-9]+ .(?P<patch>.*).:', line):
|
||||||
|
current_patch[0] = m.group('patch')
|
||||||
|
|
||||||
|
if m := re.match('Hunk #[0-9]+ FAILED at [0-9]+', line):
|
||||||
|
if current_patch[0] not in reported_patches:
|
||||||
|
_log_error("Patch " + current_patch[0] + " does not apply")
|
||||||
|
reported_patches[current_patch[0]] = True
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match(".*can't find file to patch at input line ", line):
|
||||||
|
if current_patch[0] not in reported_patches:
|
||||||
|
_log_error("Patch " + current_patch[0] + " does not apply")
|
||||||
|
reported_patches[current_patch[0]] = True
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match('.*meson.build:[0-9]+:[0-9]+: ERROR: Unknown options: "(?P<option>.*)"', line):
|
||||||
|
_log_error("Unknown meson option: " + m.group('option'))
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match('Error: package ‘(?P<module>.*)’ .* was found, but', line):
|
||||||
|
_log_error("R package " + m.group('module') + " not found")
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match('.*CMake Error at .*/CMake', prev_line):
|
||||||
|
if m := re.match('(?P<module>.*) not found', line):
|
||||||
|
_log_error("CMake module " + m.group('module') + "not found")
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match(r'go: download.*connect: connection refused', line):
|
||||||
|
_log_error("Go online update")
|
||||||
|
return True
|
||||||
|
|
||||||
|
if 'Updating crates.io index' in line:
|
||||||
|
_log_error("Rust crates.io online update")
|
||||||
|
return True
|
||||||
|
|
||||||
|
if "error: '__builtin_ctzs' needs isa option -mbmi" in line:
|
||||||
|
_log_error(" error: '__builtin_ctzs' needs isa option -mbmi")
|
||||||
|
return True
|
||||||
|
|
||||||
|
if "error:" in line and 'Bad exit status from' not in line:
|
||||||
|
m = re.match('.*error:(?P<error>.*)', line)
|
||||||
|
if m and not error:
|
||||||
|
_log_error("Compiler: " + m.group('error'))
|
||||||
|
return True
|
||||||
|
|
||||||
|
if m := re.match(r'Could NOT find (?P<package>.*) .missing', line):
|
||||||
|
_log_error("CMake module " + m.group('package') + " not found")
|
||||||
|
return True
|
||||||
|
if m := re.match(r'Could not find a package configuration file provided by (?P<package>.*) with', line):
|
||||||
|
_log_error("CMake module " + m.group('package') + " not found")
|
||||||
|
return True
|
||||||
|
# Unable to find program 'gperf'
|
||||||
|
if m := re.match(r"Failed to find program ‘(?P<module>.*)’", line):
|
||||||
|
_log_error("Failed to find " + m.group('module'))
|
||||||
|
return True
|
||||||
|
if m := re.match(r"Failed to find ‘(?P<module>.*)’", line):
|
||||||
|
_log_error("Failed to find " + m.group('module'))
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def _process_build_log(filename):
|
||||||
|
with open_auto(filename, "r") as lfile:
|
||||||
|
lines = lfile.readlines()
|
||||||
|
|
||||||
|
prev_line = ''
|
||||||
|
current_patch = ['']
|
||||||
|
reported_patches = {}
|
||||||
|
error = False
|
||||||
|
for line in lines:
|
||||||
|
if _process_line(line, prev_line, current_patch, reported_patches, error):
|
||||||
|
error = True
|
||||||
|
prev_line = line
|
||||||
|
|
||||||
|
if error:
|
||||||
|
_commit_result()
|
||||||
|
|
||||||
|
|
||||||
def call(command, logfile=None, check=True, **kwargs):
|
def call(command, logfile=None, check=True, **kwargs):
|
||||||
@@ -116,9 +211,22 @@ def print_error(message):
|
|||||||
_print_message(message, 'ERROR', 'red')
|
_print_message(message, 'ERROR', 'red')
|
||||||
|
|
||||||
|
|
||||||
|
def print_build_failed():
|
||||||
|
"""Print final fatal error, color coded for TTYs."""
|
||||||
|
_print_message('Build failed, aborting', 'FATAL', 'red')
|
||||||
|
try:
|
||||||
|
if os.environ.get(ERROR_ENV):
|
||||||
|
_process_build_log('results/build.log')
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def print_fatal(message):
|
def print_fatal(message):
|
||||||
"""Print fatal error, color coded for TTYs."""
|
"""Print fatal error, color coded for TTYs."""
|
||||||
_print_message(message, 'FATAL', 'red')
|
_print_message(message, 'FATAL', 'red')
|
||||||
|
if os.environ.get(ERROR_ENV):
|
||||||
|
write_out(ERROR_FILE, f"{message}\n", mode='a')
|
||||||
|
_commit_result()
|
||||||
|
|
||||||
|
|
||||||
def print_warning(message):
|
def print_warning(message):
|
||||||
@@ -166,3 +274,31 @@ def open_auto(*args, **kwargs):
|
|||||||
assert 'encoding' not in kwargs
|
assert 'encoding' not in kwargs
|
||||||
assert 'errors' not in kwargs
|
assert 'errors' not in kwargs
|
||||||
return open(*args, encoding="utf-8", errors="surrogateescape", **kwargs)
|
return open(*args, encoding="utf-8", errors="surrogateescape", **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def globlike_match(filename, match_name):
|
||||||
|
"""Compare the filename to the match_name in a way that simulates the shell glob '*'."""
|
||||||
|
fsplit = filename.split('/')
|
||||||
|
if len(fsplit) != len(match_name):
|
||||||
|
return False
|
||||||
|
match = True
|
||||||
|
for fpart, mpart in zip(fsplit, match_name):
|
||||||
|
if fpart != mpart:
|
||||||
|
if '*' not in mpart:
|
||||||
|
match = False
|
||||||
|
break
|
||||||
|
if len(mpart) > len(fpart) + 1:
|
||||||
|
match = False
|
||||||
|
break
|
||||||
|
mpl, mpr = mpart.split('*')
|
||||||
|
try:
|
||||||
|
if fpart.index(mpl) != 0:
|
||||||
|
match = False
|
||||||
|
break
|
||||||
|
if fpart.rindex(mpr) != len(fpart) - len(mpr):
|
||||||
|
match = False
|
||||||
|
break
|
||||||
|
except ValueError:
|
||||||
|
match = False
|
||||||
|
break
|
||||||
|
return match
|
||||||
|
|||||||
@@ -1612,3 +1612,5 @@ http://sourceforge.net/projects/zsh/files/zsh/5.4.2/zsh-5.4.2.tar.gz,zsh,5.4.2
|
|||||||
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3.11-pigeonhole-0.5.11.tar.gz,pigeonhole,0.5.11
|
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3.11-pigeonhole-0.5.11.tar.gz,pigeonhole,0.5.11
|
||||||
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-0.5.20.tar.gz,pigeonhole,0.5.20
|
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-0.5.20.tar.gz,pigeonhole,0.5.20
|
||||||
https://www.ezix.org/software/files/lshw-B.02.19.2.tar.gz,lshw,02.19.2
|
https://www.ezix.org/software/files/lshw-B.02.19.2.tar.gz,lshw,02.19.2
|
||||||
|
https://github.com/VectorCamp/vectorscan/archive/refs/tags/vectorscan/5.4.11.tar.gz,vectorscan,5.4.11
|
||||||
|
https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.7.13+release.autotools.tar.gz,libopenmpt,0.7.13
|
||||||
|
|||||||
+19
-9
@@ -190,25 +190,36 @@ class TestBuildpattern(unittest.TestCase):
|
|||||||
def mock_util_call(cmd):
|
def mock_util_call(cmd):
|
||||||
del cmd
|
del cmd
|
||||||
|
|
||||||
|
def mock_wrap_fatal():
|
||||||
|
output = ['']
|
||||||
|
def mock_print_fatal(msg):
|
||||||
|
output[0] = msg
|
||||||
|
return output, mock_print_fatal
|
||||||
|
|
||||||
|
result, mock_print_fatal = mock_wrap_fatal()
|
||||||
|
|
||||||
|
exit_backup = build.sys.exit
|
||||||
call_backup = build.util.call
|
call_backup = build.util.call
|
||||||
|
print_backup = build.util.print_fatal
|
||||||
|
build.sys.exit = MagicMock()
|
||||||
build.util.call = mock_util_call
|
build.util.call = mock_util_call
|
||||||
|
build.util.print_fatal = mock_print_fatal
|
||||||
|
|
||||||
open_name = 'build.util.open_auto'
|
open_name = 'build.util.open_auto'
|
||||||
content = "line1\nDEBUG util.py:399: No matching package to install: 'foobar'\nDEBUG util.py:399: No matching package to install: 'foobarbaz'\nline 4"
|
content = "line1\nDEBUG util.py:399: No matching package to install: 'foobar'\nDEBUG util.py:399: No matching package to install: 'foobarbaz'\nline 4"
|
||||||
m_open = mock_open(read_data=content)
|
m_open = mock_open(read_data=content)
|
||||||
pkg = build.Build()
|
pkg = build.Build()
|
||||||
pkg.must_restart = 1
|
|
||||||
pkg.file_restart = 1
|
|
||||||
|
|
||||||
result = True
|
|
||||||
with patch(open_name, m_open, create=True):
|
with patch(open_name, m_open, create=True):
|
||||||
result = pkg.parse_buildroot_log('testname', 1)
|
pkg.parse_buildroot_log('testname', 1)
|
||||||
|
|
||||||
|
build.util.print_fatal = print_backup
|
||||||
build.util.call = call_backup
|
build.util.call = call_backup
|
||||||
|
mock_exit = build.sys.exit
|
||||||
|
build.sys.exit = exit_backup
|
||||||
|
|
||||||
self.assertFalse(result)
|
self.assertEqual(result[0], 'Cannot resolve dependency name: foobar\nCannot resolve dependency name: foobarbaz')
|
||||||
self.assertEqual(pkg.must_restart, 0)
|
mock_exit.assert_called_once()
|
||||||
self.assertEqual(pkg.file_restart, 0)
|
|
||||||
|
|
||||||
def test_parse_buildroot_log_pass(self):
|
def test_parse_buildroot_log_pass(self):
|
||||||
"""
|
"""
|
||||||
@@ -227,11 +238,10 @@ class TestBuildpattern(unittest.TestCase):
|
|||||||
|
|
||||||
result = True
|
result = True
|
||||||
with patch(open_name, m_open, create=True):
|
with patch(open_name, m_open, create=True):
|
||||||
result = pkg.parse_buildroot_log('testname', 1)
|
pkg.parse_buildroot_log('testname', 1)
|
||||||
|
|
||||||
build.util.call = call_backup
|
build.util.call = call_backup
|
||||||
|
|
||||||
self.assertTrue(result)
|
|
||||||
self.assertEqual(pkg.must_restart, 0)
|
self.assertEqual(pkg.must_restart, 0)
|
||||||
|
|
||||||
def test_parse_buildroot_log_noop(self):
|
def test_parse_buildroot_log_noop(self):
|
||||||
|
|||||||
+48
-1
@@ -402,6 +402,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
||||||
@@ -418,6 +419,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'CMakeLists.txt'), 'w').close()
|
open(os.path.join(tmpd, 'CMakeLists.txt'), 'w').close()
|
||||||
@@ -434,6 +436,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'SConstruct'), 'w').close()
|
open(os.path.join(tmpd, 'SConstruct'), 'w').close()
|
||||||
@@ -450,6 +453,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'meson.build'), 'w').close()
|
open(os.path.join(tmpd, 'meson.build'), 'w').close()
|
||||||
@@ -480,6 +484,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
buildreq.pypidata.get_pypi_metadata = MagicMock(return_value=content)
|
buildreq.pypidata.get_pypi_metadata = MagicMock(return_value=content)
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
||||||
self.reqs.scan_for_configure(os.path.join(tmpd, 'subdir'), "", conf)
|
self.reqs.scan_for_configure(os.path.join(tmpd, 'subdir'), "", conf)
|
||||||
@@ -512,6 +517,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
m_open = mock_open(read_data=content)
|
m_open = mock_open(read_data=content)
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
||||||
open(os.path.join(tmpd, 'pypi.json'), 'w').close()
|
open(os.path.join(tmpd, 'pypi.json'), 'w').close()
|
||||||
@@ -537,6 +543,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'setup.py'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'setup.py'), 'w').close()
|
||||||
open(os.path.join(tmpd, 'subdir', 'requires.txt'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'requires.txt'), 'w').close()
|
||||||
@@ -546,6 +553,21 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
self.reqs.add_setup_py_requires.assert_called_once()
|
self.reqs.add_setup_py_requires.assert_called_once()
|
||||||
self.reqs.grab_python_requirements.assert_called_once()
|
self.reqs.grab_python_requirements.assert_called_once()
|
||||||
|
|
||||||
|
def test_scan_for_configure_ninja(self):
|
||||||
|
"""
|
||||||
|
Test scan_for_configure when ninja is enabled.
|
||||||
|
"""
|
||||||
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = True
|
||||||
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
|
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
||||||
|
|
||||||
|
self.reqs.scan_for_configure(tmpd, "", conf)
|
||||||
|
|
||||||
|
self.assertEqual(self.reqs.buildreqs,
|
||||||
|
set(['buildreq-distutils3', 'ninja']))
|
||||||
|
|
||||||
def test_parse_cmake_pkg_check_modules(self):
|
def test_parse_cmake_pkg_check_modules(self):
|
||||||
"""
|
"""
|
||||||
Test parse_cmake to ensure accurate detection of versioned and
|
Test parse_cmake to ensure accurate detection of versioned and
|
||||||
@@ -621,12 +643,30 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
"valid": "valid",
|
"valid": "valid",
|
||||||
"valid_but_commented": "valid_but_commented",
|
"valid_but_commented": "valid_but_commented",
|
||||||
"different_name": "another_name",
|
"different_name": "another_name",
|
||||||
|
"qt6.module1": "qt6module1",
|
||||||
|
"qt6.module2": "qt6module2",
|
||||||
|
"kf6.module3": "kf6module3",
|
||||||
|
"kf6.module4": "kf6module4",
|
||||||
|
".module5": "namodule5",
|
||||||
|
".module6": "namodule6"
|
||||||
}
|
}
|
||||||
content = '''
|
content = '''
|
||||||
find_package(valid)
|
find_package(valid)
|
||||||
#find_package(foo)
|
#find_package(foo)
|
||||||
# find_package(valid_but_commented)
|
# find_package(valid_but_commented)
|
||||||
find_package(different_name)
|
find_package(different_name)
|
||||||
|
find_package(Qt6 stuff
|
||||||
|
module1
|
||||||
|
module2)
|
||||||
|
find_package(KF6 stuff
|
||||||
|
module3
|
||||||
|
module4
|
||||||
|
)
|
||||||
|
find_package(NOT_HANDLED_NAMESPACE stuff
|
||||||
|
module5
|
||||||
|
|
||||||
|
module6
|
||||||
|
)
|
||||||
'''
|
'''
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
with open(os.path.join(tmpd, 'fname'), 'w') as f:
|
with open(os.path.join(tmpd, 'fname'), 'w') as f:
|
||||||
@@ -634,7 +674,14 @@ find_package(different_name)
|
|||||||
self.reqs.parse_cmake(os.path.join(tmpd, 'fname'), cmake_modules, False)
|
self.reqs.parse_cmake(os.path.join(tmpd, 'fname'), cmake_modules, False)
|
||||||
|
|
||||||
self.assertEqual(self.reqs.buildreqs,
|
self.assertEqual(self.reqs.buildreqs,
|
||||||
set(['valid', 'another_name']))
|
set(['valid',
|
||||||
|
'another_name',
|
||||||
|
'qt6module1',
|
||||||
|
'qt6module2',
|
||||||
|
'kf6module3',
|
||||||
|
'kf6module4',
|
||||||
|
'namodule5',
|
||||||
|
'namodule6']))
|
||||||
|
|
||||||
def test_r_desc_field_begin(self):
|
def test_r_desc_field_begin(self):
|
||||||
"""Test parsing of the first R description field."""
|
"""Test parsing of the first R description field."""
|
||||||
|
|||||||
@@ -152,26 +152,6 @@ class TestTest(unittest.TestCase):
|
|||||||
check.os.listdir = listdir_backup
|
check.os.listdir = listdir_backup
|
||||||
self.assertEqual(check.tests_config, 'make TEST_VERBOSE=1 test')
|
self.assertEqual(check.tests_config, 'make TEST_VERBOSE=1 test')
|
||||||
|
|
||||||
def test_scan_for_tests_setup(self):
|
|
||||||
"""
|
|
||||||
Test scan_for_tests with setup.py suite
|
|
||||||
"""
|
|
||||||
reqs = buildreq.Requirements("")
|
|
||||||
conf = config.Config("")
|
|
||||||
tcontent = tarball.Content("", "", "", [], conf, "")
|
|
||||||
listdir_backup = os.listdir
|
|
||||||
check.os.listdir = mock_generator(['setup.py'])
|
|
||||||
content = 'test_suite'
|
|
||||||
m_open = mock_open(read_data=content)
|
|
||||||
with patch(self.open_name, m_open, create=True):
|
|
||||||
conf.default_pattern = "distutils3"
|
|
||||||
check.scan_for_tests('pkgdir', conf, reqs, tcontent)
|
|
||||||
|
|
||||||
check.os.listdir = listdir_backup
|
|
||||||
self.assertEqual(check.tests_config,
|
|
||||||
'PYTHONPATH=%{buildroot}$(python -c "import sys; print(sys.path[-1])") '
|
|
||||||
'python setup.py test')
|
|
||||||
|
|
||||||
def test_scan_for_tests_cmake(self):
|
def test_scan_for_tests_cmake(self):
|
||||||
"""
|
"""
|
||||||
Test scan_for_tests with cmake suite
|
Test scan_for_tests with cmake suite
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import config
|
|||||||
# Structure: (url, build_pattern)
|
# Structure: (url, build_pattern)
|
||||||
BUILD_PAT_URL = [
|
BUILD_PAT_URL = [
|
||||||
("https://cran.r-project.org/src/contrib/raster_3.0-12.tar.gz", "R"),
|
("https://cran.r-project.org/src/contrib/raster_3.0-12.tar.gz", "R"),
|
||||||
|
("https://ftp.osuosl.org/pub/cran/src/contrib/hexbin_1.28.5.tar.gz", "R"),
|
||||||
("http://pypi.debian.net/argparse/argparse-1.4.0.tar.gz", "distutils3"),
|
("http://pypi.debian.net/argparse/argparse-1.4.0.tar.gz", "distutils3"),
|
||||||
("https://pypi.python.org/packages/source/T/Tempita/Tempita-0.5.2.tar.gz", "distutils3"),
|
("https://pypi.python.org/packages/source/T/Tempita/Tempita-0.5.2.tar.gz", "distutils3"),
|
||||||
("https://cpan.metacpan.org/authors/id/T/TO/TODDR/IO-Tty-1.14.tar.gz", "cpan"),
|
("https://cpan.metacpan.org/authors/id/T/TO/TODDR/IO-Tty-1.14.tar.gz", "cpan"),
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class TestFiles(unittest.TestCase):
|
|||||||
"/opt/two",
|
"/opt/two",
|
||||||
"/V3/opt/two",
|
"/V3/opt/two",
|
||||||
"/V4/opt/two",
|
"/V4/opt/two",
|
||||||
|
"/VA/opt/two",
|
||||||
"/usr/etc/three",
|
"/usr/etc/three",
|
||||||
"/usr/local/four",
|
"/usr/local/four",
|
||||||
"/usr/src/five",
|
"/usr/src/five",
|
||||||
@@ -58,6 +59,7 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file('/etc/test-fn')
|
self.fm.push_package_file('/etc/test-fn')
|
||||||
self.fm.push_package_file('/V3/etc/test-fn')
|
self.fm.push_package_file('/V3/etc/test-fn')
|
||||||
self.fm.push_package_file('/V4/etc/test-fn')
|
self.fm.push_package_file('/V4/etc/test-fn')
|
||||||
|
self.fm.push_package_file('/VA/etc/test-fn')
|
||||||
self.assertTrue(self.fm.has_banned)
|
self.assertTrue(self.fm.has_banned)
|
||||||
self.assertFalse(self.fm.newfiles_printed)
|
self.assertFalse(self.fm.newfiles_printed)
|
||||||
|
|
||||||
@@ -84,6 +86,7 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.assertTrue(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
|
self.assertTrue(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
|
||||||
self.assertTrue(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
|
self.assertTrue(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
|
||||||
self.assertTrue(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
|
self.assertTrue(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
|
||||||
|
self.assertTrue(self.fm.compat_exclude('/VA/usr/lib64/libfoo.so'))
|
||||||
|
|
||||||
def test_compat_exclude_not_compat_mode(self):
|
def test_compat_exclude_not_compat_mode(self):
|
||||||
"""
|
"""
|
||||||
@@ -94,6 +97,7 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.assertFalse(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
|
self.assertFalse(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
|
||||||
self.assertFalse(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
|
self.assertFalse(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
|
||||||
self.assertFalse(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
|
self.assertFalse(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
|
||||||
|
self.assertFalse(self.fm.compat_exclude('/VA/usr/lib64/libfoo.so'))
|
||||||
|
|
||||||
def test_file_pat_match(self):
|
def test_file_pat_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -107,6 +111,8 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
|
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
|
||||||
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
|
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
|
||||||
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
|
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
|
||||||
|
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main'))
|
||||||
|
self.fm.push_package_file.assert_called_with('/VA/test-fn', 'main')
|
||||||
|
|
||||||
def test_file_pat_match_exclude(self):
|
def test_file_pat_match_exclude(self):
|
||||||
"""
|
"""
|
||||||
@@ -117,6 +123,7 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.assertTrue(self.fm.file_pat_match('/test-fn', r'^/test-fn', 'main'))
|
self.assertTrue(self.fm.file_pat_match('/test-fn', r'^/test-fn', 'main'))
|
||||||
self.assertTrue(self.fm.file_pat_match('/V3/test-fn', r'^/test-fn', 'main'))
|
self.assertTrue(self.fm.file_pat_match('/V3/test-fn', r'^/test-fn', 'main'))
|
||||||
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
|
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
|
||||||
|
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main'))
|
||||||
self.fm.push_package_file.assert_not_called()
|
self.fm.push_package_file.assert_not_called()
|
||||||
|
|
||||||
def test_file_pat_match_replacement(self):
|
def test_file_pat_match_replacement(self):
|
||||||
@@ -130,6 +137,8 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file.assert_called_with('/V3/testfn', 'main')
|
self.fm.push_package_file.assert_called_with('/V3/testfn', 'main')
|
||||||
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'/test-fn', 'main', '/testfn'))
|
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'/test-fn', 'main', '/testfn'))
|
||||||
self.fm.push_package_file.assert_called_with('/V4/testfn', 'main')
|
self.fm.push_package_file.assert_called_with('/V4/testfn', 'main')
|
||||||
|
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'/test-fn', 'main', '/testfn'))
|
||||||
|
self.fm.push_package_file.assert_called_with('/VA/testfn', 'main')
|
||||||
|
|
||||||
def test_file_pat_match_replacement_no_glob(self):
|
def test_file_pat_match_replacement_no_glob(self):
|
||||||
"""
|
"""
|
||||||
@@ -143,6 +152,42 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
|
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
|
||||||
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main', '/testfn'))
|
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main', '/testfn'))
|
||||||
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
|
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
|
||||||
|
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main', '/testfn'))
|
||||||
|
self.fm.push_package_file.assert_called_with('/VA/test-fn', 'main')
|
||||||
|
|
||||||
|
def test_file_windows_exe_not_allowed(self):
|
||||||
|
"""
|
||||||
|
Test that Windows exe and dll files are excluded
|
||||||
|
"""
|
||||||
|
self.fm.push_package_file = MagicMock()
|
||||||
|
self.fm.config.config_opts['allow_exe'] = False
|
||||||
|
self.fm.push_file('/usr/bin/foo.exe', 'test')
|
||||||
|
self.fm.push_file('/usr/lib64/foo.dll', 'test')
|
||||||
|
self.fm.push_file('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', 'test')
|
||||||
|
self.fm.push_file('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', 'test')
|
||||||
|
self.assertIn('/usr/bin/foo.exe', self.fm.excludes)
|
||||||
|
self.assertIn('/usr/lib64/foo.dll', self.fm.excludes)
|
||||||
|
self.assertIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.excludes)
|
||||||
|
self.assertIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.excludes)
|
||||||
|
|
||||||
|
def test_file_windows_exe_allowed(self):
|
||||||
|
"""
|
||||||
|
Test that Windows exe and dll files are not excluded
|
||||||
|
"""
|
||||||
|
self.fm.push_package_file = MagicMock()
|
||||||
|
self.fm.config.config_opts['allow_exe'] = True
|
||||||
|
self.fm.push_file('/usr/bin/foo.exe', 'test')
|
||||||
|
self.fm.push_file('/usr/lib64/foo.dll', 'test')
|
||||||
|
self.fm.push_file('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', 'test')
|
||||||
|
self.fm.push_file('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', 'test')
|
||||||
|
self.assertIn('/usr/bin/foo.exe', self.fm.files)
|
||||||
|
self.assertIn('/usr/lib64/foo.dll', self.fm.files)
|
||||||
|
self.assertIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.files)
|
||||||
|
self.assertIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.files)
|
||||||
|
self.assertNotIn('/usr/bin/foo.exe', self.fm.excludes)
|
||||||
|
self.assertNotIn('/usr/lib64/foo.dll', self.fm.excludes)
|
||||||
|
self.assertNotIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.excludes)
|
||||||
|
self.assertNotIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.excludes)
|
||||||
|
|
||||||
def test_file_pat_match_no_match(self):
|
def test_file_pat_match_no_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -203,6 +248,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/foobar', '')
|
self.fm.push_file('/V4/foobar', '')
|
||||||
calls = [call('/V4/foobar', 'foobar-extras')]
|
calls = [call('/V4/foobar', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/foobar', '')
|
||||||
|
calls = [call('/VA/foobar', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_package_file_glob_empty(self):
|
def test_push_package_file_glob_empty(self):
|
||||||
"""
|
"""
|
||||||
@@ -220,6 +268,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/leftglobrightglob', '')
|
self.fm.push_file('/V4/leftglobrightglob', '')
|
||||||
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
|
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/leftglobrightglob', '')
|
||||||
|
calls = [call('/VA/leftglob*rightglob', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_package_file_glob_left_match(self):
|
def test_push_package_file_glob_left_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -237,6 +288,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/leftglobrightglob', '')
|
self.fm.push_file('/V4/leftglobrightglob', '')
|
||||||
calls = [call('/V4/leftglob*', 'foobar-extras')]
|
calls = [call('/V4/leftglob*', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/leftglobrightglob', '')
|
||||||
|
calls = [call('/VA/leftglob*', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_package_file_glob_right_match(self):
|
def test_push_package_file_glob_right_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -254,6 +308,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/leftglobrightglob', '')
|
self.fm.push_file('/V4/leftglobrightglob', '')
|
||||||
calls = [call('/V4/*rightglob', 'foobar-extras')]
|
calls = [call('/V4/*rightglob', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/leftglobrightglob', '')
|
||||||
|
calls = [call('/VA/*rightglob', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_package_file_glob_leftright_match(self):
|
def test_push_package_file_glob_leftright_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -271,6 +328,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/leftglobstuffrightglob', '')
|
self.fm.push_file('/V4/leftglobstuffrightglob', '')
|
||||||
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
|
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/leftglobstuffrightglob', '')
|
||||||
|
calls = [call('/VA/leftglob*rightglob', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_package_file_glob_multi_match(self):
|
def test_push_package_file_glob_multi_match(self):
|
||||||
"""
|
"""
|
||||||
@@ -288,6 +348,9 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_file('/V4/leftglobstuff/stuffrightglob', '')
|
self.fm.push_file('/V4/leftglobstuff/stuffrightglob', '')
|
||||||
calls = [call('/V4/leftglob*/*rightglob', 'foobar-extras')]
|
calls = [call('/V4/leftglob*/*rightglob', 'foobar-extras')]
|
||||||
self.fm.push_package_file.assert_has_calls(calls)
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
self.fm.push_file('/VA/leftglobstuff/stuffrightglob', '')
|
||||||
|
calls = [call('/VA/leftglob*/*rightglob', 'foobar-extras')]
|
||||||
|
self.fm.push_package_file.assert_has_calls(calls)
|
||||||
|
|
||||||
def test_push_file_setuid(self):
|
def test_push_file_setuid(self):
|
||||||
"""
|
"""
|
||||||
@@ -313,6 +376,8 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file.assert_has_calls([call('/V3/usr/bin/test', 'bin')])
|
self.fm.push_package_file.assert_has_calls([call('/V3/usr/bin/test', 'bin')])
|
||||||
self.fm.push_file('/V4/usr/bin/test', '')
|
self.fm.push_file('/V4/usr/bin/test', '')
|
||||||
self.fm.push_package_file.assert_has_calls([call('/V4/usr/bin/test', 'bin')])
|
self.fm.push_package_file.assert_has_calls([call('/V4/usr/bin/test', 'bin')])
|
||||||
|
self.fm.push_file('/VA/usr/bin/test', '')
|
||||||
|
self.fm.push_package_file.assert_has_calls([call('/VA/usr/bin/test', 'bin')])
|
||||||
|
|
||||||
def test_push_file_match_pkg_name_dependency(self):
|
def test_push_file_match_pkg_name_dependency(self):
|
||||||
"""
|
"""
|
||||||
@@ -327,6 +392,8 @@ class TestFiles(unittest.TestCase):
|
|||||||
self.fm.push_package_file.assert_has_calls([call('/V3/usr/share/doc/testball/*', 'doc')])
|
self.fm.push_package_file.assert_has_calls([call('/V3/usr/share/doc/testball/*', 'doc')])
|
||||||
self.fm.push_file('/V4/usr/share/doc/testball/', 'testball')
|
self.fm.push_file('/V4/usr/share/doc/testball/', 'testball')
|
||||||
self.fm.push_package_file.assert_has_calls([call('/V4/usr/share/doc/testball/*', 'doc')])
|
self.fm.push_package_file.assert_has_calls([call('/V4/usr/share/doc/testball/*', 'doc')])
|
||||||
|
self.fm.push_file('/VA/usr/share/doc/testball/', 'testball')
|
||||||
|
self.fm.push_package_file.assert_has_calls([call('/VA/usr/share/doc/testball/*', 'doc')])
|
||||||
|
|
||||||
def test_push_file_no_match(self):
|
def test_push_file_no_match(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
+57
-1
@@ -71,7 +71,7 @@ class TestLicense(unittest.TestCase):
|
|||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
conf.setup_patterns()
|
conf.setup_patterns()
|
||||||
# remove the hash from license_hashes
|
# remove the hash from license_hashes
|
||||||
del(conf.license_hashes[license.get_sha1sum('tests/COPYING_TEST')])
|
del(conf.license_hashes[license.util.get_sha1sum('tests/COPYING_TEST')])
|
||||||
conf.license_show = "license.show.url"
|
conf.license_show = "license.show.url"
|
||||||
license.license_from_copying_hash('tests/COPYING_TEST', '', conf, '')
|
license.license_from_copying_hash('tests/COPYING_TEST', '', conf, '')
|
||||||
|
|
||||||
@@ -233,6 +233,62 @@ class TestLicense(unittest.TestCase):
|
|||||||
self.assertIn("Cannot find any license", out.getvalue())
|
self.assertIn("Cannot find any license", out.getvalue())
|
||||||
self.assertEqual(license.licenses, [])
|
self.assertEqual(license.licenses, [])
|
||||||
|
|
||||||
|
def test_scan_for_licenses_skip(self):
|
||||||
|
"""
|
||||||
|
Test scan_for_licenses in temporary directory with licenses to skip
|
||||||
|
"""
|
||||||
|
conf = config.Config("")
|
||||||
|
conf.setup_patterns()
|
||||||
|
conf.license_skips = [['COPYING']]
|
||||||
|
with open('tests/COPYING_TEST', 'rb') as copyingf:
|
||||||
|
content = copyingf.read()
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
|
# create the copying file
|
||||||
|
with open(os.path.join(tmpd, 'COPYING'), 'w') as newcopyingf:
|
||||||
|
newcopyingf.write(content.decode('utf-8'))
|
||||||
|
# create some cruft for testing
|
||||||
|
for testf in ['testlib.c', 'testmain.c', 'testheader.h']:
|
||||||
|
with open(os.path.join(tmpd, testf), 'w') as newtestf:
|
||||||
|
newtestf.write('test content')
|
||||||
|
# let's check that the proper thing is being printed as well
|
||||||
|
out = StringIO()
|
||||||
|
with redirect_stdout(out):
|
||||||
|
with self.assertRaises(SystemExit) as thread:
|
||||||
|
license.scan_for_licenses(tmpd, conf, '')
|
||||||
|
|
||||||
|
self.assertEqual(thread.exception.code, 1)
|
||||||
|
self.assertIn("Cannot find any license", out.getvalue())
|
||||||
|
self.assertEqual(license.licenses, [])
|
||||||
|
|
||||||
|
def test_scan_for_licenses_skip_prefix_slash(self):
|
||||||
|
"""
|
||||||
|
Test scan_for_licenses in temporary directory with licenses to skip
|
||||||
|
"""
|
||||||
|
conf = config.Config("")
|
||||||
|
conf.setup_patterns()
|
||||||
|
conf.license_skips = [['', 'COPYING']]
|
||||||
|
with open('tests/COPYING_TEST', 'rb') as copyingf:
|
||||||
|
content = copyingf.read()
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
|
# create the copying file
|
||||||
|
with open(os.path.join(tmpd, 'COPYING'), 'w') as newcopyingf:
|
||||||
|
newcopyingf.write(content.decode('utf-8'))
|
||||||
|
# create some cruft for testing
|
||||||
|
for testf in ['testlib.c', 'testmain.c', 'testheader.h']:
|
||||||
|
with open(os.path.join(tmpd, testf), 'w') as newtestf:
|
||||||
|
newtestf.write('test content')
|
||||||
|
# let's check that the proper thing is being printed as well
|
||||||
|
out = StringIO()
|
||||||
|
with redirect_stdout(out):
|
||||||
|
with self.assertRaises(SystemExit) as thread:
|
||||||
|
license.scan_for_licenses(tmpd, conf, '')
|
||||||
|
|
||||||
|
self.assertEqual(thread.exception.code, 1)
|
||||||
|
self.assertIn("Cannot find any license", out.getvalue())
|
||||||
|
self.assertEqual(license.licenses, [])
|
||||||
|
|
||||||
def test_load_specfile(self):
|
def test_load_specfile(self):
|
||||||
"""
|
"""
|
||||||
Test load_specfile with populated license list. This method is not
|
Test load_specfile with populated license list. This method is not
|
||||||
|
|||||||
+1
-14
@@ -47,7 +47,7 @@ class TestSpecfileWrite(unittest.TestCase):
|
|||||||
self.WRITES = self.WRITES[:4] + self.WRITES[6:]
|
self.WRITES = self.WRITES[:4] + self.WRITES[6:]
|
||||||
self.assertEqual(expect, self.WRITES)
|
self.assertEqual(expect, self.WRITES)
|
||||||
|
|
||||||
def test_write_nvr_no_urlban(self):
|
def test_write_nvr(self):
|
||||||
"""
|
"""
|
||||||
test Specfile.write_nvr with no urlban set
|
test Specfile.write_nvr with no urlban set
|
||||||
"""
|
"""
|
||||||
@@ -59,19 +59,6 @@ class TestSpecfileWrite(unittest.TestCase):
|
|||||||
"Source0 : http://www.testpkg.com/testpkg/pkg-1.0.tar.gz\n"]
|
"Source0 : http://www.testpkg.com/testpkg/pkg-1.0.tar.gz\n"]
|
||||||
self.assertEqual(expect, self.WRITES)
|
self.assertEqual(expect, self.WRITES)
|
||||||
|
|
||||||
def test_write_nvr_urlban(self):
|
|
||||||
"""
|
|
||||||
test Specfile.write_nvr with urlban set
|
|
||||||
"""
|
|
||||||
self.specfile.config.urlban = "www.testpkg.com"
|
|
||||||
self.specfile.write_nvr()
|
|
||||||
expect = ["Name : pkg\n",
|
|
||||||
"Version : 1.0\n",
|
|
||||||
"Release : 2\n",
|
|
||||||
"URL : http://localhost/testpkg/pkg-1.0.tar.gz\n",
|
|
||||||
"Source0 : http://localhost/testpkg/pkg-1.0.tar.gz\n"]
|
|
||||||
self.assertEqual(expect, self.WRITES)
|
|
||||||
|
|
||||||
def test_write_sources(self):
|
def test_write_sources(self):
|
||||||
"""
|
"""
|
||||||
test write_sources with all Specfile.sources set.
|
test write_sources with all Specfile.sources set.
|
||||||
|
|||||||
+68
-1
@@ -2,7 +2,8 @@ import subprocess
|
|||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
import unittest.mock
|
from unittest.mock import MagicMock, mock_open, patch
|
||||||
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
|
|
||||||
@@ -64,5 +65,71 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertTrue(util.binary_in_path('testbin'))
|
self.assertTrue(util.binary_in_path('testbin'))
|
||||||
self.assertEqual(util.os_paths, [tmpd])
|
self.assertEqual(util.os_paths, [tmpd])
|
||||||
|
|
||||||
|
def test__process_build_log_bad_patch(self):
|
||||||
|
"""
|
||||||
|
Test _process_build_log with a bad patch
|
||||||
|
"""
|
||||||
|
def isfile_mock(_):
|
||||||
|
return True
|
||||||
|
isfile_backup = util.os.path.isfile
|
||||||
|
util.os.path.isfile = isfile_mock
|
||||||
|
call_backup = util.call
|
||||||
|
util.call = MagicMock()
|
||||||
|
open_name = 'util.open_auto'
|
||||||
|
content = "Patch #1 (bad.patch):\nHunk #1 FAILED at 1."
|
||||||
|
m_open = mock_open(read_data=content)
|
||||||
|
with patch(open_name, m_open, create=True):
|
||||||
|
util._process_build_log('filename')
|
||||||
|
|
||||||
|
util.os.path.isfile = isfile_backup
|
||||||
|
mock_call = util.call
|
||||||
|
util.call = call_backup
|
||||||
|
self.assertTrue(len(mock_call.mock_calls) == 3)
|
||||||
|
|
||||||
|
def test_globlike_match(self):
|
||||||
|
"""
|
||||||
|
Test globlike_match
|
||||||
|
"""
|
||||||
|
match_name = ['a', 'b', 'c']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'c']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'bb*']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'b*']
|
||||||
|
file_path = 'a/ab'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', '*a']
|
||||||
|
file_path = 'a/ab'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'c*']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', '*c']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertFalse(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'b*']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertTrue(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', '*b']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertTrue(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
match_name = ['a', 'b']
|
||||||
|
file_path = 'a/b'
|
||||||
|
self.assertTrue(util.globlike_match(file_path, match_name))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main(buffer=True)
|
unittest.main(buffer=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user