diff options
Diffstat (limited to 'bibisect_build.py')
-rwxr-xr-x | bibisect_build.py | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/bibisect_build.py b/bibisect_build.py index 7d4b82e..892ca08 100755 --- a/bibisect_build.py +++ b/bibisect_build.py @@ -34,18 +34,17 @@ target = "/mnt/data/lo/bibisect-repos/bibisect-master" # whether we should push each bibisect commit to a bare repo. push_to_bare = True # location of the git bare repo to be pushed to. -target_bare = "/mnt/data/git/lo/bibisect-linux64-master-200117-current" +target_bare = "/mnt/data/git/lo/bibisect-linux-64-7.0-CN" # dir in which the log files to be saved log_dir = "/mnt/data/lo/bibisect_tool/log" - # The range of source commits to be built. # You do not need to change "start_commit" in each run of this script. # Commits whcih are already included in the "target" will be automatically ignored. -# 2020-02-19-110640: 2020-02-19 - Fold chapter strings in to one pluralized string -start_commit = "791aeac1e492d3f3b6c99fa480226c0b2cc4f7d6" +# 2020-02-21 12:17:32 +0100 tdf#130517 improve accelerators on Print dialog page +start_commit = "5c3604542191b3c69da2d9d912c5c5a20c7143e9" # master to_commit = "master" @@ -55,7 +54,7 @@ to_commit = "master" # These are usually source commits which have no impact on our bibisect result, # such as update git submodules, unit tests / UI tests etc.. # It is a waste of time to build these commits. -ingore_list_file = "/mnt/data/lo/bibisect_tool/ingore_list.txt" +igore_list_file = "/mnt/data/lo/bibisect_tool/igore_list.txt" # For the first run, we will initiate a git repo, # so you need to put your user name and email here: @@ -124,6 +123,7 @@ def generate_range_list(range_text): "Fix typo", "pragma once", "executable permission",] + ignore_list = generate_ignore_list(igore_list_file) for range_item in range_list: commit_date, commit_time, commit_zone, commit_hash, commit_msg = \ range_item.split(b" ", maxsplit=4) @@ -131,14 +131,25 @@ def generate_range_list(range_text): commit_date.decode(), commit_time.decode(), commit_zone.decode(), \ commit_hash.decode(), commit_msg.decode() ignore = False + # Decide ignore based on commit message for ignore_msg in ignore_msgs: if ignore_msg.upper() in commit_msg.upper(): ignore = True break + # Also ignore if the commit is in the ignore_list_file + if commit_hash[:12] in ignore_list: + ignore = True + break if not ignore: commits.append([commit_date, commit_time, commit_zone, commit_hash, commit_msg]) - return commits + # One build for each "step" source commits + commits_to_be_build = commits[::step] + # Always include the last commit in the build. + if commits_to_be_build[-1] != commits[-1]: + commits_to_be_build.append(commits[-1]) + + return commits_to_be_build def commit_in_target(hash_str, target): """ @@ -161,27 +172,15 @@ def commit_in_target(hash_str, target): else: return False -def generate_ingnore_list(ingore_list_file): - """Return a list of source commits to be ingored before build +def generate_ignore_list(igore_list_file): + """Return a list of source commits to be igored before build """ - with open(ingore_list_file) as f: + with open(igore_list_file) as f: content = f.read().strip().split("\n") - ingore_list = [i[:12] for i in content] + igore_list = [i[:12] for i in content] - return ingore_list - -def exclude_ignore(commits): - ret = [] - ignore_list = generate_ingnore_list(ingore_list_file) - for i in range(0,len(commits)): - if commits[i][3][:12] not in ignore_list: - ret.append(commits[i]) - else: - pass - - return ret - + return igore_list if __name__ == "__main__": @@ -196,9 +195,11 @@ if __name__ == "__main__": if rc != 0: raise Exception(stderr) range_text = stdout.strip() - commits = generate_range_list(range_text) + commits_to_be_built = generate_range_list(range_text) - if not commits: + if not commits_to_be_built: + print("No commits to be build, exiting...") + print(commits_to_be_built) exit(0) # Create target git repo if not exists. @@ -212,12 +213,6 @@ if __name__ == "__main__": run_process(cmd) cmd = f"git -C {repr(target)} config user.email {repr(git_email)}" run_process(cmd) - - commits_to_be_built = exclude_ignore(commits) - commits_to_be_built = commits_to_be_built[::step] - # always include the last commit - if commits_to_be_built[-1] != commits[-1]: - commits_to_be_built.append(commits[-1]) i = 0 fail_count = 0 @@ -225,11 +220,11 @@ if __name__ == "__main__": i += 1 commit_date, commit_time, commit_zone, commit_hash, commit_msg = commit - # Rescan the ignore list for each commit to be built - # new ignores can be added to the list at any time. - ignore_list = generate_ingnore_list(ingore_list_file) - if commit[:12] in ignore_list: - print(f"{commit} newly detected in ignore list, pass.") + # Rescan the ignore list for each commit to be built. + # New ignores can be added to the list at any time. + ignore_list = generate_ignore_list(igore_list_file) + if commit_hash[:12] in ignore_list: + print(f"{commit_hash} newly detected in ignore list, pass.") continue if commit_in_target(commit_hash, target): |