diff --git a/autospec/git.py b/autospec/git.py index 7c54068c..dfe3933d 100644 --- a/autospec/git.py +++ b/autospec/git.py @@ -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 options.conf", 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 description", check=False, stderr=subprocess.DEVNULL, cwd=path) call("git add attrs", check=False, stderr=subprocess.DEVNULL, cwd=path) diff --git a/autospec/logcheck.py b/autospec/logcheck.py index f0dadda1..7cec8d34 100644 --- a/autospec/logcheck.py +++ b/autospec/logcheck.py @@ -18,10 +18,25 @@ import os import re +import sys 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): """Try to discover configuration options that were automatically switched off.""" log = os.path.join(pkg_loc, 'results', 'build.log') @@ -52,7 +67,12 @@ def logcheck(pkg_loc): pat = re.compile(r"^checking (?:for )?(.*?)\.\.\. no") 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 m = pat.search(line) if m: @@ -70,8 +90,8 @@ def logcheck(pkg_loc): if match in blacklist: print_fatal("Blacklisted configure-miss is forbidden: " + match) misses.append("Blacklisted configure-miss is forbidden: " + match) - write_misses(pkg_loc, misses) - exit(1) + write_log(pkg_loc, 'configure_misses', misses) + sys.exit(1) print("Configure miss: " + match) misses.append("Configure miss: " + match) @@ -79,9 +99,9 @@ def logcheck(pkg_loc): if not misses: return - write_misses(pkg_loc, misses) + write_log(pkg_loc, 'configure_misses', misses) -def write_misses(pkg_loc, misses): - """Create configure_misses file with automatically disabled configuration options.""" - write_out(os.path.join(pkg_loc, 'configure_misses'), '\n'.join(sorted(misses))) +def write_log(pkg_loc, fname, content): + """Create log file with content.""" + write_out(os.path.join(pkg_loc, fname), '\n'.join(sorted(content)))