mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[upstream_utils] Use "git am" instead of "git apply" for patches (#4248)
This creates actual commits in the thirdparty repo, which makes rebasing them onto new versions much easier.
This commit is contained in:
@@ -3,13 +3,18 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if, apply_patches
|
||||
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if, am_patches
|
||||
|
||||
|
||||
def main():
|
||||
root, repo = setup_upstream_repo("https://github.com/fmtlib/fmt", "8.1.1")
|
||||
wpiutil = os.path.join(root, "wpiutil")
|
||||
|
||||
# Apply patches to original git repo
|
||||
prefix = os.path.join(root, "upstream_utils/fmt_patches")
|
||||
am_patches(
|
||||
repo, [os.path.join(prefix, "0001-Don-t-throw-on-write-failure.patch")])
|
||||
|
||||
# Delete old install
|
||||
for d in ["src/main/native/fmtlib/src", "src/main/native/fmtlib/include"]:
|
||||
shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True)
|
||||
@@ -31,9 +36,6 @@ def main():
|
||||
comment_out_invalid_includes(
|
||||
f, [os.path.join(wpiutil, "src/main/native/fmtlib/include")])
|
||||
|
||||
apply_patches(root,
|
||||
["upstream_utils/fmt-dont-throw-on-write-failure.patch"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user