[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Build alternatives
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Build alternatives
- From: "David S." <davids_(_at_)_idiom_(_dot_)_com>
- Date: Thu, 13 Mar 2003 12:19:19 -0800
> ...
> > How about
> > cmp -s ${SOURCE_FILE} ${DESTINATION_FILE} ||
> > ${INSTALL_PROGRAM} ${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.
Visit your host, monkey.org