paycheck: allow to pass an explicit path to bspatch

The bspatch binary is used when applying update payloads. By default, we
were using whatever bspatch that was found via path expansion in
os.execvp, however there are cases where we want to be specific about
where the bspatch binary is that we need to be using (such as during
paygen runs).

BUG=chromium:277072
TEST=Non-default bspatch binary used

Change-Id: I85ffd28aeb26938cbf5ea428fa97d29af0353a7d
Reviewed-on: https://gerrit.chromium.org/gerrit/66736
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/scripts/update_payload/payload.py b/scripts/update_payload/payload.py
index 0bac091..b13aa11 100644
--- a/scripts/update_payload/payload.py
+++ b/scripts/update_payload/payload.py
@@ -232,7 +232,7 @@
                report_out_file=report_out_file)
 
   def Apply(self, new_kernel_part, new_rootfs_part, old_kernel_part=None,
-            old_rootfs_part=None, bsdiff_in_place=True,
+            old_rootfs_part=None, bsdiff_in_place=True, bspatch_path=None,
             truncate_to_expected_size=True):
     """Applies the update payload.
 
@@ -242,6 +242,7 @@
       old_kernel_part: name of source kernel partition file (optional)
       old_rootfs_part: name of source rootfs partition file (optional)
       bsdiff_in_place: whether to perform BSDIFF operations in-place (optional)
+      bspatch_path: path to the bspatch binary (optional)
       truncate_to_expected_size: whether to truncate the resulting partitions
                                  to their expected sizes, as specified in the
                                  payload (optional)
@@ -253,7 +254,7 @@
 
     # Create a short-lived payload applier object and run it.
     helper = applier.PayloadApplier(
-        self, bsdiff_in_place=bsdiff_in_place,
+        self, bsdiff_in_place=bsdiff_in_place, bspatch_path=bspatch_path,
         truncate_to_expected_size=truncate_to_expected_size)
     helper.Run(new_kernel_part, new_rootfs_part,
                old_kernel_part=old_kernel_part,