DenVdmj / xdelta

Automatically exported from code.google.com/p/xdelta (actual: https://github.com/jmacd/xdelta-devel/)
0 stars 0 forks source link

xdelta corrupts files after re-apply of merged files #155

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

 Got 3 files
v1, v2, v3

1. Made v1 to v2 patch with:
-e -9 -v -s
2. Made v2 to v3 patch with:
-e -9 -v -s
3. Merged v1-v2 and v2-v3 patches with (in correct order, older 1st, newer 
last):
merge -v -m 
Got v1-v2-v3 patch file
4. Applied merged patch 1st time with (both to v1 files and v2 files in 2 
separate tests) with:
-d -v -s
Both v1 and v2 seems to be patched fine to v3
5. Applied merged patch 2nd time to already patched v3 files with same:
-d -v -s
Every file corrupted, and not just corrupted, it seems like half of file simply 
trimmed.

What is the expected output? What do you see instead?

 I expect XD to say something like "teh file already v3 or not v1 or v2, skipping it" and dont modify files.
Instead XD starts to patch (or not patch, im not sure what exactly XD does) 
file 1st, check second, stop patching and currupt file third.

What version of the product are you using? On what operating system?

 Any 32 bit XD 3.x.x up to 3.0.4, windows 7 64 bit

Please provide any additional information below.
 As i remember, this does not happen with single v1 to v2 or v2 to v3 patches, i can re-apply single patches many times and XD just skips them.

In my specific task thats is very "universal" there is no way to generate 
predefined list of checksums of all versions of files and no way to check them 
before even running Xdelta. In my case users may not be aware if their files 
already latest or not, directories could have mixed v1 v2 v3 files that all 
needs to updated to v3 (or whatever the latest version is), so running patch 
bundles should just update every older file and not touch latest.

Original issue reported on code.google.com by thevoodo...@gmail.com on 11 Jan 2013 at 3:56

GoogleCodeExporter commented 9 years ago
Xdelta can't do what you're expecting it to do in the general case. Also, I do 
not believe Xdelta will skip re-applied single patches.  Xdelta is written to 
read data from pipes, so it is not possible for it to compute checksums prior 
to computing the differences.  It would be possible to write a checksum at the 
end of the file, but then it would not be useful the way you're hoping it to be.

Maybe you could explain in more detail how you're using Xdelta, so I could 
offer some ideas?  I am going to recommend using checksums in the file name, 
I'm afraid.

Original comment by josh.mac...@gmail.com on 20 Jan 2013 at 5:53

GoogleCodeExporter commented 9 years ago
hello, i have almost the same problem. I make on xdelta3 a file who upgrade old 
one but after second applying file corrupted. On attach i got a screen, and 
here my command:
xdelta3.exe -d -v -f -s "BigFile_0005.big" "BigFile_0005 Patch file.vcdiff" 
"BigFile_0005new.big"

Original comment by kwase...@gmail.com on 26 Mar 2013 at 3:48

Attachments: