cos-kernel: Handle patches which contain renames

If a patch renames a file, the output format in the logs of the patch
command is:

checking patch <x> (renamed from <y>)

This would break the logic for collecting the list of files modified by
a patch since the " (renamed from <y>)" part would get included in the
file name passed to `git add`. Fix this by splitting the line and
collecting the new and old file names.

TEST=`cos-kernel prepare --patches=irdma` for the main-R129-cos-6.12
kernel (failed before, passes now)
BUG=b/527927014

Change-Id: I6cfe938f2d9536f1f51b05f34d2e70feab97f764
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/185386
Cloud-Build: 228075978874@cloudbuild.gserviceaccount.com <228075978874@cloudbuild.gserviceaccount.com>
Reviewed-by: Derek Taylor <ddtaylor@google.com>
Tested-by: Kevin Berry <kpberry@google.com>
1 file changed
tree: 6b2080ce84533540ff6a9f5470cdabe61cc50c83
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. vendor/
  6. .bazelignore
  7. .gitignore
  8. BUILD.bazel
  9. cloudbuild.yaml
  10. CONTRIBUTING.md
  11. deps.bzl
  12. go.mod
  13. go.sum
  14. LICENSE
  15. postsubmit-cloudbuild.yaml
  16. README.md
  17. run_builds.sh
  18. run_unit_tests.sh
  19. WORKSPACE
README.md

Tools for Container-Optimized OS

This is a repository of various tools developed for Container-Optimized OS. Examples include cos-gpu-installer, cos-toolbox, etc.

See CONTRIBUTING.md for how to contribute.