0

I need to generate delta by comparing two binary files using VCdiff. Can I apply the generated patch file to the node using BSpatch? I know that BSpatch is used for applying patch files generated by BSdiff but is there any provision that BSpatch can be used for applying the patch files generated by VCdiff

dsrr
  • 1
  • 1

1 Answers1

0

No, it is impossible. As well as bspatch wouldn't perform insertion of delta file created by rtpatch or zdelta solution.All these mechanisms are using different algorithms. Moreover BSDIFF4 solution also adds string "BSDIFF40" to created patch file.

But still you may try to check:

$ echo 1 > first 
$ echo 2 > second
$ bsdiff first second bs_delta
$ vcdiff encode -dictionary first < second > vc_delta
$ xxd vc_delta > vc_delta_hex
$ xxd bs_delta > bs_delta_hex
$ diff vc_delta_hex bs_delta_hex 

The result is:

1,2c1,8

< 0000000: d6c3 c400 0001 0200 0802 0002 0100 320a  ..............2.
< 0000010: 03                                     .
---
> 0000000: 4253 4449 4646 3430 2a00 0000 0000 0000  BSDIFF40*.......
> 0000010: 0e00 0000 0000 0000 0200 0000 0000 0000  ................
> 0000020: 425a 6839 3141 5926 5359 009d 217b 0000  BZh91AY&SY..!{..
> 0000030: 0140 007c 0020 0021 9a01 9a02 5ad2 347c  .@.|. .!....Z.4|
> 0000040: 5dc9 14e1 4240 0274 85ec 425a 6839 1772  ]...B@.t..BZh9.r
> 0000050: 4538 5090 0000 0000 425a 6839 3141 5926  E8P.....BZh91AY&
> 0000060: 5359 40c2 7e6e 0000 00c8 0000 1010 0020  SY@.~n......... 
> 0000070: 0021 0082 b177 2453 8509 040c 27e6 e0    .!...w$S....'..

As you see the files are completely different, even though the input file for delta creation are the same.