+ for slot in self.slots:
+ boards += slot.get_suspicious_boards()
+
+ if boards:
+ boards = '\n'.join(boards) + '\n'
+ msg = "The following boards might have been converted incorrectly.\n"
+ msg += "It is highly recommended to check them manually:\n"
+ msg += boards
+ msg += "(the list has been saved in %s)\n" % output_file
+ print >> sys.stderr, color_text(self.options.color, COLOR_YELLOW,
+ msg)
+
+ with open(output_file, 'w') as f:
+ f.write(boards)
+
+class ReferenceSource:
+
+ """Reference source against which original configs should be parsed."""
+
+ def __init__(self, commit):
+ """Create a reference source directory based on a specified commit.
+
+ Arguments:
+ commit: commit to git-clone
+ """
+ self.src_dir = tempfile.mkdtemp()
+ print "Cloning git repo to a separate work directory..."
+ subprocess.check_output(['git', 'clone', os.getcwd(), '.'],
+ cwd=self.src_dir)
+ print "Checkout '%s' to build the original autoconf.mk." % \
+ subprocess.check_output(['git', 'rev-parse', '--short', commit]).strip()
+ subprocess.check_output(['git', 'checkout', commit],
+ stderr=subprocess.STDOUT, cwd=self.src_dir)