Bug 13115 - tar --exclude and --exclude-from broken
tar --exclude and --exclude-from broken
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: tar (Show other bugs)
6.2
i386 Linux
high Severity high
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-27 12:14 EDT by Kars de Jong
Modified: 2014-01-21 17:48 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-06-27 12:20:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kars de Jong 2000-06-27 12:14:29 EDT
The tar versions in RedHat 6.1 and 6.2 have problems with exclusions and
wildcards. I will give an example, this is much easier.
File tree looks like this:

cmds/
cmds/RCS/
cmds/RCS/bing.c,v
cmds/bing.c
cmds/living/
cmds/living/RCS/
cmds/living/RCS/bing2.c,v
cmds/living/bing2.c

bash$ tar -cf - --exclude '*/RCS*' cmds | tar -tf -
cmds/
cmds/bing.c
cmds/living/
cmds/living/RCS/
cmds/living/RCS/bing2.c,v
cmds/living/bing2.c
bash$ tar -cf - --exclude '*/RCS/*' cmds | tar -tf -
cmds/
cmds/RCS/
cmds/bing.c
cmds/living/
cmds/living/RCS/
cmds/living/RCS/bing2.c,v
cmds/living/bing2.c
bash$

When the tree is one deep it does work, however deeper recursion doesn't.
Tar version 1.12 from RedHat 6.0 works fine.
Comment 1 Kars de Jong 2000-06-27 12:20:39 EDT
Hm, now that I look at ALL tar bugs (instead of only the ones for 6.2) I see it
has been reported twice already. How about a fix or downgrade?
Comment 2 Bernhard Rosenkraenzer 2000-07-10 16:39:51 EDT
According to the GNU tar maintainers, this is not a bug but intended
(POSIXly-correct) behavior.
Comment 3 Seth Vidal 2002-03-15 00:29:50 EST
curiously this bug isn't QUITE compliant with what they are claiming.

if I have a dir tree like:
home
home/skvidal
home/skvidal/.netscape
home/skvidal/.netscape/cache
home/skvidal/.netscape/cache/not
home/skvidal/.netscape/cache/this
home/skvidal/.mozilla
home/skvidal/.mozilla/cache
home/skvidal/.mozilla/cache/neither
home/skvidal/la.mp3
home/skvidal/lalaal.mp3

if I have an exclude file that looks like:
.netscape/cache
*.mp3

then the mp3's will be excluded but the .netscape/cache dir will not be excluded

if I change the exclude file to look like:
cache
*.mp3

then it will exclude all files/dirs named cache and all .mp3 files.

I looked through the source and it appears that they have a specific allowance
for files containing slashes but I think its just not working.




Note You need to log in before you can comment on or make changes to this bug.