[REBOL] Re: auto-update engine
From: sunandadh:aol at: 15-Feb-2003 12:52
Gabriele:
> Hmm, maybe, but they are only useful when you are using Encap
> since the first 500k of the exe are equal. So I wouldn't want to
> show them to the world as a generic patch system. :-)
What the rest of us need (possibly -- see end) is a process that will compare
Version 1 source with Version 2 source and ship a delta that consists only of
the edit instructions to change V1 into V2.
A simple algorithm that treated source as separate lines would take the
following program and produce a three-line delta file:
======original program======
rebol []
a-func: func [p1 p2][
return p1 * p2
]
print "version 1"
print "this is the first beta. May not work very well"
print a-func 5 6
=====new version ======
rebol []
a-func: func [p1 p2][
return p1 + p2
]
print a-func 5 6
======change file======
d [4 5]
R 3 " return p1 + p2"
I 2 ""
A more sophisticated program that looked for runs of identical strings would
produce a different (and in this case, shorter) delta file.
Such algorithms exist and are easy to implement in Rebol. They are a good way
of seeing what has changed between any two versions of a program; and are
commonly used in source library management programs to hold only the
difference between successive checked-in versions.
A full distribution process would also have to handle adding new and deleting
old scripts.
But before any of us write such a thing, I wonder how many of us have Rebol
applications that are so large they need such a distribution method?
Sunanda.