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

Re: Build alternatives

> ... 
> > How about
> >     cmp -s ${SOURCE_FILE} ${DESTINATION_FILE} ||
> I was using rsync because it's got a smart algorithm to which I alluded.
> Roughly:
> Cheap quick checksum on a chunk of the program.
> If they differ, the programs are different, go to it.
> The cheap checksum is quick, but may match different chunk. That's ok.
> If they match, a more extensive checksum is done.
> Now if THOSE differ, go to it.
> If they don't differ (we're now sure they are the same),
> move to the next chunk of the file.

You might be interested in "librsync" package 
(ftp://ftp.idiom.com/users/davids/openbsd/librsync.tgz).  It's library
implementing the 'rsync' algorithm.  Apropos this discussion, it also
comes with a command line utility called "rdiff" for computing and
applying signature-based file differences.

David S.