[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main
 parent


How to use xdelta?
by xdelta on Wednesday 05/Nov/2003, @06:17
How to use xdelta?
  Related Links
 ·   Articles on KDE Official News
 ·   Also by xdelta
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

Re: How to use xdelta?
by Anonymous on Wednesday 05/Nov/2003, @20:15
man xdelta
[ Reply To This | View ]
Re: How to use xdelta? -- Don't Bother!
by howto-waste your time on Wednesday 08/Dec/2004, @11:55
bash-2.05b$ xdelta
bash: xdelta: command not found
...

bash-2.05b$ xdelta3 --help
VERSION=3_PRERFC_0
usage: xdelta3 [command/options] [input [output]]
commands are:
encode encodes the input
decode decodes the input
config prints xdelta3 configuration
test run the builtin tests
special commands for VCDIFF inputs:
printhdr print information about the first window
printhdrs print information about all windows
printdelta print information about the entire delta
options are:
-c use stdout instead of default
-d same as decode command
-e same as encode command
-f force overwrite
-n disable checksum (encode/decode)
-D disable external decompression (encode/decode)
-R disable external recompression (decode)
-N disable small string-matching compression
-S [djw|fgk] disable/enable secondary compression
-A [apphead] disable/provide application header
-s source source file to copy from (if any)
-B blksize source file block size
-W winsize input window buffer size
-v be verbose (max 2)
-q be quiet
-h show help
-V show version
-P repeat count (for profiling)

....

bash-2.05b$ xdelta3 -d kdelibs-3.3.1-3.3.2.tar.xdelta
xdelta3: not a VCDIFF input: Invalid argument

....
bash-2.05b$ xdelta3 -d -s kdelibs-3.3.1-3.3.2.tar.xdelta
[silence]
^C
...
bash-2.05b$ xdelta3 -d <kdelibs-3.3.1-3.3.2.tar.xdelta
xdelta3: not a VCDIFF input: Invalid argument
...
bash-2.05b$ rm kdelibs-3.3.1-3.3.2.tar.xdelta
[ Reply To This | View ]
  • Re: How to use xdelta? -- Don't Bother!
    by Anonymous on Wednesday 08/Dec/2004, @12:19
    > bash: xdelta: command not found

    How about installing it then? :-)

    > bash-2.05b$ xdelta3 --help

    xdelta3 is incompatible to xdelta2 is incompatible to xdelta.

    > bash-2.05b$ rm kdelibs-3.3.1-3.3.2.tar.xdelta

    Thanks for proving your dumbness.
    [ Reply To This | View ]
    • Re: How to use xdelta? -- Don't Bother!
      by Joshua Rodman on Friday 04/Feb/2005, @06:13
      In all fairness, xdelta is a bit tricky to use. I've been wrestling with it for the last few hours trying to figure out exactly what sorts of things 'encode' and 'decode' are supposed to work well on. The only case where it beats the size of gzip is when I cat a file A to file B eight times, and inflate the input window to 100times the normal size.

      In this case clearly it was a diff meant to be applied to the tar file, but bafflingly, that's not the default mode for xdelta3.

      Further the incompatabilities bewteen xdelta 1 2 and 3 are kind of confusing, since one is self contained, one is a library, and one is a front end, and the docs are thin on the ground.
      [ Reply To This | View ]
      • Re: How to use xdelta? -- Don't Bother!
        by Josh MacDonald on Thursday 28/Sep/2006, @01:27
        I promise xdelta3 will support xdelta1 inputs, one day soon. I tried to make the command-line syntax of xdelta3 as close to gzip/bzip2 as I could, which meant breaking compatibility with previous versions. xdelta2 was never finished, and it was a storage system, not an application or a library&mdash;as you say.
        [ Reply To This | View ]
        • Re: How to use xdelta? -- Don't Bother!
          by Aaron Peterson on Sunday 23/Mar/2008, @22:34
          So.. how do I use it?

          aaron@Speck /cygdrive/c/ZZ_ISO
          $ ./xdelta3.0t.x86-32.exe -d KDE-Four-Live.i686-1.0.1-1.0.2.iso.xdelta KDE-Four
          -Live.i686-1.0.1.iso
          xdelta3: not a VCDIFF input: XD3_INVALID_INPUT
          [ Reply To This | View ]
          • Re: How to use xdelta? -- Don't Bother!
            by Anonymous on Monday 24/Mar/2008, @02:53
            As said earlier, xdelta3 is incompatible to xdelta1 diffs.
            [ Reply To This | View ]
Re: How to use xdelta?
by sponix2ipfw on Monday 05/Sep/2005, @16:25
Here goes nothing.. I don't have my box right in front of me to check against, but I am going to do my best to give a working example of what I did to upgrade from kde-3.4.0 to kde-3.4.1 with xdelta files

The tricky part (what took me forever to figure out) was it was looking to apply the *.xdelta patches against the tarBalls (.tar files) not the source dir's, or the tar.bz2 files... (found this out by actually doing a vim (edit) on the xdelta file itself and it shows the name of the file it expects to patch against)

So, something like this...
for i in *.tar.bz2;do bunzip2 -v $i;done
will take the bz2 off and leave you with a bunch of tarBalls
doing an ls on the dir should give you filenames like:
kdebase-3.4.0.tar
kdelibs-3.4.0.tar
and so on

and then for i in *.xdelta;do xdelta patch $i;done
will apply all the xdelta files

one by one it would be:
xdelta patch kdebase-3.4.0-3.4.1.xdelta
and it should patch against your kdebase-3.4.0.tar file
and the file it will spit out should be named kdebase-3.4.1.tar

One more thing.. I've you've played with the sources already (built them and then repacked them) the odds are its checksum will fail (mine did). So try to work with tarBalls you haven't tinkered with yet.

I've never seen such crazy stuff before, so I ended up logging a couple hours a day, for close to a week tinkering before I stumbled on it. When the man page says it patches from one file to another you just never expect it to be a plain .tar file with no compression *Grin*.

If this helps you, or you still need help, feel free to spam me at sponix2ipfw@hotmail.com I get plenty of viagra mail there anyway, a little Linux question might brighten my day...
[ Reply To This | View ]
  • Re: How to use xdelta?
    by Nicolas Goutte on Tuesday 06/Sep/2005, @07:59
    The answer why not .tar.bz2 is simple: try to xdelta a bzi2-ed file. You will see that the xdelta file is huge. (The problem, which is not xdelta specific) is that already for a (uncompressed) changed bit, you can have very different compression streams.)

    So you can use xdelta only on uncompressed tar files.

    Have a nice day!
    [ Reply To This | View ]
    • Re: How to use xdelta?
      by Josh MacDonald on Thursday 28/Sep/2006, @01:23
      Actually, xdelta3 implements specific "external compression" routines, so that it recognizes compressed inputs and decompresses them to temporary files. This appears somewhere in the code:

      { "xdelta3", "-cfq", "xdelta3", "-dcfq", "X", "\xd6\xc3\xc4", 3, RD_NONEXTERNAL },
      { XDELTA1PATH,"delta", XDELTA1PATH, "patch", "1", "%XD", 3, 0 },
      { "bzip2", "-cf", "bzip2", "-dcf", "B", "BZh", 3, 0 },
      { "gzip", "-cf", "gzip", "-dcf", "G", "\037\213", 2, 0 },
      { "compress", "-cf", "uncompress", "-cf", "Z", "\037\235", 2, 0 },
      [ Reply To This | View ]
Re: How to use xdelta?
by Josh MacDonald on Wednesday 27/Sep/2006, @21:39
Like gzip with the additional -s SOURCE. Like gzip, -d means to decompress, and the default is to compress. For output, -c and -f flags behave likewise. Unlike gzip, xdelta3 defaults to stdout (instead of having an automatic extension). Without -s SOURCE, xdelta3 behaves like gzip for stdin/stdout purposes.

Compress examples:

xdelta3 -s SOURCE TARGET > OUT
xdelta3 -s SOURCE TARGET OUT
xdelta3 -s SOURCE < TARGET > OUT

Decompress examples:

xdelta3 -d -s SOURCE OUT > TARGET
xdelta3 -d -s SOURCE OUT TARGET
xdelta3 -d -s SOURCE < OUT > TARGET
[ Reply To This | View ]
Re: How to use xdelta?
by Chiv on Friday 13/Oct/2006, @09:31
Can someone point out what i could be doing wrong here... or why my checksums are not matching? I'm assuming it has to do with the fact that I'm dealing with gzip's... but i'm really not sure.

Example (for demo purposes):

[newinstall /tmp]# ls -l *.tgz
-rw-r--r-- 1 root root 2116253 Oct 12 17:06 sb-11.tgz
-rw-r--r-- 1 root root 4230637 Oct 13 12:53 sb-12.tgz

xdelta3 -s sb-11.tgz sb-12.tgz sb.xd

Now i will rename sb-12.tgz to sb-12.tgz.orig.... and restore it with
xdelta3 -d sb.xd

Now i have:

-rw-r--r-- 1 root root 2116253 Oct 12 17:06 sb-11.tgz
-rw-r--r-- 1 root root 4230637 Oct 13 13:16 sb-12.tgz
-rw-r--r-- 1 root root 4230637 Oct 13 12:53 sb-12.tgz.orig
-rw-r--r-- 1 root root 2083135 Oct 13 13:15 sb.xd

sb-12.tgz and sb-12.tgz.orig are the same number of bytes.. butttttt:

[newinstall /tmp]# md5sum sb-12.tgz sb-12.tgz.orig
d6fd1878fe4a941169d0f4b9e0d67909 sb-12.tgz
310b8c0a6bc6d8d5879ea9fea907eb12 sb-12.tgz.orig

Ultimately the delta will be transfered via xml-rpc for largescale remote backup purposes so matching checksums on either end are important... what am I doing wrong.

If it helps here's the output from xdelta3 config:

VERSION=3_PRERFC_0
VCDIFF_TOOLS=1
REGRESSION_TEST=1
SECONDARY_FGK=0
SECONDARY_DJW=1
GENERIC_ENCODE_TABLES=1
GENERIC_ENCODE_TABLES_COMPUTE=0
EXTERNAL_COMPRESSION=1
XD3_POSIX=1
XD3_DEBUG=2
XD3_USE_LARGEFILE64=1
XD3_ENCODER=1
XD3_DEFAULT_WINSIZE=262144
XD3_DEFAULT_SRCBLKSZ=262144
XD3_DEFAULT_SRCWINSZ=8388608
XD3_DEFAULT_MEMSIZE=262144
XD3_ALLOCSIZE=8192
XD3_HARDMAXWINSIZE=8388608
XD3_NODECOMPRESSSIZE=16777216
XD3_DEFAULT_IOPT_SIZE=
[ Reply To This | View ]
Re: How to use xdelta?
by Martin on Thursday 26/Jul/2007, @09:49
xdelta 3 is very confusing compared to xdelta(1)

All I want to do is create a binary diff of 2 files???
[ Reply To This | View ]
The Fine Print: The previous comments are owned by whomever posted them.
( Reply )

  "I'd like to turn all users into developers." -- Ralf Nolden
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]