Skip to content

Commit

Permalink
allow destination dir #10451
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Oct 2, 2023
1 parent fa88f52 commit fd749c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/build/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -55,26 +56,25 @@
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 "):
h = line.split()[1]
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
os.chdir("build/cmake-build")
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()
Expand Down

0 comments on commit fd749c9

Please sign in to comment.