Lines Matching refs:op
231 def _ApplyReplaceOperation(self, op, op_name, out_data, part_file, part_size): argument
248 if op.type == common.OpType.REPLACE_BZ:
251 elif op.type == common.OpType.REPLACE_XZ:
258 for ex, ex_name in common.ExtentIter(op.dst_extents,
294 def _ApplyZeroOperation(self, op, op_name, part_file): argument
310 for ex, ex_name in common.ExtentIter(op.dst_extents, base_name):
314 def _ApplySourceCopyOperation(self, op, op_name, old_part_file, argument
330 (op_name, op.type))
335 in_data = _ReadExtents(old_part_file, op.src_extents, block_size)
338 _WriteExtents(new_part_file, in_data, op.dst_extents, block_size,
358 def _ApplyDiffOperation(self, op, op_name, patch_data, old_part_file, argument
375 (op_name, op.type))
389 op.src_extents, block_size, '%s.src_extents' % op_name,
390 data_length=op.src_length if op.src_length else
391 self._BytesInExtents(op.src_extents, "%s.src_extents"))
393 op.dst_extents, block_size, '%s.dst_extents' % op_name,
394 data_length=op.dst_length if op.dst_length else
395 self._BytesInExtents(op.dst_extents, "%s.dst_extents"))
409 if op.type in (common.OpType.SOURCE_BSDIFF, common.OpType.BROTLI_BSDIFF):
414 elif op.type == common.OpType.PUFFDIFF:
425 raise PayloadError("Unknown operation %s" % op.type)
434 in_data = _ReadExtents(input_part_file, op.src_extents, block_size,
435 max_length=op.src_length if op.src_length else
436 self._BytesInExtents(op.src_extents,
446 if op.type in (common.OpType.SOURCE_BSDIFF, common.OpType.BROTLI_BSDIFF):
451 elif op.type == common.OpType.PUFFDIFF:
460 raise PayloadError("Unknown operation %s" % op.type)
465 if len(out_data) != op.dst_length:
468 (op_name, len(out_data), op.dst_length))
474 _WriteExtents(new_part_file, out_data, op.dst_extents, block_size,
498 for op, op_name in common.OperationIter(operations, base_name):
500 data = self.payload.ReadDataBlob(op.data_offset, op.data_length)
502 if op.type in (common.OpType.REPLACE, common.OpType.REPLACE_BZ,
504 self._ApplyReplaceOperation(op, op_name, data, new_part_file, part_size)
505 elif op.type == common.OpType.ZERO:
506 self._ApplyZeroOperation(op, op_name, new_part_file)
507 elif op.type == common.OpType.SOURCE_COPY:
508 self._ApplySourceCopyOperation(op, op_name, old_part_file,
510 elif op.type in (common.OpType.SOURCE_BSDIFF, common.OpType.PUFFDIFF,
512 self._ApplyDiffOperation(op, op_name, data, old_part_file,
516 (op_name, op.type))