Bug 13115 - tar --exclude and --exclude-from broken
Summary: tar --exclude and --exclude-from broken
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tar
Version: 6.2
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-27 16:14 UTC by Kars de Jong
Modified: 2014-01-21 22:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-06-27 16:20:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Kars de Jong 2000-06-27 16:14:29 UTC
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 16:20:39 UTC
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 20:39:51 UTC
According to the GNU tar maintainers, this is not a bug but intended
(POSIXly-correct) behavior.

Comment 3 Seth Vidal 2002-03-15 05:29:50 UTC
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.