[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (visual) diff for large files



On Fri, 2008-05-02 at 14:17 -0500, Sergio Cuéllar Valdés wrote:
> 2008/5/2 michael <cs@networkingnewsletter.org.uk>:
> > On Thu, 2008-05-01 at 13:21 -0500, Sergio Cuéllar Valdés wrote:
> >  > 2008/5/1 michael <cs@networkingnewsletter.org.uk>:
> >  > > At work we've been discussing (below) 'diff' running out of memory. I've
> >  > >  tried to see if 'rdiff' can help (but no idea how to back out the
> >  > >  differences from the "delta" o/p file). I've seen that freeBSD has a
> >  > >  diff utility (eg 2bsd-diff) that does NOT read in all of the files in
> >  > >  one go and thus has less problems with 'memory exhausted' but I cannot
> >  > >  find a Debian equivalent. Therefore,
> >  > >
> >  > >  does anybody know of a freeBSD->Debian ports site?
> >  > >
> >  > >  I did try downloading the 2.11bsd-diff source but it doesn't build on my
> >  > >  system (unsurprisingly!)
> 
> Hello,
> 
> I compiled diff.  I used gcc-3.4. I had to modify diffdir.c. These are
> the changes:
> 
> @@ -18,6 +18,7 @@ struct dir {
>  	short	d_reclen;
>  	short	d_namlen;
>  	char	*d_entry;
> +	char	*d_name;
>  };
> 
>  struct	dir *setupdir();
> @@ -172,7 +173,7 @@ setupdir(cp)
>  	char *cp;
>  {
>  	register struct dir *dp = 0, *ep;
> -	register struct direct *rp;
> +	register struct dir *rp;
>  	register int nitems, n;
>  	DIR *dirp;
> 
> Go to the directory of diff (bin/diff)  and $ CC=/usr/bin/gcc-3.4  make
> 
> There are some warnings, but you will get 2 ELF binaries: diff and diffh.
> 
> I used the compiled diff to see the differences of the file diffdir.c:
> 
> $ ./diff /tmp/orig/bin/diff/diffdir.c /tmp/modified/bin/diff/diffdir.c
> 20a21
> > 	char	*d_name;
> 175c176
> < 	register struct direct *rp;
> ---
> > 	register struct dir *rp;
> 
> 
> hope it will help you.
> 
> Best regards,
> Sergio Cuellar
> 
I had a quick try (before above patch) but it fails on headers:


michael@ratty:~/src/bsd-diff/bin$ gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


michael@ratty:~/src/bsd-diff/bin$ make
cd adb; make  SEPFLAG=-i
make[1]: Entering directory `/home/michael/src/bsd-diff/bin/adb'
cc -O -DNUM_SYMS_CACHE=50   -c -o access.o access.c
In file included from access.c:1:
defs.h:15:25: error: machine/reg.h: No such file or directory
In file included from access.c:1:
defs.h:194: warning: conflicting types for built-in function 'round'
access.c: In function 'acces':
access.c:69: error: 'errno' undeclared (first use in this function)
access.c:69: error: (Each undeclared identifier is reported only once
access.c:69: error: for each function it appears in.)
access.c: In function 'setovmap':
access.c:142: error: 'NOVL' undeclared (first use in this function)
access.c:148: error: invalid use of undefined type 'struct ovlhdr'
make[1]: *** [access.o] Error 1
make[1]: Leaving directory `/home/michael/src/bsd-diff/bin/adb'
make: *** [adb] Error 2



> 
> -- 
> "Meine Hoffnung soll mich leiten
> Durch die Tage ohne Dich
> Und die Liebe soll mich tragen
> Wenn der Schmerz die Hoffnung bricht"
> 
> 


Reply to: