2 from changes import Changes
4 # assumes that the new/current and older distributions are unzipped in /tmp/distro_new and
5 # /tmp_distro_old respectively
8 class DistCompare(object):
9 def __init__(self, remote_url):
11 self.remote_url = remote_url
14 def get_project_names():
15 # TODO: when autorelease starts publishing the dependencies.log artifact, this function (or the consumer
16 # of this tool) can take the latest dependencies.log from jenkins lastSuccessfulArtifacts and put it
17 # in /tmp/ For now the functionality to read the projects from that file are commented.
20 with open("/tmp/dependencies.log") as dep_file:
23 projects.append(line.split(":")[0])
27 # this hard coded list of projects was taken from Oxygen dependencies.log - late January 2018
29 "integration/distribution",
68 project_names = self.get_project_names()
69 extracted_distro_locations = {
70 "new": "/tmp/distro_new",
71 "old": "/tmp/distro_old",
74 new_changes = Changes(
76 extracted_distro_locations["new"],
83 new_projects = new_changes.run_cmd()
84 new_changes.pretty_print_projects(new_projects)
86 old_changes = Changes(
88 extracted_distro_locations["old"],
95 old_projects = old_changes.run_cmd()
96 old_changes.pretty_print_projects(old_projects)
99 print("\nPatch differences:\n------------------")
100 for project_name, values in new_projects.items():
101 new_gerrits = values["includes"]
102 for gerrit in new_gerrits:
103 if gerrit not in old_projects[project_name]["includes"]:
104 patchset_diff.append(gerrit)
106 "{:<20}{}\t{}".format(
107 project_name, gerrit["url"], gerrit["subject"]
111 print("\n%s different patches between the two distros." % len(patchset_diff))
116 parser = argparse.ArgumentParser(
117 description="Returns the list of patches found in the unzipped distribution at "
118 "/tmp/distro_new that are not found in the distribution at "
119 "/tmp/distro_old. This should result in a listing of what new changes "
120 "were made between the two distributions."
126 default=Changes.REMOTE_URL,
127 help="git remote url to use for gerrit",
129 options = parser.parse_args()
131 distc = DistCompare(options.remote_url)
135 if __name__ == "__main__":