I recently ported Brian Schroeder’s great GDiff
(http://ruby.brian-schroeder.de/gdiff/) program to Windows with just
one small problem: it doesn’t work. The required extension (Zed S.'s
suffix array) needed some minor changes to compile with silly MS VC++
6 and then everything seemed to be working except the GDiff files
produced when running the program look invalid.
The gpatch command and the tests with gdiff have never worked but that
was ok for me because gdiff worked under Linux and I wrote a gpatch in
C. Now I really need gdiff to run on Windows (my gpatch runs on an ARM
inside a device).
Now for the Windows port:
I did some basic tests with the suffix array and it looks functional.
I don’t have comprehensive tests.
Running the gdiff test suite gives this on both platforms:
Loaded suite tc_gdiff
Started
E…E.
Finished in 13.757589 seconds.
-
Error:
test_big(TC_GDiff):
NoMethodError: undefined methodoperations' for #<Diff::GDiff:0x402ba89c> /usr/local/lib/site_ruby/1.8/gdiff.rb:244:in
to_s’
tc_gdiff.rb:27:in `test_big’ -
Error:
test_pack_unpack(TC_GDiff):
NoMethodError: undefined methodoperations' for #<Diff::GDiff:0x402b8074> /usr/local/lib/site_ruby/1.8/gdiff.rb:244:in
to_s’
tc_gdiff.rb:36:intest_pack_unpack' tc_gdiff.rb:32:in
each’
tc_gdiff.rb:32:in `test_pack_unpack’
7 tests, 26 assertions, 0 failures, 2 errors
My next thought was to require breakpoint in lib/gdiff.rb on both
platforms and have them stop at some crucial places so I could inspect
the state. But when I put “breakpoint” on a line, suddenly this error
occurred:
lesliev@redebo:~/svnroot/bootpatcher/test$ ./gdiff_t one.bin two.bin
patch.bin
/usr/local/lib/site_ruby/1.8/gdiff_t.rb:246:into_s': undefined method
operations’ for #Diff::GDiff:0x4041c87c (NoMethodError)
from /usr/lib/ruby/1.8/irb.rb:270:inprompt' from /usr/lib/ruby/1.8/irb.rb:265:in
gsub!’
from /usr/lib/ruby/1.8/irb.rb:265:inprompt' from /usr/lib/ruby/1.8/irb.rb:114:in
eval_input’
from /usr/lib/ruby/1.8/irb.rb:103:incall' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:200:in
prompt’
from /usr/lib/ruby/1.8/irb/ruby-lex.rb:214:ininitialize_input' from /usr/lib/ruby/1.8/irb/ruby-lex.rb:221:in
each_top_level_statement’
… 10 levels…
from /usr/local/lib/site_ruby/1.8/breakpoint.rb:537:in
breakpoint' from /usr/local/lib/site_ruby/1.8/gdiff_t.rb:193:in
initialize’
from ./gdiff_t:25:in `diff’
from ./gdiff_t:25
- very similar to the tests.
So much for platform Independence! I have tried to contact Brian
without success and now I’m running out of time.
Any suggestions?
Les