Add bpfmt step to bump.py

When we create next year's kernel configs with bump.py, we copy and
modify the previous Android.bp file.
Make sure it's properly formatted with bpfmt so the CL can uploaded
without manual changes.

Test before and after `rm out/host/linux-x86/bin/bpfmt`

Test: python tools/bump.py w x
Bug: 326134954

Change-Id: Ia1a631bcae915aeeb5218d1048270d64c3e9e2de
This commit is contained in:
Devin Moore 2024-05-08 19:48:20 +00:00
parent 7de932a4b9
commit 77bdbfd261

View file

@ -54,6 +54,11 @@ class Bump(object):
year = datetime.datetime.now().year
check_call("sed -i'' -E 's/Copyright \\(C\\) [0-9]{{4,}}/Copyright (C) {}/g' {}".format(year, abs_path), shell=True)
replace_configs_module_name(self.current_release, self.new_release, abs_path)
if os.path.basename(abs_path) == "Android.bp":
if shutil.which("bpfmt") is not None:
check_call("bpfmt -w {}".format(abs_path), shell=True)
else:
print("bpfmt is not available so {} is not being formatted. Try `m bpfmt` first".format(abs_path))
def main():
parser = argparse.ArgumentParser(description=__doc__)