[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IDEA to SERIOUSLY reduce download times!

On Fri, Jul 09, 1999 at 12:05:12PM +1000, Brian May was heard to say:
> Sounds like a good idea. Just one point though:

  [quotage of me snipped :-) ]

> I would seriously consider adding some sort of check (eg encode the
> MD5SUM of the orginal file somewhere) so that an error can be produced
> if the system operator altered the original file (something I have done
> from time to time). In this case, the system operator knows to download
> the full version, and not just the patched version.
> -- 
> Brian May <bam@snoopy.apana.org.au>

  Excellent thought.  This prompted me to look up something that I
remembered, and I was correct.  (whew! :) ) This is not (mostly) a problem,
thanks to xdelta.  From the xdelta man page...

       The patch subcommand has the following synopsis:

       xdelta patch [ option...  ] patch [ from [ to ]]

       Applies patch  to  from.   If  from  was  omitted,  XDelta
       attempts to use the file with the original from file name.
       The from file must be identical to the one used to  create
       the delta.  Its MD5 checksum is used to verify this condi­
       tion.  The constructed file will be written to  to  unless
       to  is  named  "-"  or  the original to file name if to is

  It looks like xdelta does something like this already, checking before it
patches that the file is correct.

  The one thing I'm unsure about is how this interacts with gzipped files (I
plan to test this :) ) -- xdelta has 'intelligent' handling of gzipped files,
meaning that it performs a patch on the contents rather than on the file
itself.  This gives better patches I suppose (I haven't personally tested it
but it makes sense to me :) ) but could be a slight problem, in that it can
change the md5sum of the file (due to changes in the compression level).  xdelta
probably handles this correctly (doing the md5sum on the uncompressed data) but
it could confuse tripwire and schemes that compare md5sums against the
'official' Debian archive.


  Using a metaphor in front of Ridcully was like a red rag to a--was like
using something very annoying in the presence of someone who was very annoyed
by it.

              -- Terry Pratchett, _Lords and Ladies_

Reply to: