diff --git a/tools/build/history.py b/tools/build/history.py index 73235f2d7bdf..fa1737221a46 100755 --- a/tools/build/history.py +++ b/tools/build/history.py @@ -34,6 +34,7 @@ arg_parser = sumolib.options.ArgumentParser() arg_parser.add_argument("-b", "--begin", default="v1_3_0", help="first revision to build") arg_parser.add_argument("-e", "--end", default="HEAD", help="last revision to build") +arg_parser.add_argument("-d", "--destination", default="..", help="where to put build results") arg_parser.add_argument("-t", "--tags-only", action="store_true", default=False, help="only build tagged revisions") options = arg_parser.parse_args() @@ -55,7 +56,6 @@ commits[tag] = tag if tag == options.end: active = False - print(commits) else: for line in subprocess.check_output(["git", "log", "%s..%s" % (options.begin, options.end)]).splitlines(): if line.startswith("commit "): @@ -63,7 +63,8 @@ commits[h] = sumolib.version.gitDescribe(h) haveBuild = False for h, desc in sorted(commits.items(), key=lambda x: x[1]): - if not os.path.exists('../bin%s' % desc): + dest = os.path.join(options.destination, 'bin%s' % desc) + if not os.path.exists(dest): ret = subprocess.call(["git", "checkout", "-q", h]) if ret != 0: continue @@ -71,10 +72,9 @@ subprocess.call('make clean; make -j32', shell=True) os.chdir("../..") haveBuild = True - shutil.copytree('bin', '../bin%s' % desc, - ignore=shutil.ignore_patterns('Makefile*', '*.bat', '*.jar')) - subprocess.call('strip -R .note.gnu.build-id ../bin%s/*' % desc, shell=True) - subprocess.call("sed -i 's/%s/%s/' ../bin%s/*" % (desc, len(desc) * "0", desc), shell=True) + shutil.copytree('bin', dest, ignore=shutil.ignore_patterns('Makefile*', '*.bat', '*.jar')) + subprocess.call('strip -R .note.gnu.build-id %s/*' % dest, shell=True) + subprocess.call("sed -i 's/%s/%s/' %s" % (desc, len(desc) * "0", dest), shell=True) if haveBuild: for line in subprocess.check_output('fdupes -1 -q ../binv*', shell=True).splitlines(): dups = line.split()