Upstream indicates that that exclude options are now position dependent. Exchanging the order of the include and excludes options gives the desired behaviour with tar 1.29-1:

$ tar zcvvfXT - excludes includes > /dev/null
drwxrwx--- ben/ben 0 2016-05-21 14:39 base/
drwxrwx--- ben/ben 0 2016-05-21 14:40 base/dir-1/
-rw-rw---- ben/ben 0 2016-05-21 14:40 base/dir-1/file-1

See:
http://lists.gnu.org/archive/html/bug-tar/2016-05/msg00022.html
http://lists.gnu.org/archive/html/bug-tar/2016-05/msg00023.html

-------- Forwarded Message --------
Subject: Re: [Bug-tar] tar 1.29 bug: tar ignores --exclude option
Date: Wed, 25 May 2016 15:35:30 +1200
From: Ben Caradoc-Davies <b...@transient.nz>
To: Sergey Poznyakoff <g...@gnu.org.ua>
CC: bug-...@gnu.org

On 26/05/16 09:05, Sergey Poznyakoff wrote:
> Hi Ben,
> The --exclude option is position-sensitive, which means it applies to
> any arguments or options appearing after it in the command line.
> Therefore the correct tar invocation is:
>    tar zcvvfXT - excludes includes
> Please see 3.4.4 "Position-Sensitive Options"[1], for details.
> Regards,
> Sergey
> [1] http://www.gnu.org/software/tar/manual/html_section/tar_22.html

Thanks very much Sergey. I can confirm that changing the order of the
excludes and includes, as you indicated above, gives me the desired
behaviour with tar 1.29:

$ tar zcvvfXT - excludes includes > /dev/null
drwxrwx--- ben/ben 0 2016-05-21 14:39 base/
drwxrwx--- ben/ben 0 2016-05-21 14:40 base/dir-1/
-rw-rw---- ben/ben 0 2016-05-21 14:40 base/dir-1/file-1

Kind regards,

--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

Reply via email to