48 Commits

Author SHA1 Message Date
Jim Meyering
90106d33ab maint: update gnulib and copyright dates for 2017
* gnulib: Update to latest.
* all files: Run "make update-copyright".
2017-01-01 03:22:44 -08:00
Jim Meyering
b3def738f3 maint: require that commit messages be of a certain form
* bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that
a local commit hook will now help enforce consistent commit messages.
* Makefile.am (check-git-hook-script-sync): New rule, largely copied
from coreutils.
* scripts/git-hooks/commit-msg: New file, from coreutils, but
with adapted list of program names.
* scripts/git-hooks/applypatch-msg: New file, from git.
* scripts/git-hooks/pre-applypatch: Likewise.
* scripts/git-hooks/pre-commit: Likewise.
2016-08-13 21:56:16 -07:00
Jim Meyering
47f84d5a75 build: Solaris 9: avoid link failure due to isblank use
* bootstrap.conf (gnulib_modules): Add isblank, to avoid a link
error on Solaris 9 Sparc.  Reported by Dagobert Michelsen.
2016-08-01 08:27:48 -07:00
Jim Meyering
3d8affcc9d maint: update prereq version of gettext
* configure.ac: Increase designated gettext version to 0.19.2
* bootstrap.conf (buildreq): Likewise.
Remove now-unnecessary code to remove gettext-provided files.
2016-01-31 18:01:27 -08:00
Jim Meyering
7346a03010 maint: update copyright year, bootstrap, init.sh
Run "make update-copyright" and then...

* gnulib: Update to latest.
* tests/init.sh: Update from gnulib.
* bootstrap: Likewise.
2016-01-01 18:00:08 -08:00
Jim Meyering
d77f95f8dc build: add gperf to the list of required programs
* bootstrap.conf (buildreq): Add gperf to the list.
Reported by Stephan Müller in http://debbugs.gnu.org/21945
2015-11-29 08:41:14 -08:00
Giuseppe Scrivano
04f6d57177 diff: add --palette
* bootstrap (gnulib_modules): Add 'argmatch'.
* doc/diffutils.texi: Add documentation for --palette
* src/diff.h (set_color_palette): New prototype.
* src/diff.c (set_color_palette): New function.
(color_palette): New variable.
* src/utils.c: Include "argmatch.h".
(struct bin_str): New struct.
(struct color_ext_type): New struct.
(color_indicator): New array.
(indicator_name): New array.
(indicator_no): New enum.
(parse_state): New enum.
(put_indicator): New function.
(get_funky_string): New function. Copied from coreutils ls.
(parse_diff_color):  New function. Copied from coreutils ls
"parse_ls_color" function.
(set_color_context): Use put_indicator instead of directly
outputting the sequence.
* po/POTFILES.in: Add 'lib/argmatch.c'
2015-11-29 08:20:53 -08:00
Jim Meyering
29e8de4885 maint: update copyright year ranges to include 2015; update gnulib 2015-01-01 22:31:27 -08:00
Paul Eggert
59f4ef95f8 cmp, diff, sdiff: tune by using rawmemchr
On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up
'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and
'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8.
* bootstrap.conf (gnulib_modules): Add rawmemchr.
* src/cmp.c (cmp): Optimize the common case where buffers are the same,
by using count_newlines rather than block_compare_and_count.
(block_compare_and_count): Remove.
(count_newlines): New function.
* src/cmp.c (count_newlines):
* src/io.c (prepare_text):
* src/sdiff.c (lf_copy, lf_skip, lf_snarf):
Use rawmemchr instead of memchr, for speed.
2013-08-22 15:46:27 -07:00
Paul Eggert
0c22f56ed7 maint: update build procedure to recent gettext etc.
* bootstrap.conf (gnulib_modules): Add vararrays.
(needed_gnulib_files, unnecessary_gettext_files): New vars.
(bootstrap_post_import_hook): New function, to implement these vars.
(excluded_files): Remove; 'bootstrap' no longer supports this.
Its function is now performed by unnecessary_gettext_files.
(buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386.
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2,
to lessen the probability that we'll have outlandishly old files
during a build.
* m4/vararrays.m4: Remove from repository, as we now use the
gnulib version.
2013-03-23 00:26:36 -07:00
Jim Meyering
a0483cb2fc maint: update all copyright year number ranges
Run "make update-copyright".
2013-01-04 11:13:02 +01:00
Jim Meyering
221383bcb1 maint: use xasprintf in place of xmalloc+sprintf
* bootstrap.conf (gnulib_modules): Add gnulib's xvasprintf module.
* src/util.c: Include "xvasprintf.h".
(begin_output): Use xasprintf in place of xmalloc+sprintf.
2012-09-10 14:31:35 +02:00
Paul Eggert
3549f733b9 main: port subcommands to mingw
Problem reported by Eli Zaretskii in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00013.html>.
Approach suggested by Bruno Haible as option (4) in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00036.html>.
* bootstrap.conf (gnulib_modules): Add system-quote.
* src/diff3.c, src/sdiff.c, src/util.c:
Include <system-quote.h>, not <sh-quote.h>.
* src/diff3.c (read_diff):
* src/sdiff.c (main, edit):
* src/util.c (begin_output):
Use system_quote_argv, for portability to Mingw.
* src/sdiff.c (NUM_SIGS, handler_index_of_SIGINT): Now enum
values, not macros; this is cleaner and avoids a GCC warning if
!HAVE_WORKING_VFORK.
* src/util.c (begin_output) [! HAVE_WORKING_FORK]: Do not use -f,
for consistency with the HAVE_WORKING_FORK code.
2012-05-14 23:08:59 -07:00
Paul Eggert
b2892140d8 sdiff: remove dependency on sigprocmask
* bootstrap.conf (gnulib_modules): Remove sigprocmask.
* src/sdiff.c (temporary_file): No need to invoke sigprocmask
here, since the signal handler merely sets a flag.
2012-02-12 13:08:50 -08:00
Jim Meyering
301a23cdbb build: accommodate newer bootstrap from gnulib
* bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
and --makefile-name=gnulib.mk.  Also remove now-obsolete $bt/ prefix.
* bootstrap: Update from gnulib.
* tests/init.sh: Update from gnulib.
* lib/Makefile.am: Initialize numerous variables, so that
generated code in gnulib.mk may use += to append to them.
2012-01-12 14:04:44 +01:00
Bruno Haible
e3324651cc New option --no-dereference.
* src/diff.h (no_dereference_symlinks): New variable.
* src/diff.c: Include xreadlink.h.
(longopts): Add --no-dereference option.
(main): Accept --no-dereference option.
(option_help_msgid): Mention the --no-dereference option.
(compare_files): If no_dereference_symlinks is true, use lstat()
instead of stat(). Compare symbolic links by comparing their values.
* bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
* doc/diffutils.texi (Comparing Directories, diff Options): Mention the
--no-dereference option.
* tests/no-dereference: New file.
* tests/Makefile.am (TESTS): Add it.
2012-01-08 21:26:27 +01:00
Jim Meyering
45110a7927 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 09:32:41 +01:00
Claudio Bley
7508234eab portability: use SET_BINARY rather than xfreopen (NULL, ...
* src/diff.c: Include binary-io.h, not xfreopen.h.
(main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
because the latter doesn't work on MinGW and crashes using MSVC.
* src/cmp.c (main): Likewise.
2011-10-04 13:55:49 +02:00
Paul Eggert
efb0557f4c * bootstrap.conf (gnulib_modules): Remove timegm.
This fixes a problem noted by Andreas Schwab in:
http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00035.html
2011-08-13 15:12:35 -07:00
Jim Meyering
3edb801c06 build: use largefile module and update to latest gnulib
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
* gnulib: Update to latest.
2011-08-10 10:21:14 +02:00
Paul Eggert
a3318fdbca bootstrap: Avoid multithreading.
* bootstrap.conf (gnulib_tool_option_extras):
Add "--avoid=localename --avoid=lock", because we don't want to
bring in the multithreading code that recent gnulib changes would
otherwise bring in.
(excluded_files): Remove m4/lock.m4; no longer needed, now that
we use --avoid=lock.
2011-05-27 23:41:07 -07:00
Jim Meyering
39213a3bbc maint: use gnulib's new readme-release module
* bootstrap.conf (gnulib_modules): Add readme-release.
(bootstrap_epilogue): Add the recommended perl one-liner.
* README-release: Remove file; it is now generated from gnulib.
* .gitignore: Add it.
2011-05-18 20:31:42 +02:00
Jim Meyering
0744f3339d maint: don't use now-removed gnulib "exit" module
* bootstrap.conf (gnulib_modules): Remove "exit" module.
It no longer exists.
2011-05-18 20:30:38 +02:00
Jim Meyering
ce5367b6b3 maint: update copyright year ranges to include 2011
Run "make update-copyright", so "make syntax-check" works in 2011.
2011-01-03 22:13:35 +01:00
Paul Eggert
6fc3b9737d bootstrap: adjust to recent gnulib changes
* bootstrap.conf (excluded_files): Do not exclude m4/size_max.m4
and m4/xsize.m4 when using an external gettext, since they are
now needed by other gnulib modules.
2010-12-16 10:05:44 -08:00
Jim Meyering
edf0032df4 build: use gettext-h, not gettext
* bootstrap.conf (gnulib_modules): Use gettext-h, not gettext.
The latter is overkill for a package that uses
AM_GNU_GETTEXT([external]...
2010-09-04 08:55:48 +02:00
Jim Meyering
53de393ca3 diff -r: avoid printing excess slashes in concatenated file names
* bootstrap.conf (gnulib_modules): Add filenamecat.
* src/diff.c: Include "filenamecat.h".
(compare_files): Use file_name_concat, rather than dir_file_pathname.
* src/util.c (dir_file_pathname): Remove now-unused function.
* src/diff.h: Remove its declaration.
* tests/excess-slash: New script to test for this.
* tests/Makefile.am (TESTS): Add it.
Forwarded by Santiago Vila from <bugs.debian.org/586301a>,
reported by Jari Aalto.
2010-08-14 17:15:57 -05:00
Jim Meyering
bec2cfcd8f build: don't define macros that gnulib provides
* bootstrap.conf (gnulib_modules): Add signal, stdint.
* lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions.
(SIZE_MAX, PTRDIFF_MAX): Likewise.
Include <stdint.h>.
* src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions.
(SA_RESTART, SA_INTERRUPT): Likewise.
2010-05-09 18:39:39 +02:00
Jim Meyering
6ef1f1f708 build: rely on gnulib's sigprocmask module
* src/sdiff.c: Remove #if-!HAVE_SIGPROCMASK-guarded code.
* bootstrap.conf (gnulib_modules): Add sigprocmask.
2010-05-09 18:34:09 +02:00
Jim Meyering
3f027ba48d build: use gnulib's sys_wait module
* bootstrap.conf (gnulib_modules): Use gnulib's sys_wait module,
now that we assume its presence.
2010-05-01 08:17:06 +02:00
Jim Meyering
d9c2b10e33 build: don't require a specific version of help2man
* bootstrap.conf (buildreq): Bootstrap can't deal with it,
perhaps because the command name contains a digit.
2010-03-17 16:53:17 +01:00
Jim Meyering
61fb56b314 build: make bootstrap ensure that help2man is available
* bootstrap.conf (buildreq): Add help2man.
2010-03-17 15:52:05 +01:00
Jim Meyering
6a44886e24 maint: update all FSF copyright year lists to include 2010
Use this command:
git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
2010-01-01 16:18:27 +01:00
Jim Meyering
e90c254a0e maint: don't pull in gnulib's nanosleep unnecessarily
* bootstrap.conf (gnulib_modules): Remove nanosleep.  Not needed.
Spotted by Eric Blake.
2009-11-20 22:30:41 +01:00
Jim Meyering
3b828e3223 maint: add gnulib's announce-gen module
* bootstrap.conf (gnulib_modules): Add announce-gen
2009-11-20 10:20:54 +01:00
Jim Meyering
7ebb24620d build: use more gnulib modules
* bootstrap.conf (gnulib_modules): Add mktime, nanosleep, strptime
and timegm.
2009-11-20 10:20:54 +01:00
Jim Meyering
cd10d2c308 use xfreopen rather than freopen
* src/cmp.c: Include "xfreopen.h".
Use xfreopen in place of freopen.
* src/diff.c Likewise, and...
(main): Set exit_failure to EXIT_TROUBLE, rather than to 2.
* src/diff3.c: Likewise.
* bootstrap.conf (gnulib_modules): Add xfreopen.
2009-11-20 10:20:54 +01:00
Jim Meyering
163f2fa3e8 build: enable many warnings
* configure.ac: Add support for --enable-gcc-warnings.
* bootstrap.conf (gnulib_modules): Add manywarnings.
* Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) $(WERROR_CFLAGS)
2009-11-20 10:20:54 +01:00
Jim Meyering
9b0a630024 maint: define/use PROGRAM_NAME and AUTHORS; use propername module
* bootstrap.conf (gnulib_modules): Add propername.
* src/cmp.c (PROGRAM_NAME, AUTHORS): Define.
(main): Use them in use of version_etc.
* src/diff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/diff3.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/sdiff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/system.h: Include "propername.h".
2009-11-16 22:40:47 +01:00
Jim Meyering
3504236b28 build: generate ChangeLog (from git logs) into distribution tarball
* Makefile.am (dist-hook, gen-ChangeLog): New rules.
(gen_start_date): Define.
* bootstrap.conf (gnulib_modules): Add gitlog-to-changelog.
2009-11-11 22:30:14 +01:00
Jim Meyering
08d9ddae59 build: rely on gnulib's progname module
* bootstrap.conf (gnulib_modules): Add progname.
* cfg.mk (local-checks-to-skip): Add sc_program_name.
* src/cmp.c: Include progname.h.
(program_name): Remove declaration.
(main): Call set_program_name.
* src/diff.c (main): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (main): Likewise.
* src/diff.h (program_name): Remove extern declaration.
2009-11-11 22:18:37 +01:00
Jim Meyering
0363ae9f0f build: rely on gnulib's mbrtowc module
* bootstrap.conf (gnulib_modules): Add mbrtowc.
* src/side.c [!HAVE_MBRTOWC]: Remove now-useless code,
since gnulib guarantees working <wchar.h> and mbrtowc.
* cfg.mk (local-checks-to-skip): Remove sc_prohibit_HAVE_MBRTOWC.
2009-11-11 22:18:37 +01:00
Jim Meyering
a9a19e94fb build: update build/release infrastructure
* bootstrap: Update from gnulib.
* bootstrap.conf (gnulib-modules): Add do-release-commit-and-tag,
git-version-gen, gnu-make, gnu-web-doc-update, gnumakefile, gnupload,
maintainer-makefile, update-copyright.
* gnulib-tests/Makefile.am: New file.
* cfg.mk: New file.
(local-checks-to-skip): List currently-failing tests,
so that "syntax-check" passes initially.
(manual_title): Define.
2009-11-11 22:18:17 +01:00
Paul Eggert
8983b8d904 Don't mishandle multibyte characters in side-by-side format.
Problem reported by Erik Karlsson in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00030.html>.
* bootstrap.conf (gnulib_modules): Add wcwidth.
* src/side.c: Include <wchar.h>.
(print_half_line): Compute number of bytes and print widths of
multibyte characters.  Inspired by an alternative solution from
Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00032.html>.
2009-11-11 14:08:06 +01:00
Paul Eggert
0cb3c7ffef Break out diffseq.h into a separate file, so that gettext can use
this code.  Idea from Bruno Haible.
* bootstrap.conf (gnulib_modules): Add diffseq.
* src/analyze.c (xvec, yvec, fdiag, bdiag, too_expensive, SNAKE_LIMIT):
(struct partition, diag, compareseq): Remove; now in diffseq.h.
(ELEMENT, EQUAL, OFFSET, EXTRA_CONTEXT_FIELDS, NOTE_DELETE, NOTE_INSERT):
(USE_HEURISTIC): New macros.
Include "diffseq.h".
(diff_2_files): Rewrite to use new diffseq.h interface.
2009-11-11 14:08:06 +01:00
Paul Eggert
43e4846f11 * COPYING: New file.
* AUTHORS: Update from GPLv2 to GPLv3.
* Makefile.am: Likewise.
* NEWS: Likewise.
* README: Likewise.
* README-hacking: Likewise.
* bootstrap: Likewise.
* bootstrap.conf: Likewise.
* configure.ac: Likewise.
* exgettext: Likewise.
* doc/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* lib/cmpbuf.c: Likewise.
* lib/cmpbuf.h: Likewise.
* lib/prepargs.c: Likewise.
* m4/vararrays.m4: Likewise.
* man/Makefile.am: Likewise.
* ms/Makefile.am: Likewise.
* ms/README: Likewise.
* ms/config.bat: Likewise.
* ms/config.sed: Likewise.
* ms/config.site: Likewise.
* po/POTFILES.in: Likewise.
* src/Makefile.am: Likewise.
* src/analyze.c: Likewise.
* src/cmp.c: Likewise.
* src/context.c: Likewise.
* src/diff.c: Likewise.
* src/diff.h: Likewise.
* src/diff3.c: Likewise.
* src/dir.c: Likewise.
* src/ed.c: Likewise.
* src/io.c: Likewise.
* src/normal.c: Likewise.
* src/sdiff.c: Likewise.
* src/system.h: Likewise.
* src/util.c: Likewise.
2007-07-19 17:45:29 +00:00
Paul Eggert
7f61a05614 * bootstrap.conf (gnulib_modules): Add inttypes. 2007-06-18 22:45:24 +00:00
Paul Eggert
2daf7bfa36 Modernize bootstrap procedure to match current gnulib.
* bootstrap: Sync with coreutils bootstrap, except check that
the directory build-aux exists before trying to copy to it.
* bootstrap.conf: New file.
(gnulib_modules): Add config-h, dup2, extensions, fcntl, fdl,
stat-macros, unistd.
* configure.ac: Invoke gl_EARLY and gl_INIT rather than
GNULIB_AUTOCONF_SNIPPET.
(AC_CONFIG_HEADER): Rename config.h to lib/config.h.
(AC_CHECK_HEADERS_ONCE): Don't check for fcntl.h, locale.h,
sys/file.h, unistd.h.  We now use the fcntl and unistd modules,
and locale.h can be assumed for any C89 compiler.
(DIFFUTILS_PREREQUISITES): Remove.  No longer needed now that
we use the stdint module.
(AC_CHECK_FUNCS_ONCE): Remove dup2, which is no longer needed
now that we use the dup2 module.
(AM_GNU_GETTEXT): Use need-formatstring-macros, and ...
(AM_GNU_GETTEXT_VERSION): specify version 0.15 instead of 0.14.5,
to be consistent with coreutils.
* lib/Makefile.am (noinst_LIBRARIES):
(lib_SOURCES, libdiffutils_a_LIBADD):
(libdiffutils_a_DEPENDENCIES, BUILT_SOURCES, EXTRA_DIST):
(MOSTLYCLEANFILES): Remove; now computed automatically.
(noinst_HEADERS, libdiffutils_a_SOURCES): Just append
our special files now.
* lib/cmpbuf.c: Include config.h unconditionally, since we
no longer define HAVE_CONFIG_H.
* lib/prepargs.c: Likewise.
* src/Makefile.am (LDADD): Use $(LIBINTL), not @LIBINTL@.
(diff_LDADD): Use $(LIB_CLOCK_GETTIME), not @LIB_CLOCK_GETTIME@.
* src/dir.c (dir_read): Use _D_EXACT_NAMLEN, not NAMELEN.
* src/system.h (volatile): Remove, since we assume C89 or better.
Include stat-macros.h.
(S_IRWXU, S_IRWXG, S_IRWXO, S_IRUSR, S_IWUSR):
Remove, since we now use stat-macros.h.
(SEEK_SET, SEEK_CUR): Remove, since we assume C89 or better.
Include unistd.h unconditionally, since we use unistd.
Likewise for fcntl.h.
(dup2): Remove, since we now use dup2.
(O_RDONLY, O_RWDR, O_BINARY): Remove, since we now use
fcntl.
Include dirent.h unconditionally.
(NAMLEN): Remove, replacing with....
(_D_EXACT_NAMLEN): New macro.
Include inttypes.h unconditionally.
(PTRDIFF_MAX, SIZE_MAX, UINTMAX_MAX, strtoumax): Remove, since
we now use inttypes.
Include locale.h unconditionally.
(setlocale): Remove, since we now assume locale.h.
2006-09-05 22:57:29 +00:00