
---------------------
 deltarpm suite V2.2
---------------------

A) Programs

    prepdeltarpm [-f] [-x excludelist] [-s seqfile] [-i infofile] old.rpm

    prepdeltarpm [-f] [-x excludelist] [-s seqfile] [-i infofile] -p old.rpml old.patch.rpm old.rpm

    Extracts the usable files (i.e. no config files) from old.rpm and
    writes them as cpio archive to stdout.

    Options:
      -f: create full cpio archive, identical to rpm2cpio
	  (does not work with other options)
      -x: exclude files read from the filelist
      -s: write sequence info into file (usefull for creating
	  yast patchfiles)
      -i: write deltarpm info into file, needed for writedeltarpm
      -p: enable patchrpm support, in that case two more args are
	  needed, the rpml of the last version and the patch.rpm
	  of the last version.


    writedeltarpm new.rpm xdeltafile info new.delta.rpm

    Create a delta rpm from the new rpm, the xdelta file between
    the old and the new rpm and the info file. The xdeltafile must
    be uncompressed, i.e. created with "-0".


    applydeltarpm [-v] [-p] [-c] [-C] [-r old.rpm] new.delta.rpm new.rpm
    applydeltarpm [-c] -s seq

    Reconstruct new.rpm from the delta rpm. May run in filesystem mode
    or in rpm mode.

    Options:
      -v: verbose mode, print statistics
      -p: print percent completed (use -p -p for parsable output)
      -c: just check if the rpm can be reconstructed
      -C: fast check, don't verify md5 sums of the used files
      -r: reconstruct from the specified rpm, not from filesystem
          data
      -s: check if rpm can be reconstructed based on sequence info


B) How to create a delta rpm

   Given old.rpm new.rpm, do

   prepdeltarpm -s seq -i info old.rpm > old.cpio
   prepdeltarpm -f new.rpm > new.cpio

   xdelta delta -0 old.cpio new.cpio delta
   *or*
   bsdiff old.cpio new.cpio delta

   writedeltarpm new.rpm delta info new.delta.rpm
   rm old.cpio new.cpio delta

C) License
   delta.c is distributed under the BSD Protection License, see
   LICENSE.BSDPL for details. All other files are distributed under
   BSD license, see LICENSE.BSD.

D) delta.rpm file format

   -----------------
   96 bytes rpm lead
   -----------------
    x bytes rpm signature header 
   -----------------
    x bytes rpm header 
            (the is an exact copy of the header of new.rpm, the
             only difference is that the PAYLOADFORMAT is patched
             to "drpm")
   -----------------
   -----------------
[[   the rest of the deltarpm is compressed with bzip2, like a
     normal rpm   ]]
   -----------------
   -----------------
    4 bytes id: "DLT1" (V2: "DLT2")
   -----------------
    4 bytes nevr length
    x bytes nevr (name-epoch:version-release)
   -----------------
    4 bytes seqlength
    x bytes sequence, containing
            16 bytes seq md5sum
            x bytes compressed seqence
            (the sequence defines which files get included from the rpm
             filelist in which order)
               
   -----------------
   16 bytes fullmd5, md5sum of the complete rpm
V2: 4 bytes fullsize, size of the complete rpm
V2: 4 bytes compression type
V2: 4 bytes compression parameter block len
V2: x bytes compression parameter block
   -----------------
    4 bytes leadlen
    x bytes lead     (lead/signatures of the new rpm)
   -----------------
    4 bytes payloadformatoffset
                     (used to change the format back to "cpio")
   -----------------
    4 bytes number of copies from internal data (inn)
    4 bytes number of copies from external data (outn)
    inn * 4 bytes number of external copies to do before internal copy
    inn * 4 bytes length of internal copy
    outn * 4 bytes offset adjustment of external copy
    outn * 4 bytes length of external copy
   -----------------
    4 bytes length of external data
   -----------------
    4 bytes length of add data
    x bytes add data, bzip2 compressed
   -----------------
    4 bytes length of internal data
    x bytes internal data

2005-03-16 mls
