bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sdiff version 2.8.1 - compares the wrong line


From: Stepan Kasal
Subject: Re: sdiff version 2.8.1 - compares the wrong line
Date: Mon, 16 Feb 2004 12:15:40 +0100
User-agent: Mutt/1.4.1i

Hello,

On Sun, Feb 15, 2004 at 08:46:08PM +0100, minimoa wrote:
> sdiff -s (version 2.8.1) does not recognize inserted line in following 
> example:
> 
> old file:
> epsxe 1.5.2
> esound-devel 0.2.29
> esound 0.2.29
> estic 1.60
> 
> new file:
> epsxe 1.5.2
> eric 3.2
> esound-devel 0.2.32
> esound 0.2.32
> estic 1.60

diff/sdiff is a line oriented tool.  The following three lines:

        esound-devel 0.2.29
        eric 3.2
        esound-devel 0.2.32

are all different and diff cannot see that two of them have something
in common.  I think it would be quite a big change to teach diff to
see "similar" lines.  But without it, your requirement cannot be
fullfilled.

But there might be another solution to your problem:
first, preprocess both files to delete the version numbers and use
(s)diff to find out new and delted packages.
In a second phase, you can compare the partially sycnchronized files
and find out the version changes.

Alternatively, you may just use a script, perhaps written in awk,
which will "understand" the structure of the files and will report
added and modified lines according to your taste.
It seems quite usual to me: when diff is enough, write a specialized
tool to compare two text "data bases".

HTH,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]