Commit graph

27 commits

Author SHA1 Message Date
jperkin
e30f99bbe9 grep: Avoid conflict with sys/limits.h guard. 2019-12-19 09:36:33 +00:00
rhialto
e1b4eb99d6 textproc/grep: update to 3.3
* Noteworthy changes in release 3.3 (2018-12-20) [stable]

** Bug fixes

  Some uses of \b in the C locale and with the DFA matcher would fail, e.g.,
  the following would print nothing (it should print the input line):
    echo 123-x|LC_ALL=C grep '.\bx'
  Using a multibyte locale, using certain regexp constructs (some ranges,
  backreferences), or forcing use of the PCRE matcher via --perl-regexp (-P)
  would avoid the bug.
  [bug introduced in grep 2.3]


* Noteworthy changes in release 3.2 (2018-12-20) [stable]

** Changes in behavior

  The --files-without-match (-L) option now causes grep to succeed
  when a file is listed, instead of when a line is selected.  This
  resembles what git-grep does.

** Bug fixes

  The --recursive (-r) option no longer fails on MS-Windows.
  [bug introduced in grep 2.11]

** Improvements

  An over-30x performance improvement when many 'or'd expressions
  share a common prefix, thanks to improvements in gnulib's dfa.c,
  by Norihiro Tanaka.  See gnulib commits v0.1-2110-ge648401be,
  v0.1-2111-g4299106ce, v0.1-2117-g617a60974

  An additional 3-23% speed-up when searching large files, via
  increased initial buffer size.

  grep now diagnoses stack overflow.  Before grep-2.6, the included
  regexp code would detect it.  Since 2.6, grep defaulted to using
  glibc's regexp, which lost that capability.
2019-12-15 21:12:33 +00:00
jperkin
84901f551d grep: Ensure we use the correct path to PKGGNUDIR grep.
Remove pointless patch-src_Makefile.am.  Bump PKGREVISION.
2019-06-11 10:17:28 +00:00
adam
6b8157e331 release 3.1:
** Improvements

  grep '[0-9]' is now just as fast as grep '[[:digit:]]' when run
  in a multi-byte locale.  Before, it was several times slower.

** Changes in behavior

  Context no longer excludes selected lines omitted because of -m.
  For example, 'grep "^" -m1 -A1' now outputs the first two input
  lines, not just the first line.  This fixes a glitch that has been
  present since -m was added in grep 2.5.

  The following changes affect only MS-Windows platforms.  First, the
  --binary (-U) option now governs whether binary I/O is used, instead
  of a heuristic that was sometimes incorrect.  Second, the
  --unix-byte-offsets (-u) option now has no effect on MS-Windows too.
2017-08-18 21:51:40 +00:00
ryoon
7eb274252d Update to 3.0
Changelog:
* Noteworthy changes in release 3.0 (2017-02-09) [stable]

** Bug fixes

  grep without -F no longer goes awry when given two or more patterns
  that contain no special characters other than '\' and also contain a
  subpattern like '\.' that escapes a character to make it ordinary.
  [bug introduced in grep 2.28]

  grep no longer fails to build on PCRE versions before 8.20.
  [bug introduced in grep 2.28]


* Noteworthy changes in release 2.28 (2017-02-06) [stable]

** Bug fixes

  When grep -Fo finds matches of differing length, it could
  mistakenly print a shorter one.  Now it prints a longest one.
  [bug introduced in grep-2.26]

  When standard output is /dev/null, grep no longer fails when
  standard input is a file in the Linux /proc file system, or when
  standard input is a pipe and standard output is in append mode.
  [bugs introduced in grep-2.27]

  Fix performance regression with multiple patterns, e.g., for -Fi in
  a multi-byte locale, or for -Fw in a single-byte locale.
  [bugs introduced in grep-2.19, grep-2.22 and grep-2.26]

** Improvements

  Improve performance for -E or -G pattern lists that are easily
  converted to -F format.
2017-03-30 19:23:17 +00:00
bouyer
8b7c148f4e Use absolute paths in /usr/pkg/bin/g*grep, so they can be used even if
/usr/pkg/bin/ is not in $PATH.
Bump PKGREVISION
From Tim Zingelman
2017-03-30 08:52:54 +00:00
wen
8ff8cbe986 Update to 2.27
Upstream changes:
* Noteworthy changes in release 2.27 (2016-12-06) [stable]

** Bug fixes

  grep no longer reports a false match in a multibyte, non-UTF8 locale
  like zh_CN.gb18030, with a regular expression like ".*7" that just
  happens to match the 4-byte representation of gb18030's \uC9, the
  final byte of which is the digit "7".
  [bug introduced in grep-2.19]

  grep by default now reads all of standard input if it is a pipe,
  even if this cannot affect grep's output or exit status.  This works
  better with nonportable scripts that run "PROGRAM | grep PATTERN
  >/dev/null" where PROGRAM dies when writing into a broken pipe.
  [bug introduced in grep-2.26]

  grep no longer mishandles ranges in nontrivial unibyte locales.
  [bug introduced in grep-2.26]

  grep -P no longer attempts multiline matches.  This works more
  intuitively with unusual patterns, and means that grep -Pz no longer
  rejects patterns containing ^ and $ and works when combined with -x.
  [bugs introduced in grep-2.23] A downside is that grep -P is now
  significantly slower, albeit typically still faster than pcregrep.

  grep -m0 -L PAT FILE now outputs "FILE".  [bug introduced in grep-2.5]

  To output ':' and tab-align the following character C, grep -T no
  longer outputs tab-backspace-':'-C, an approach that has problems if
  run inside an Emacs shell window.  [bug introduced in grep-2.5.2]

  grep -T now uses worst-case widths of line numbers and byte offsets
  instead of guessing widths that might not work with larger files.
  [bug introduced in grep-2.5.2]

  grep's use of getprogname no longer causes a build failure on HP-UX.

** Improvements

  grep no longer reads the input in a few more cases when it is easy
  to see that matching cannot succeed, e.g., 'grep -f /dev/null'.


* Noteworthy changes in release 2.26 (2016-10-02) [stable]

** Bug fixes

  Grep no longer omits output merely because it follows an output line
  suppressed due to encoding errors.  [bug introduced in grep-2.21]

  In the Shift_JIS locale, grep no longer mistakenly matches in the
  middle of a multibyte character. [bug present since "the beginning"]

** Improvements

  grep can be much faster now when standard output is /dev/null.

  grep -F is now typically much faster when many patterns are given,
  as it now uses the Aho-Corasick algorithm instead of the
  Commentz-Walter algorithm in that case.

  grep -iF is typically much faster in a multibyte locale, if the
  pattern and its case counterparts contain only single byte characters.

  grep with complicated expressions (e.g., back-references) and without
  -i now uses the regex fastmap for better performance.

  In multibyte locales, grep now handles leading "." in patterns more
  efficiently.

  grep now prints a "FILENAME:LINENO: " prefix when diagnosing an
  invalid regular expression that was read from an '-f'-specified file.


* Noteworthy changes in release 2.25 (2016-04-21) [stable]

** Bug fixes

  In the C or POSIX locale, grep now treats all bytes as valid
  characters even if the C runtime library says otherwise.  The
  revised behavior is more compatible with the original intent of
  POSIX, and the next release of POSIX will likely make this official.
  [bug introduced in grep-2.23]

  grep -Pz no longer mistakenly diagnoses patterns like [^a] that use
  negated character classes. [bug introduced in grep-2.24]

  grep -oz now uses null bytes, not newlines, to terminate output lines.
  [bug introduced in grep-2.5]

** Improvements

  grep now outputs details more consistently when reporting a write error.
  E.g., "grep: write error: No space left on device" rather than just
  "grep: write error".
2017-01-30 04:46:13 +00:00
ryoon
be41f935f6 Update to 2.24
Changelog:
* Noteworthy changes in release 2.24 (2016-03-10) [stable]

** Bug fixes

  grep -z would match strings it should not.  To trigger the bug, you'd
  have to use a regular expression including an anchor (^ or $) and a
  feature like a range or a backreference, causing grep to forego its DFA
  matcher and resort to using re_search.  With a multibyte locale, that
  matcher could mistakenly match a string containing a newline.
  For example, this command:
    printf 'a\nb\0' | LC_ALL=en_US.utf-8 grep -z '^[a-b]*b'
  would mistakenly match and print all four input bytes.  After the fix,
  there is no match, as expected.
  [bug introduced in grep-2.7]

  grep -Pz now diagnoses attempts to use patterns containing ^ and $,
  instead of mishandling these patterns.  This problem seems to be
  inherent to the PCRE API; removing this limitation is on PCRE's
  maint/README wish list.  Patterns can continue to match literal ^
  and $ by escaping them with \ (now needed even inside [...]).
  [bug introduced in grep-2.5]
2016-03-14 13:16:31 +00:00
ryoon
363c73c27d Update to 2.23
Changelog:
* Noteworthy changes in release 2.23 (2016-02-04) [stable]

** Bug fixes

  Binary files are now less likely to generate diagnostics and more
  likely to yield text matches.  grep now reports "Binary file FOO
  matches" and suppresses further output instead of outputting a line
  containing an encoding error; hence grep can now report matching text
  before a later binary match.  Formerly, grep reported FOO to be
  binary when it found an encoding error in FOO before generating
  output for FOO, which meant it never reported both matching text and
  matching binary data; this was less useful for searching text
  containing encoding errors in non-matching lines.
  [bug introduced in grep-2.21]

  grep -c no longer stops counting when finding binary data.
  [bug introduced in grep-2.21]

  grep no longer outputs encoding errors in unibyte locales.
  For example, if the byte '\x81' is not a valid character in a
  unibyte locale, grep treats the byte as binary data.
  [bug introduced in grep-2.21]

  grep -oP is no longer susceptible to an infinite loop when processing
  invalid UTF8 just before a match.
  [bug introduced in grep-2.22]

  --exclude and related options are now matched against trailing
  parts of command-line arguments, not against the entire arguments.
  This partly reverts the --exclude-related change in 2.22.
  [bug introduced in grep-2.22]

  --line-buffer is no longer ineffective when combined with -l.
  [bug introduced in grep-2.5]

  -xw is now equivalent to -x more consistently, with -P and with backrefs.
  [bug only partially fixed in grep-2.19]
2016-02-12 23:28:43 +00:00
ryoon
cb0b65eca2 Update to 2.22
Changelog:
* Noteworthy changes in release 2.22 (2015-11-01) [stable]

** Improvements

  Performance has improved for patterns containing very long strings,
  reducing preprocessing time for an N-byte regexp from O(N^2) to
  only slightly superlinear for most patterns.  Before, a command like
  the following would take over a minute, but now, it takes less than
  a second:
  : | grep -f <(seq -s '' 99999)

  When building grep, 'configure' now uses PCRE's pkg-config module for
  configuration information, rather than attempting to guess it by hand.

** Bug fixes

  A DFA matcher bug made this command mistakenly print its input line:
    echo axb | grep -E '^x|x$'
  Likewise for this equivalent command:
    echo axb | grep -e '^x' -e 'x$'
  [bug introduced in grep-2.19 ]

  grep no longer reads from uninitialized memory or from beyond the end
  of the heap-allocated input buffer.  This fix addressed CVE-2015-1345.
  [bug introduced in grep-2.19 ]

  With -z, '.' and '[^x]' in a pattern now consistently match newline.
  Previously, they sometimes matched newline, and sometimes did not.
  [bug introduced in grep-2.4]

  When the JIT stack is exhausted, grep -P now grows the stack rather
  than reporting an internal PCRE error.

  'grep -D skip PATTERN FILE' no longer hangs if FILE is a fifo.
  [bug introduced in grep-2.12]

  --exclude and related options are now matched against entire
  command-line arguments, not against command-line components.
  [bug introduced in grep-2.6]

  Fix performance degradation of grep -Fw in unibyte locales.
  [bug introduced in grep-2.19 ]
2015-11-20 19:04:49 +00:00
agc
2eddae48e5 Add SHA512 digests for distfiles for textproc category
Problems found locating distfiles:
	Package cabocha: missing distfile cabocha-0.68.tar.bz2
	Package convertlit: missing distfile clit18src.zip
	Package php-enchant: missing distfile php-enchant/enchant-1.1.0.tgz

Otherwise, existing SHA1 digests verified and found to be the same on
the machine holding the existing distfiles (morden).  All existing
SHA1 digests retained for now as an audit trail.
2015-11-04 01:59:17 +00:00
ryoon
baea9fbd36 Update to 2.21
Changelog:
* Noteworthy changes in release 2.21 (2014-11-23) [stable]

** Improvements

  Performance has been greatly improved for searching files containing
  holes, on platforms where lseek's SEEK_DATA flag works efficiently.

  Performance has improved for rejecting data that cannot match even
  the first part of a nontrivial pattern.

  Performance has improved for very long strings in patterns.

  If a file contains data improperly encoded for the current locale,
  and this is discovered before any of the file's contents are output,
  grep now treats the file as binary.

  grep -P no longer reports an error and exits when given invalid UTF-8 data.
  Instead, it considers the data to be non-matching.

** Bug fixes

  grep no longer mishandles patterns that contain \w or \W in multibyte
  locales.

  grep would fail to count newlines internally when operating in non-UTF8
  multibyte locales, leading it to print potentially many lines that did
  not match.  E.g., the command, "seq 10 | env LC_ALL=zh_CN src/grep -n .."
  would print this:
  1:1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  implying that the match, "10" was on line 1.
  [bug introduced in grep-2.19]

  grep -F -x -o no longer prints an extra newline for each match.
  [bug introduced in grep-2.19]

  grep in a non-UTF8 multibyte locale could mistakenly match in the middle
  of a multibyte character when using a '^'-anchored alternate in a pattern,
  leading it to print non-matching lines.  [bug present since "the beginning"]

  grep -F Y no longer fails to match in non-UTF8 multibyte locales like
  Shift-JIS, when the input contains a 2-byte character, XY, followed by
  the single-byte search pattern, Y.  grep would find the first, middle-
  of-multibyte matching "Y", and then mistakenly advance an internal
  pointer one byte too far, skipping over the target "Y" just after that.
  [bug introduced in grep-2.19]

  grep -E rejected unmatched ')', instead of treating it like '\)'.
  [bug present since "the beginning"]

  On NetBSD, grep -r no longer reports "Inappropriate file type or format"
  when refusing to follow a symbolic link.
  [bug introduced in grep-2.12]

** Changes in behavior

  The GREP_OPTIONS environment variable is now obsolescent, and grep
  now warns if it is used.  Please use an alias or script instead.

  In locales with multibyte character encodings other than UTF-8,
  grep -P now reports an error and exits instead of misbehaving.

  When searching binary data, grep now may treat non-text bytes as
  line terminators.  This can boost performance significantly.

  grep -z no longer automatically treats the byte '\200' as binary data.

* Noteworthy changes in release 2.20 (2014-06-03) [stable]

** Bug fixes

  grep --max-count=N FILE would no longer stop reading after the Nth match.
  I.e., while grep would still print the correct output, it would continue
  reading until end of input, and hence, potentially forever.
  [bug introduced in grep-2.19]

  A command like echo aa|grep -E 'a(b$|c$)' would mistakenly
  report the input as a matched line.
  [bug introduced in grep-2.19]

** Changes in behavior

  grep --exclude-dir='FOO/' now excludes the directory FOO.
  Previously, the trailing slash meant the option was ineffective.
2014-11-25 20:19:03 +00:00
adam
983e4a3ab6 Changes 2.19:
** Improvements

  Performance has improved, typically by 10% and in some cases by a
  factor of 200.  However, performance of grep -P in UTF-8 locales has
  gotten worse as part of the fix for the crashes mentioned below.

** Bug fixes

  grep no longer mishandles patterns like [a-[.z.]], and no longer
  mishandles patterns like [^a] in locales that have multicharacter
  collating sequences so that [^a] can match a string of two characters.

  grep no longer mishandles an empty pattern at the end of a pattern list.
  [bug introduced in grep-2.5]

  grep -C NUM now outputs separators consistently even when NUM is zero,
  and similarly for grep -A NUM and grep -B NUM.
  [bug present since "the beginning"]

  grep -f no longer mishandles patterns containing NUL bytes.
  [bug introduced in grep-2.11]

  Plain grep, grep -E, and grep -F now treat encoding errors in patterns
  the same way the GNU regular expression matcher treats them, with respect
  to whether the errors can match parts of multibyte characters in data.
  [bug present since "the beginning"]

  grep -w no longer mishandles a potential match adjacent to a letter that
  takes up two or more bytes in a multibyte encoding.
  Similarly, the patterns '\<', '\>', '\b', and '\B' no longer
  mishandle word-boundary matches in multibyte locales.
  [bug present since "the beginning"]

  grep -P now reports an error and exits when given invalid UTF-8 data.
  Previously it was unreliable, and sometimes crashed or looped.
  [bug introduced in grep-2.16]

  grep -P now works with -w and -x and backreferences. Before,
  echo aa|grep -Pw '(.)\1' would fail to match, yet
  echo aa|grep -Pw '(.)\2' would match.

  grep -Pw now works like grep -w in that the matched string has to be
  preceded and followed by non-word components or the beginning and end
  of the line (as opposed to word boundaries before).  Before, this
  echo a@@a| grep -Pw @@ would match, yet this
  echo a@@a| grep -w @@ would not.  Now, they both fail to match,
  per the documentation on how grep's -w works.

  grep -i no longer mishandles patterns containing titlecase characters.
  For example, in a locale containing the titlecase character
  'Lj' (U+01C8 LATIN CAPITAL LETTER L WITH SMALL LETTER J),
  'grep -i Lj' now matches both 'LJ' (U+01C7 LATIN CAPITAL LETTER LJ)
  and 'lj' (U+01C9 LATIN SMALL LETTER LJ).
2014-05-27 06:31:28 +00:00
adam
ddbf0f12c4 Changes 2.18:
Bug fixes:
* grep no longer mishandles patterns like [^^-~] in unibyte locales.
* grep -i in a multibyte, non-UTF8 locale could be up to 200 times slower
    than in 2.16.
2014-02-23 15:30:31 +00:00
adam
82d618b9bc Changes 2.16:
** Bug fixes

  Fix gnulib-provided maint.mk so that the release procedure described
  in README-release actually does what we want.  Before that fix, that
  procedure resulted in a grep-2.15 tarball that would lead to a grep
  binary whose --version-reported version number was 2.14.51...

  The fix to make \s and \S work with multi-byte white space broke
  the use of each shortcut whenever followed by a repetition operator.
  For example, \s*, \s+, \s? and \s{3} would all malfunction in a
  multi-byte locale.  [bug introduced in grep-2.15]

  The fix to make grep -P work better with UTF-8 made it possible for
  grep to evoke a larger set of PCRE errors, some of which could trigger
  an abort.  E.g., this would abort:
    printf '\x82'|LC_ALL=en_US.UTF-8 grep -P y
  Now grep handles arbitrary PCRE errors.  [bug introduced in grep-2.15]

  Handle very long lines (2GiB and longer) on systems with a deficient
  read system call.
2014-01-11 10:52:09 +00:00
wiz
9efd1a7194 Update to 2.15:
* 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.
2013-10-27 23:22:54 +00:00
adam
b0990acd9b Changes 2.14:
** Bug fixes

  grep -i '^$' could exit 0 (i.e., report a match) in a multi-byte locale,
  even though there was no match, and the command generated no output.
  E.g., seq 2 | LC_ALL=en_US.utf8 grep -il '^$' would mistakenly print
  "(standard input)".  Related, seq 9 | LC_ALL=en_US.utf8 grep -in '^$'
  would print "2:4:6:8:10:12:14:16" and exit 0.  Now it prints nothing
  and exits with status of 1.  [bug introduced in grep-2.6]

  'grep' no longer falsely reports text files as being binary on file
  systems that compress contents or that store tiny contents in metadata.
2012-08-21 18:04:58 +00:00
adam
e214046dee Changes 2.13:
** Bug fixes
  grep -i, in a multi-byte locale, when matching a line containing a character
  like the UTF-8 Turkish I-with-dot (U+0130) (whose lower-case representation
  occupies fewer bytes), would print an incomplete output line.
  Similarly, with a matched line containing a character (e.g., the Latin
  capital I in a Turkish UTF-8 locale), where the lower-case representation
  occupies more bytes, grep could print garbage.
  [bug introduced in grep-2.6]

  --include and --exclude can again be combined, and again apply to
  the command line, e.g., "grep --include='*.[ch]' --exclude='system.h'
  PATTERN *" again reads all *.c and *.h files except for system.h.
  [bug introduced in grep-2.6]

** New features
  'grep' without -z now treats a sparse file as binary, if it can
  easily determine that the file is sparse.

** Dropped features
  Bootstrapping with Makefile.boot has been broken since grep 2.6,
  and was removed.
2012-08-03 13:07:54 +00:00
tnn
b2a41f8ca2 MIPSPro doesn't like code such as:
void foo(void) {}
void bar(void) { return foo(); }

Stripping away the return makes it happy. PR pkg/38210.
2008-03-11 02:18:22 +00:00
tnn
9edc6b3ed2 Update to grep-2.5.3.
Main changes are move to GPLv3 and several updated translations.
Also some bugfixes (at least the ones we had patched in pkgsrc).
Sorry, not more specific because NEWS isn't properly maintained.
2008-03-08 12:16:43 +00:00
agc
c71cac836a Add RMD160 digests to the SHA1 ones. 2005-02-24 14:48:39 +00:00
bouyer
41084745a7 Apply patch from
http://lists.gnu.org/archive/html/bug-gnu-utils/2002-03/msg00359.html
requested by Georg Schwarz in private mail: make it compile with non-gcc
compilers.
2004-07-06 20:36:58 +00:00
wiz
dddf2f9000 Update to 2.5.1nb2:
Use the right grep binary in fgrep and egrep shell scripts.
Patch provided by Nicolas Fugier in PR 20905.
2003-09-18 19:13:50 +00:00
wiz
e4fd449600 Update to 2.5.1: bugfix release. 2003-02-13 07:33:34 +00:00
wiz
c17a6f3611 Use .tar.bz2. 2002-12-25 19:54:58 +00:00
wiz
b863e90ee3 Honor GNU_PROGRAM_PREFIX, patch by Jeremy C. Reed.
While here: Fix build on NetBSD-current.
2002-12-25 19:50:34 +00:00
bouyer
fb90c42c04 Package for GNU grep 2.5. 2002-10-14 16:43:14 +00:00