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

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

diff has odd behaviour


From: Peter D.
Subject: diff has odd behaviour
Date: Thu, 25 May 2006 23:58:32 +1000
User-agent: KMail/1.8.2

Hi, 

Diff is showing some odd behaviour when comparing directories.  

It is obviously getting confused about following soft links that 
occur in both directories and point to the same third directory.  
It reports two "not found" errors for each entry in the third branch.  
This behaviour is repetitive and wrong (the files do exist).  The 
search probably should be pruned in this situation.  
  
Following soft links is good - except where they both point to 
the same file or directory.  Perhaps "follow soft links" should be 
toggled by a command line flag?  

There is probably some file system specific stuff going on here, 
not all file systems support soft links.  What should diff do 
if directories are hard linked?

I've just had a look at the source code - and chickened out.  
Your turn.  ;-)  

Here are some (edited) results from a terminal session...

[c17] /usr/src
->diff -rlq linux-2.6.12-22*
diff: linux-2.6.12-22mdk/arch/xen/arch: No such file or directory
diff: linux-2.6.12-22psd/arch/xen/arch: No such file or directory
diff: linux-2.6.12-22mdk/arch/xen/i386/kernel/bootflag.c: No such file 
or directory
diff: linux-2.6.12-22psd/arch/xen/i386/kernel/bootflag.c: No such file 
or directory

[Snip more matched pairs of things that "don't exist" in either 
branch.]


[c17] /usr/src
->ls -al
total 77,824
drwxr-xr-x   5 root root  4,096 May 25 16:02 ./
drwxr-xr-x  14 root root  4,096 May 15 13:41 ../
drwxr-xr-x   7 root root  4,096 May 15 13:41 RPM/
-rw-r--r--   1 psd  psd  50,107 May 23 23:04 
config-2.6.12-21psd.broken
lrwxrwxrwx   1 root root     18 May 25 16:02 linux -> 
linux-2.6.12-22psd/
drwxr-xr-x  21 root root  4,096 May 25 15:38 linux-2.6.12-22mdk/
drwxr-xr-x  21 psd  psd   4,096 May 25 16:11 linux-2.6.12-22psd/


[c17] /usr/src
->l linux-*/arch/xen
linux-2.6.12-22mdk/arch/xen:
total 131,072
-rw-r--r--  1 root root  5,668 May 24 06:06 Kconfig
-rw-r--r--  1 root root  4,300 May 24 06:06 Kconfig.debug
-rw-r--r--  1 root root  2,249 May 24 06:06 Kconfig.drivers
-rw-r--r--  1 root root  3,238 May 24 06:06 Makefile
lrwxrwxrwx  1 root root     56 May 25 15:38 arch 
-> /usr/src/RPM/BUILD/kernel-2.6/linux-2.6.12/arch/xen/i386
drwxr-xr-x  2 root root  4,096 May 25 15:38 boot/
drwxr-xr-x  2 root root  4,096 May 25 15:38 configs/
-rw-r--r--  1 root root 58,620 May 24 06:06 defconfig-xen0
-rw-r--r--  1 root root 20,009 May 24 06:06 defconfig-xenU
drwxr-xr-x  6 root root  4,096 May 25 15:38 i386/
drwxr-xr-x  2 root root  4,096 May 25 15:38 kernel/
drwxr-xr-x  6 root root  4,096 May 25 15:38 x86_64/

linux-2.6.12-22psd/arch/xen:
total 131,072
-rw-r--r--  1 psd psd  5,668 May 24 06:06 Kconfig
-rw-r--r--  1 psd psd  4,300 May 24 06:06 Kconfig.debug
-rw-r--r--  1 psd psd  2,249 May 24 06:06 Kconfig.drivers
-rw-r--r--  1 psd psd  3,238 May 24 06:06 Makefile
lrwxrwxrwx  1 psd psd     56 May 25 16:01 arch 
-> /usr/src/RPM/BUILD/kernel-2.6/linux-2.6.12/arch/xen/i386
drwxr-xr-x  2 psd psd  4,096 May 25 15:38 boot/
drwxr-xr-x  2 psd psd  4,096 May 25 15:38 configs/
-rw-r--r--  1 psd psd 58,620 May 24 06:06 defconfig-xen0
-rw-r--r--  1 psd psd 20,009 May 24 06:06 defconfig-xenU
drwxr-xr-x  6 psd psd  4,096 May 25 15:38 i386/
drwxr-xr-x  2 psd psd  4,096 May 25 15:38 kernel/
drwxr-xr-x  6 psd psd  4,096 May 25 15:38 x86_64/

[c17] /usr/src
->diff --version
diff (GNU diffutils) 2.8.7
Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.
[snip]


-- 
Peter D.
Sig goes here...




reply via email to

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