Update build skeleton after diffutils 2.8.7 update.

This commit is contained in:
Xin LI 2007-06-15 07:09:34 +00:00
parent 3070b40134
commit b6ee6822f3
11 changed files with 164 additions and 937 deletions

View File

@ -1,16 +1,24 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../contrib/diff
DIFFSRC=${.CURDIR}/../../../contrib/diff/src
.PATH: ${DIFFSRC} \
${.CURDIR}/../../../contrib/diff/lib \
${.CURDIR}/../../../contrib/diff/man
PROG= diff
SRCS= analyze.c cmpbuf.c context.c diff.c dir.c ed.c \
ifdef.c io.c normal.c prepend_args.c side.c util.c version.c
SRCS= analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
normal.c side.c util.c \
xmalloc.c strtoumax.c cmpbuf.c exitfail.c error.c quotesys.c \
strftime.c c-stack.c basename.c exclude.c hard-locale.c \
file-type.c posixver.c prepargs.c version-etc.c
# Important for ctype macros!
CFLAGS+=-funsigned-char
CFLAGS+=-I${.CURDIR}/../../../contrib/diff \
-I${DESTDIR}/usr/include/gnu
CFLAGS+=-I${DESTDIR}/usr/include/gnu
CFLAGS+=-I${.CURDIR}/../../../contrib/diff
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/src
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib
CFLAGS+=-DHAVE_CONFIG_H
CFLAGS+=-DPR_PROGRAM=\"/usr/bin/pr\"
@ -19,4 +27,10 @@ SUBDIR+=doc
DPADD= ${LIBGNUREGEX}
LDADD= -lgnuregex
.for f in diff.c context.c
${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
CLEANFILES+= ${f}
.endfor
.include <bsd.prog.mk>

View File

@ -0,0 +1,21 @@
$FreeBSD$
--- context.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ context.c 2007-06-15 14:51:05.497679903 +0800
@@ -29,7 +29,7 @@
# define TIMESPEC_NS(timespec) 0
#endif
-size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int);
+size_t nstrftime (char *, size_t, char const *, struct tm const *, int, long);
static char const *find_function (char const * const *, lin);
static struct change *find_hunk (struct change *);
@@ -57,7 +57,7 @@
char buf[MAX (INT_STRLEN_BOUND (int) + 32,
INT_STRLEN_BOUND (time_t) + 11)];
struct tm const *tm = localtime (&inf->stat.st_mtime);
- int nsec = TIMESPEC_NS (inf->stat.st_mtim);
+ long nsec = TIMESPEC_NS (inf->stat.st_mtimespec);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
long int sec = inf->stat.st_mtime;

View File

@ -1,508 +0,0 @@
.\" $FreeBSD$
.TH DIFF 1 "22sep1993" "GNU Tools" "GNU Tools"
.SH NAME
diff \- find differences between two files
.SH SYNOPSIS
.B diff
[options] from-file to-file
.SH DESCRIPTION
In the simplest case,
.I diff
compares the contents of the two files
.I from-file
and
.IR to-file .
A file name of
.B \-
stands for
text read from the standard input. As a special case,
.B "diff \- \-"
compares a copy of standard input to itself.
If
.I from-file
is a directory and
.I to-file
is not,
.I diff
compares the file in
.I from-file
whose file name is that of
.IR to-file ,
and vice versa. The non-directory file must not be
.BR \- .
If both
.I from-file
and
.I to-file
are directories,
.I diff
compares corresponding files in both directories, in
alphabetical order; this comparison is not recursive unless the
.B \-r
or
.B \-\-recursive
option is given.
.I diff
never
compares the actual contents of a directory as if it were a file. The
file that is fully specified may not be standard input, because standard
input is nameless and the notion of ``file with the same name'' does not
apply.
.B diff
options begin with
.BR \- ,
so normally
.I from-file
and
.I to-file
may not begin with
.BR \- .
However,
.B \-\-
as an
argument by itself treats the remaining arguments as file names even if
they begin with
.BR \- .
.SS Options
Below is a summary of all of the options that GNU
.I diff
accepts.
Most options have two equivalent names, one of which is a single letter
preceded by
.BR \- ,
and the other of which is a long name preceded by
.BR \-\- .
Multiple single letter options (unless they take an
argument) can be combined into a single command line word:
.B \-ac
is
equivalent to
.BR "\-a \-c" .
Long named options can be abbreviated to
any unique prefix of their name. Brackets
.RB ( [
and
.BR ] )
indicate that an
option takes an optional argument.
.TP
.BI \- lines
Show
.I lines
(an integer) lines of context. This option does not
specify an output format by itself; it has no effect unless it is
combined with
.B \-c
or
.BR \-u .
This option is obsolete. For proper
operation,
.I patch
typically needs at least two lines of context.
.TP
.B \-a
Treat all files as text and compare them line-by-line, even if they
do not seem to be text.
.TP
.B \-b
Ignore changes in amount of white space.
.TP
.B \-B
Ignore changes that just insert or delete blank lines.
.TP
.B \-\-brief
Report only whether the files differ, not the details of the
differences.
.TP
.B \-c
Use the context output format.
.TP
.BI "\-C " lines
.br
.ns
.TP
.BI \-\-context[= lines ]
Use the context output format, showing
.I lines
(an integer) lines of
context, or three if
.I lines
is not given.
For proper operation,
.I patch
typically needs at least two lines of
context.
.TP
.BI \-\-changed\-group\-format= format
Use
.I format
to output a line group containing differing lines from
both files in if-then-else format.
For more details on what can be specified in the
.I format
string, consult the info documentation of
.I diff .
.TP
.B \-d
Change the algorithm to perhaps find a smaller set of changes. This makes
.I diff
slower (sometimes much slower).
.TP
.BI "\-D " name
Make merged if-then-else format output, conditional on the preprocessor
macro
.IR name .
.TP
.B \-e
.br
.ns
.TP
.B \-\-ed
Make output that is a valid
.I ed
script.
.TP
.BI \-\-exclude= pattern
When comparing directories, ignore files and subdirectories whose basenames
match
.IR pattern .
.TP
.BI \-\-exclude\-from= file
When comparing directories, ignore files and subdirectories whose basenames
match any pattern contained in
.IR file .
.TP
.B \-\-expand\-tabs
Expand tabs to spaces in the output, to preserve the alignment of tabs
in the input files.
.TP
.B \-f
Make output that looks vaguely like an
.I ed
script but has changes
in the order they appear in the file.
.TP
.BI "\-F " regexp
In context and unified format, for each hunk of differences, show some
of the last preceding line that matches
.IR regexp .
.TP
.B \-\-forward\-ed
Make output that looks vaguely like an
.B ed
script but has changes
in the order they appear in the file.
.TP
.B \-h
This option currently has no effect; it is present for Unix
compatibility.
.TP
.B \-H
Use heuristics to speed handling of large files that have numerous
scattered small changes.
.TP
.BI \-\-horizon\-lines= lines
Do not discard the last
.I lines
lines of the common prefix
and the first
.I lines
lines of the common suffix.
.TP
.B \-i
Ignore changes in case; consider upper- and lower-case letters
equivalent.
.TP
.BI "\-I " regexp
Ignore changes that just insert or delete lines that match
.IR regexp .
.TP
.BI \-\-ifdef= name
Make merged if-then-else format output, conditional on the preprocessor
macro
.IR name .
.TP
.B \-\-ignore\-all\-space
Ignore white space when comparing lines.
.TP
.B \-\-ignore\-blank\-lines
Ignore changes that just insert or delete blank lines.
.TP
.B \-\-ignore\-case
Ignore changes in case; consider upper- and lower-case to be the same.
.TP
.BI \-\-ignore\-matching\-lines= regexp
Ignore changes that just insert or delete lines that match
.IR regexp .
.TP
.B \-\-ignore\-space\-change
Ignore changes in amount of white space.
.TP
.B \-\-initial\-tab
Output a tab rather than a space before the text of a line in normal or
context format. This causes the alignment of tabs in the line to look
normal.
.TP
.B \-l
Pass the output through
.I pr
to paginate it.
.TP
.BI "\-L " label
.br
.ns
.TP
.BI \-\-label= label
Use
.I label
instead of the file name in the context format
and unified format
headers.
.TP
.B \-\-left\-column
Print only the left column of two common lines in side by side format.
.TP
.BI \-\-line\-format= format
Use
.I format
to output all input lines in in-then-else format.
.TP
.B \-\-minimal
Change the algorithm to perhaps find a smaller set of changes. This
makes
.I diff
slower (sometimes much slower).
.TP
.B \-n
Output RCS-format diffs; like
.B \-f
except that each command
specifies the number of lines affected.
.TP
.B \-N
.br
.ns
.TP
.B \-\-new\-file
In directory comparison, if a file is found in only one directory,
treat it as present but empty in the other directory.
.TP
.BI \-\-new\-group\-format= format
Use
.I format
to output a group of lines taken from just the second
file in if-then-else format.
.TP
.BI \-\-new\-line\-format= format
Use
.I format
to output a line taken from just the second file in
if-then-else format.
.TP
.B \-o
Use the old traditional output format.
.TP
.BI \-\-old\-group\-format= format
Use
.I format
to output a group of lines taken from just the first
file in if-then-else format.
.TP
.BI \-\-old\-line\-format= format
Use
.I format
to output a line taken from just the first file in
if-then-else format.
.TP
.B \-p
Show which C function each change is in.
.TP
.B \-P
When comparing directories, if a file appears only in the second
directory of the two, treat it as present but empty in the other.
.TP
.B \-\-paginate
Pass the output through
.I pr
to paginate it.
.TP
.B \-q
Report only whether the files differ, not the details of the
differences.
.TP
.B \-\-rcs
Output RCS-format diffs; like
.B \-f
except that each command
specifies the number of lines affected.
.TP
.B \-r
.br
.ns
.TP
.B \-\-recursive
When comparing directories, recursively compare any subdirectories
found.
.TP
.B \-s
.br
.ns
.TP
.B \-\-report\-identical\-files
Report when two files are the same.
.TP
.BI "\-S " file
When comparing directories, start with the file
.IR file .
This is
used for resuming an aborted comparison.
.TP
.B \-\-sdiff\-merge\-assist
Print extra information to help
.IR sdiff .
.I sdiff
uses this
option when it runs
.IR diff .
This option is not intended for users
to use directly.
.TP
.B \-\-show\-c\-function
Show which C function each change is in.
.TP
.BI \-\-show\-function\-line= regexp
In context and unified format, for each hunk of differences, show some
of the last preceding line that matches
.IR regexp .
.TP
.B \-\-side\-by\-side
Use the side by side output format.
.TP
.B \-\-speed\-large\-files
Use heuristics to speed handling of large files that have numerous
scattered small changes.
.TP
.BI \-\-starting\-file= file
When comparing directories, start with the file
.IR file .
This is
used for resuming an aborted comparison.
.TP
.B \-\-suppress\-common\-lines
Do not print common lines in side by side format.
.TP
.B \-t
Expand tabs to spaces in the output, to preserve the alignment of tabs
in the input files.
.TP
.B \-T
Output a tab rather than a space before the text of a line in normal or
context format. This causes the alignment of tabs in the line to look
normal.
.TP
.B \-\-text
Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
.TP
.B \-u
Use the unified output format.
.TP
.BI \-\-unchanged\-group\-format= format
Use
.I format
to output a group of common lines taken from both files
in if-then-else format.
.TP
.BI \-\-unchanged\-line\-format= format
Use
.I format
to output a line common to both files in if-then-else
format.
.TP
.B \-\-unidirectional\-new\-file
When comparing directories, if a file appears only in the second
directory of the two, treat it as present but empty in the other.
.TP
.BI "\-U " lines
.br
.ns
.TP
.BI \-\-unified[= lines ]
Use the unified output format, showing
.I lines
(an integer) lines of
context, or three if
.I lines
is not given.
For proper operation,
.I patch
typically needs at least two lines of
context.
.TP
.B \-v
.br
.ns
.TP
.B \-\-version
Output the version number of
.IR diff .
.TP
.B \-w
Ignore horizontal white space when comparing lines.
.TP
.BI "\-W " columns
.br
.ns
.TP
.BI \-\-width= columns
Use an output width of
.I columns
in side by side format.
.TP
.BI "\-x " pattern
When comparing directories, ignore files and subdirectories whose basenames
match
.IR pattern .
.TP
.BI "\-X " file
When comparing directories, ignore files and subdirectories whose basenames
match any pattern contained in
.IR file .
.TP
.B \-y
Use the side by side output format.
.SH RETURN VALUE
.I diff
returns 0 if the files are identical or 1 if the files differ.
If one or both of the files cannot be opened,
then the return value is set to 2.
.SH ENVIRONMENT
The environment variable
.B DIFF_OPTIONS
can hold a set of default
options for
.I diff.
These options are interpreted first and can be overwritten by explicit command
line parameters.
.SH EXAMPLES
To save to a file some changes that you have made to your local source
tree (possibly including new files), which you would like to show to others
(perhaps using the
.B send-pr(1)
program), you could type
.sp
diff -urN foo.orig foo >foo.diff
.sp
where
.I foo.orig
and
.I foo
might be directory hierarchies or single files.
.SH SEE ALSO
cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).
.SH DIAGNOSTICS
An exit status of 0 means no differences were found, 1 means some
differences were found, and 2 means trouble.

View File

@ -0,0 +1,69 @@
$FreeBSD$
--- diff.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ diff.c 2007-06-15 14:51:05.506679851 +0800
@@ -137,7 +137,7 @@
}
static char const shortopts[] =
-"0123456789abBcC:dD:eEfF:hHiI:lL:nNpPqrsS:tTuU:vwW:x:X:y";
+"0123456789abBcC:dD:eEfF:hHiI:lL:nNopPqrsS:tTuU:vwW:x:X:y";
/* Values for long options that do not have single-letter equivalents. */
enum
@@ -265,14 +265,15 @@
initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
c_stack_action (0);
function_regexp_list.buf = &function_regexp;
ignore_regexp_list.buf = &ignore_regexp;
- re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
+ re_set_syntax (RE_SYNTAX_GREP);
excluded = new_exclude ();
+ prepend_default_options (getenv ("DIFF_OPTIONS"), &argc, &argv);
+
/* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1)
@@ -428,6 +429,11 @@
new_file = true;
break;
+ case 'o':
+ /* Output in the old tradition style. */
+ specify_style (OUTPUT_NORMAL);
+ break;
+
case 'p':
show_c_function = true;
add_regexp (&function_regexp_list, "^[[:alpha:]$_]");
@@ -983,8 +989,6 @@
{
if (output_style != style)
{
- if (output_style != OUTPUT_UNSPECIFIED)
- try_help ("conflicting output style options", 0);
output_style = style;
}
}
@@ -997,7 +1001,7 @@
#ifdef ST_MTIM_NSEC
# if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
- if (clock_gettime (CLOCK_REALTIME, &st->st_mtim) == 0)
+ if (clock_gettime (CLOCK_REALTIME, &st->st_mtimespec) == 0)
return;
# endif
@@ -1007,7 +1011,7 @@
if (gettimeofday (&timeval, 0) == 0)
{
st->st_mtime = timeval.tv_sec;
- st->st_mtim.ST_MTIM_NSEC = timeval.tv_usec * 1000;
+ st->st_mtimespec.ST_MTIM_NSEC = timeval.tv_usec * 1000;
return;
}
}

View File

@ -4,6 +4,6 @@ INFO = diff
INFOENTRY_diff= "* DIFF: (diff). DIFF/PATCH Reference Manual."
SRCDIR=${.CURDIR}/../../../../contrib/diff
SRCDIR=${.CURDIR}/../../../../contrib/diff/doc
.include <bsd.info.mk>

View File

@ -1,15 +1,27 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../contrib/diff
DIFFSRC=${.CURDIR}/../../../contrib/diff/src
.PATH: ${DIFFSRC} \
${.CURDIR}/../../../contrib/diff/lib \
${.CURDIR}/../../../contrib/diff/man
PROG= diff3
SRCS= diff3.c version.c
SRCS= diff3.c version-etc.c \
xmalloc.c error.c c-stack.c exitfail.c cmpbuf.c
# Important for ctype macros!
CFLAGS+=-funsigned-char
CFLAGS+=-I${.CURDIR}/../../../contrib/diff
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/src
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib
CFLAGS+=-DHAVE_CONFIG_H
CFLAGS+=-DDIFF_PROGRAM=\"/usr/bin/diff\"
CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bin/diff\"
.for f in diff3.c
${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
CLEANFILES+= ${f}
.endfor
.include <bsd.prog.mk>

View File

@ -1,210 +0,0 @@
.TH DIFF3 1 "22sep1993" "GNU Tools" "GNU Tools"
.SH NAME
diff3 \- find differences between three files
.SH SYNOPSIS
.B diff3
[options] mine older yours
.SH DESCRIPTION
The
.I diff3
command compares three files and outputs descriptions
of their differences.
The files to compare are
.IR mine ,
.IR older ,
and
.IR yours .
At most one of these three file names may be
.BR \- ,
which tells
.I diff3
to read the standard input for that file.
.SS Options
Below is a summary of all of the options that GNU
.I diff3
accepts. Multiple single letter options (unless they take an argument)
can be combined into a single command line argument.
.TP
.B \-a
Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
.TP
.B \-A
Incorporate all changes from
.I older
to
.I yours
into
.IR mine ,
surrounding all conflicts with bracket lines.
.TP
.B \-B
Old behavior of -A. Shows non-conflicts.
.TP
.B \-e
Generate an
.I ed
script that incorporates all the changes from
.I older
to
.I yours
into
.IR mine .
.TP
.B \-E
Like
.BR \-e ,
except bracket lines from overlapping changes' first
and third files.
With
.BR \-e ,
an overlapping change looks like this:
.sp
.nf
<<<<<<< \fImine\fP
lines from \fImine\fP
=======
lines from \fIyours\fP
>>>>>>> \fIyours\fP
.fi
.TP
.B \-\-ed
Generate an
.I ed
script that incorporates all the changes from
.I older
to
.I yours
into
.IR mine .
.TP
.B \-\-easy\-only
Like
.BR \-e ,
except output only the nonoverlapping changes.
.TP
.B \-i
Generate
.B w
and
.B q
commands at the end of the
.I ed
script for System V compatibility. This option must be combined with
one of the
.B \-AeExX3
options, and may not be combined with
.BR \-m .
.TP
.B \-\-initial\-tab
Output a tab rather than two spaces before the text of a line in normal format.
This causes the alignment of tabs in the line to look normal.
.TP
.BI "\-L " label
.ns
.TP
.BI \-\-label= label
Use the label
.I label
for the brackets output by the
.BR \-A ,
.B \-E
and
.B \-X
options. This option may be given up to three
times, one for each input file. The default labels are the names of
the input files. Thus
.B "diff3 \-L X \-L Y \-L Z \-m A B C"
acts like
.BR "diff3 \-m A B C ,
except that the output looks like it came from
files named
.BR X ,
.B Y
and
.B Z
rather than from files
named
.BR A ,
.B B
and
.BR C .
.TP
.B \-m
.br
.ns
.TP
.B \-\-merge
Apply the edit script to the first file and send the result to standard
output. Unlike piping the output from
.I diff3
to
.IR ed ,
this
works even for binary files and incomplete lines.
.B \-A
is assumed
if no edit script option is specified.
.TP
.B \-\-overlap\-only
Like
.BR \-e ,
except output only the overlapping changes.
.TP
.B \-\-show\-all
Incorporate all unmerged changes from
.I older
to
.I yours
into
.IR mine ,
surrounding all overlapping changes with bracket lines.
.TP
.B \-\-show\-overlap
Like
.BR \-e ,
except bracket lines from overlapping changes' first
and third files.
.TP
.B \-T
Output a tab rather than two spaces before the text of a line in normal format.
This causes the alignment of tabs in the line to look normal.
.TP
.B \-\-text
Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
.TP
.B \-v
.br
.ns
.TP
.B \-\-version
Output the version number of
.IR diff3 .
.TP
.B \-x
Like
.BR \-e ,
except output only the overlapping changes.
.TP
.B \-X
Like
.BR \-E ,
except output only the overlapping changes.
In other words, like
.BR \-x ,
except bracket changes as in
.BR \-E .
.TP
.B \-3
Like
.BR \-e ,
except output only the nonoverlapping changes.
.SH SEE ALSO
cmp(1), comm(1), diff(1), ed(1), patch(1), sdiff(1).
.SH DIAGNOSTICS
An exit status of 0 means
.I diff3
was successful, 1 means some
conflicts were found, and 2 means trouble.

View File

@ -0,0 +1,11 @@
$FreeBSD$
--- diff3.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ diff3.c 2007-06-15 14:49:23.903835977 +0800
@@ -230,7 +230,6 @@
initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
c_stack_action (0);

View File

@ -1,16 +1,28 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../contrib/diff
DIFFSRC=${.CURDIR}/../../../contrib/diff/src
.PATH: ${DIFFSRC} \
${.CURDIR}/../../../contrib/diff/lib \
${.CURDIR}/../../../contrib/diff/man
PROG= sdiff
SRCS= sdiff.c version.c
SRCS= sdiff.c version-etc.c \
error.c xmalloc.c c-stack.c basename.c strtoumax.c \
exitfail.c
# Important for ctype macros!
CFLAGS+=-funsigned-char
CFLAGS+=-I${.CURDIR}/../../../contrib/diff
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/src
CFLAGS+=-I${.CURDIR}/../../../contrib/diff/lib
CFLAGS+=-DHAVE_CONFIG_H
CFLAGS+=-DDIFF_PROGRAM=\"/usr/bin/diff\"
CFLAGS+=-DDEFAULT_EDITOR_PROGRAM=\"/usr/bin/vi\"
CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bin/diff\"
.for f in sdiff.c
${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
CLEANFILES+= ${f}
.endfor
.include <bsd.prog.mk>

View File

@ -1,205 +0,0 @@
.\" $FreeBSD$
.\"
.TH SDIFF 1 "22sep1993" "GNU Tools" "GNU Tools"
.SH NAME
sdiff \- find differences between two files and merge interactively
.SH SYNOPSIS
.B sdiff
.B -o
outfile [options] from-file to-file
.SH DESCRIPTION
The
.I sdiff
command merges two files and interactively outputs the
results to
.IR outfile .
If
.I from-file
is a directory and
.I to-file
is not,
.I sdiff
compares the file in
.I from-file
whose file name is that of
.IR to-file ,
and vice versa.
.I from-file
and
.I to-file
may not both be
directories.
.I sdiff
options begin with
.BR \- ,
so normally
.I from-file
and
.I to-file
may not begin with
.BR \- .
However,
.B \-\-
as an
argument by itself treats the remaining arguments as file names even if
they begin with
.BR \- .
You may not use
.B \-
as an input file.
.I sdiff
without
.B \-o
(or
.BR \-\-output )
produces a
side-by-side difference. This usage is obsolete; use
.B "diff \-\-side\-by\-side"
instead.
.SS Options
Below is a summary of all of the options that GNU
.I sdiff
accepts.
Each option has two equivalent names, one of which is a single
letter preceded by
.BR \- ,
and the other of which is a long name
preceded by
.BR \-\- .
Multiple single letter options (unless they take
an argument) can be combined into a single command line argument. Long
named options can be abbreviated to any unique prefix of their name.
.TP
.B \-a
Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
.TP
.B \-b
Ignore changes in amount of white space.
.TP
.B \-B
Ignore changes that just insert or delete blank lines.
.TP
.B \-d
Change the algorithm to perhaps find a smaller set of changes. This
makes
.I sdiff
slower (sometimes much slower).
.TP
.B \-H
Use heuristics to speed handling of large files that have numerous
scattered small changes.
.TP
.B \-\-expand\-tabs
Expand tabs to spaces in the output, to preserve the alignment of tabs
in the input files.
.TP
.B \-i
Ignore changes in case; consider upper- and lower-case to be the same.
.TP
.BI "\-I " regexp
Ignore changes that just insert or delete lines that match
.IR regexp .
.TP
.B \-\-ignore\-all\-space
Ignore white space when comparing lines.
.TP
.B \-\-ignore\-blank\-lines
Ignore changes that just insert or delete blank lines.
.TP
.B \-\-ignore\-case
Ignore changes in case; consider upper- and lower-case to be the same.
.TP
.BI \-\-ignore\-matching\-lines= regexp
Ignore changes that just insert or delete lines that match
.IR regexp .
.TP
.B \-\-ignore\-space\-change
Ignore changes in amount of white space.
.TP
.B \-l
.br
.ns
.TP
.B \-\-left\-column
Print only the left column of two common lines.
.TP
.B \-\-minimal
Change the algorithm to perhaps find a smaller set of changes. This
makes
.I sdiff
slower (sometimes much slower).
.TP
.BI "\-o " file
.br
.ns
.TP
.BI \-\-output= file
Put merged output into
.IR file .
This option is required for merging.
.TP
.B \-s
.br
.ns
.TP
.B \-\-suppress\-common\-lines
Do not print common lines.
.TP
.B \-\-speed\-large\-files
Use heuristics to speed handling of large files that have numerous
scattered small changes.
.TP
.B \-t
Expand tabs to spaces in the output, to preserve the alignment of tabs
in the input files.
.TP
.B \-\-text
Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
.TP
.B \-v
.br
.ns
.TP
.B \-\-version
Output the version number of
.IR sdiff .
.TP
.BI "\-w " columns
.br
.ns
.TP
.BI \-\-width= columns
Use an output width of
.IR columns .
Note that for historical reasons, this option is
.B \-W
in
.IR diff ,
.B \-w
in
.IR sdiff .
.TP
.B \-W
Ignore horizontal white space when comparing lines.
Note that for historical reasons, this option is
.B \-w
in
.IR diff ,
.B \-W
in
.IR sdiff .
.SH SEE ALSO
cmp(1), comm(1), diff(1), diff3(1).
The
.B info
documentation of
.BR diff .
.SH DIAGNOSTICS
An exit status of 0 means no differences were found, 1 means some
differences were found, and 2 means trouble.

View File

@ -0,0 +1,11 @@
$FreeBSD$
--- sdiff.c.orig 2004-04-12 15:44:35.000000000 +0800
+++ sdiff.c 2007-06-15 14:53:08.790433972 +0800
@@ -455,7 +455,6 @@
initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
c_stack_action (cleanup);