Package: grep
Version: 2.12-2
Severity: normal

The behavior of --exclude-dir changed between squeeze
(2.6.3-3+squeeze1) and wheezy (2.12-2).  The new behavior is present
in the current unstable version as well (2.16-1).

A test script is attached.  Tests 4,6,7,8,11,12 produce different
results between squeeze's grep and the newer versions.  I can't see
any reason why the change in behavior would be desirable, and it makes
many (probably most) uses of --exclude-dir impossible.  In particular
the new behavior doesn't allow --exclude-dir patterns to match on
parent directories, so for example you can't distinguish between
/usr/share/doc and /usr/local/share/doc, you can only exclude "doc" or
"*doc*".

I'm assuming this is an unintentional bug, but if not then consider
this a wishlist item for the prior behavior, especially being able to
match on parent directories.  Also, the change should be documented
clearly in the Debian changelog and apt-listchanges since it can break
scripts relying on the prior behavior.



-- System Information:
Debian Release: 7.4
  APT prefers stable-updates
    APT policy: (500, 'stable-updates'), (500, 'stable')
    Architecture: i386 (i686)

    Kernel: Linux 2.6.32-5-686-bigmem (SMP w/2 CPU cores)
    Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
    Shell: /bin/sh linked to /bin/bash

    Versions of packages grep depends on:
    ii  dpkg          1.16.12
    ii  install-info  4.13a.dfsg.1-10
    ii  libc6         2.13-38+deb7u1

    grep recommends no packages.

    Versions of packages grep suggests:
    ii  libpcre3  1:8.30-5

    -- no debconf information

Attachment: test_grep_exclude_dir.sh
Description: Bourne shell script

Reply via email to