Re: partial patches - server application
* Andreas Barth:
>> Is this really a good idea? patch invokes ed(1) to process ed
>> scripts, and this might lead to execution of arbitrary commands.
> It is agreed that the usage of patch and ed is _not_ the recommended
> way for production code (but acceptable for prototype code). However, as
> already discussed last time, the patches need only a tiny subset of ed
> that is not only provided by red, but can even be implemented internally
> in apt.
Unfortunately, deltas created with "diff -e" are not suitable for
one-pass processing. The output from "diff -f" is, but it cannot
handle some input files ("." on a line by itself cannot be added and
results in silently corrupted output). "diff -n" (RCS style) output
seems to be most suitable. It appears to be completely binary
transparent ("diff -e" isn't), and it is suitable for one-pass
An example implementation (written in C) of the corresponding patch
operation is available at:
There is a drawback, though: "diff -n" output is slightly larger than
"diff -e" output, even after compression (by about 7% to 10%).