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

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

Diffutils patch regarding special files


From: Jason Todd
Subject: Diffutils patch regarding special files
Date: Tue, 11 Nov 2008 18:15:01 -0500 (EST)

Hi,

I have put together the attached simple patch for diff.c of the Diffutils package (specifically version 2.8.1). This patch suppresses the messages (and failure exit status) when non-regular files are encountered during recursive comparisons, if the "-Q" or "--ignore_special" command line arguments are given. Examples of the suppressed messages are:

File original/dev/char1-3 is a character special file while file test1/dev/char1-3 is a character special file
File original/misc/a-fifo is a fifo while file test1/misc/a-fifo is a fifo
File original/misc/a-socket is a socket while file test1/misc/a-socket is a fifo

Instead, the patch looks a little further, and if the files are of the same type and are not device files, it considers them a match. In the case of device files, if they are of the same type (block or character) and refer to the same device (via stat.st_rdev), then it considers them a match.

When comparing two complete filesystems, or large portions of them (which I do a lot), these messages tend to get in the way. Broken symlinks, which are common in almost every distribution, are still reported, but those messages I am willing to filter outside of diff.

I can submit a larger patch that includes the relevant changes to the documentation supplied with Diffutils, if you would like. Further, I can update and re-package everything as diffutils-2.8.2 if you would like (but I don't want to intrude too much). Just let me know.

Thanks,
Jason Todd

Attachment: diff-ignore_special.patch
Description: Text document


reply via email to

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