bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Option --exclude-ignore behaves unexpectedly


From: Chris Marusich
Subject: [Bug-tar] Option --exclude-ignore behaves unexpectedly
Date: Fri, 04 Nov 2016 23:22:55 -0700

Hi,

I've noticed that the --exclude-ignore option to tar behaves in a way I
didn't expect.  I've attached a script you can run in a clean temporary
directory to demonstrate this.  Here's what I see when I copy the script
into an empty directory, cd into that directory, and run it:

--8<---------------cut here---------------start------------->8---
Before:
a:
b  exclusions

a/b:
c

Tarball contents:
a/
a/exclusions
a/b/
--8<---------------cut here---------------end--------------->8---

My understanding is that the file specified by --exclude-ignore only
applies to the directory it's in, so I expected a result like the
following:

--8<---------------cut here---------------start------------->8---
Tarball contents:
a/
a/exclusions
a/b/
a/b/c
--8<---------------cut here---------------end--------------->8---

The behavior I expected seems to be in line with the manual, which says
the following ((tar) Option Summary):

--8<---------------cut here---------------start------------->8---
'--exclude-ignore=FILE'
     Before dumping a directory, 'tar' checks if it contains FILE.  If
     so, exclusion patterns are read from this file.  The patterns
     affect only the directory itself.  *Note exclude::.
--8<---------------cut here---------------end--------------->8---

However, that isn't the behavior I've observed.  Instead, it looks like
tar has excluded c, even though the file specified by --exclude-ignore
should have only applied to directory a, not to its child directory b.

Is the behavior I've observed intended?  Based on what the manual says,
I suspect it isn't.

-- 
Chris Marusich

Attachment: problem.sh
Description: Bourne shell script

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]