Message-Id: <201310292256.r9TMukfj024763@delorie.com> Date: Wed, 30 Oct 2013 00:27:01 +0100 From: Juan Manuel Guerrero To: djgpp-announce AT delorie DOT com Subject: ANNOUNCE: DJGPP port of GNU grep 2.15 uploaded. (DJGPP 2.04 only) Content-Type: text/plain; charset=ISO-8859-15; format=flowed Reply-To: djgpp AT delorie DOT com This is a port of GNU grep 2.15 to MSDOS/DJGPP. This is GNU grep, the "fastest grep in the west". GNU grep is based on a fast lazy-state deterministic matcher (about twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper search for a fixed string that eliminates impossible text from being considered by the full regexp matcher without necessarily having to look at every character. The result is typically many times faster than Unix grep or egrep. (Regular expressions containing back-referencing will run more slowly, however.) DJGPP specific changes. ======================= DJGPP specific changes are those required to implement colorization support for this port. If grep is called with the command line option --color and the output is directed to the screen then the default colors will be used to mark matches, file names and line numbers. If the output does not go to the screen then colorization is automatically suppressed. Read the docs to learn how to control the color using the environment variable GREP_COLORS. As usual all changes are documented in the diffs file that is stored in the /djgpp directory. Please note that to run the test suite produced with autoconf 2.64 and later you must install mktmp17br2 or later. Because the test suite also tries to test multibyte patterns but multibyte strings are not fully supported by DJGPP some tests will be skipped or fail. The yesno test is known to fail, so please do not report it. Before starting the test suite, please make sure to unset the GREP_OPTIONS in djgpp.env or the test suite may not work as expected. The grep program uses a new method called fts to traverse a file tree. This code is very posix centric, especially it uses gnulib functions like openat, openat-proc and fdopendir that try to access directories using file descriptors with open(). This is only supported by djdev204 but not by djdev203. This means that if grep is compiled using djdev203, the program will no longer be able neither to recurse directories nor will be able to follow symlinks. This is because djdev203 only produces symlinks for programs. In both cases grep will always terminated with ENOSYS. grep211 was probably the last DJGPP port of grep compiled with djdev203. Please also note that there is a function name clash between gnulib's and grep's gettext wrapper and djgpp's old BORLAND compatibility gettext function declared in conio.h. This issue has been solved in djdev204. To solve the problem for djdev203, I provide the patch /djgpp/conio.patch that will change djdev203's conio.h accordingly to djdev204 conio.h. After this change the name clash will be solved in the same way as it has been solved for djdev204. The patch only concerns this name clash. This port has been configured with perl-regexp (pcre) support enabled. This means that you will have to install pcre libray available as: ftp://ftp.delorie.com/pub/djgpp/current/v2tk/pcre833b.zip or ftp://ftp.delorie.com/pub/djgpp/beta/v2tk/pcre833b.zip if you decide to compile the the preconfigured sources. If you prefer to disable the pcre support you will have to reconfigure and recompile the sources again, but this time passing the "no-pcre" command line option to config.bat. The grep215b.zip file contains only the one build with perl-regexp support enabled. This port has no wide character/multi byte support at all. To build this port and run the test suite you will need LFN support. Please note that the test suite also runs a lot of gnulib tests that will all fail. I have no intention to fix them. The source package is configured to be build in the "_build.204" directory. For further information about GNU grep please read the info docs and NEWS file. This is an verbatim extract of the NEWS file: ------------------------------------------------------------------------------- * Noteworthy changes in release 2.15 (2013-10-26) [stable] ** Bug fixes grep's \s and \S failed to work with multi-byte white space characters. For example, \s would fail to match a non-breaking space, and this would print nothing: printf '\xc2\xa0' | LC_ALL=en_US.UTF-8 grep '\s' A related bug is that \S would mistakenly match an invalid multibyte character. For example, the following would match: printf '\x82\n' | LC_ALL=en_US.UTF-8 grep '^\S$' [bug present since grep-2.6] grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin) when converting an input string containing certain 4-byte UTF-8 sequences to lower case. The conversions to wchar_t and back to a UTF-8 multibyte string did not take surrogate pairs into account. [bug present since at least grep-2.6, though the segfault is new with 2.13] grep -E would segfault when given a regexp like '([^.]*[M]){1,2}' for any multibyte character M. [bug introduced in grep-2.6, which would segfault, but 2.7 and 2.8 had no problem, and 2.9 through 2.14 would hit a failed assertion. ] grep -F would get stuck in an infinite loop when given a search string that is an invalid byte sequence in the current locale and that matches the bytes of the input twice on a line. Now grep fails with exit status 1. grep -P could misbehave. While multi-byte mode is only supported by PCRE with UTF-8 locales, grep did not activate it. This would cause failures to match multibyte characters against some regular expressions, especially those including the '.' or '\p' metacharacters. ** New features grep -P can now use a just-in-time compiler to greatly speed up matches, This feature is transparent to the user; no flag is required to enable it. It is only available if the corresponding support in the PCRE library is detected when grep is compiled. ------------------------------------------------------------------------------- The port has been compiled using stock djdev204 from the /beta directory and consists of three packages that can be downloaded from ftp.delorie.com and mirrors as (time stamp 2013-10-29): grep 2.15 binaries, info and man format documentation: ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/grep215b.zip grep 2.15 dvi, html, pdf and ps format documentation: ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/grep215d.zip grep 2.15 source: ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/grep215s.zip Send grep specific bug reports to . Send suggestions and bug reports concerning the DJGPP port to comp.os.msdos.djgpp or . If you are not sure if the failure is really a grep failure or a djgpp specific failure, report it here and *not* to . Enjoy. Guerrero, Juan Manuel