I'm looking for a automatic way of generating files that patch a live
running system. My idea is: I have (a) an old source code (b) a new
source code. Somehow I want to generate a file containing the
difference between (b) and (a) that can be (LOAD)ed into a running
lisp system. Ideally this file would containg only the minimal
changes needed to upgrade the live system.
····@cyberspace.org (Hal Niner) writes:
> I'm looking for a automatic way of generating files that patch a live
> running system. My idea is: I have (a) an old source code (b) a new
> source code. Somehow I want to generate a file containing the
> difference between (b) and (a) that can be (LOAD)ed into a running
> lisp system. Ideally this file would containg only the minimal
> changes needed to upgrade the live system.
There is some diff-like stuff in the CMU AI repository that could be useful:
<http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/tools/src_cmp/0.html>
But that will only help you with finding differences in source code,
for a useful patch you will need more. I doubt that an automatic
solution can work reliably.
Henrik Motakef wrote:
> ····@cyberspace.org (Hal Niner) writes:
>
>
>>I'm looking for a automatic way of generating files that patch a live
>>running system. My idea is: I have (a) an old source code (b) a new
>>source code. Somehow I want to generate a file containing the
>>difference between (b) and (a) that can be (LOAD)ed into a running
>>lisp system. Ideally this file would containg only the minimal
>>changes needed to upgrade the live system.
>
>
> There is some diff-like stuff in the CMU AI repository that could be useful:
> <http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/tools/src_cmp/0.html>
>
> But that will only help you with finding differences in source code,
> for a useful patch you will need more. I doubt that an automatic
> solution can work reliably.
Fer example, you'd have to do some reasoning to capture changes in the
formats of data structures passed among functions and generate the
appropriate conversions. Alternately you could restrict "legal" changes
in source files to ones that could be handled by your patch system, but
that might not be satisfactory either.
paul
····@cyberspace.org (Hal Niner) writes:
> I'm looking for a automatic way of generating files that patch a live
> running system. My idea is: I have (a) an old source code (b) a new
> source code. Somehow I want to generate a file containing the
> difference between (b) and (a) that can be (LOAD)ed into a running
> lisp system. Ideally this file would containg only the minimal
> changes needed to upgrade the live system.
I use a fairly naive "lisp diff" program that roughly does the
following:
- constructs the set-difference between the two programs (testing
with a function which is roughly EQUALP)
- adds dummy methods for any _removed_ methods (alternatively, one
could add forms that actually removed those methods)
- adds setf-forms corresponding to any changed DEFVARS.
- inserts IN-PACKAGE wherever it occurs
It's by no means perfect, but I actually _very_ rarely have to do
any manual amendments to the patches automatically created with this
program.
--
(espen)
Espen Vestre wrote:
> I use a fairly naive "lisp diff" program that roughly does the
> following:
>
> - constructs the set-difference between the two programs (testing
> with a function which is roughly EQUALP)
> - adds dummy methods for any _removed_ methods (alternatively, one
> could add forms that actually removed those methods)
> - adds setf-forms corresponding to any changed DEFVARS.
> - inserts IN-PACKAGE wherever it occurs
>
> It's by no means perfect, but I actually _very_ rarely have to do
> any manual amendments to the patches automatically created with this
> program.
Send links ;-)!
I would like to include CVS into the process of diff-generation, but
that is probably not too hard.
The deleted methods problem is already solved by a delete-method macro
(working by name, quals and lamdas).
The main things, I need to compute are the lists of changed definitions
and the order of patching (probably from defsystem).
Martin