bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Bug in GNU tar ?


From: John Lange
Subject: Re: Bug in GNU tar ?
Date: Mon, 25 Sep 2000 21:37:28 -0500 (CDT)

On 25 Sep 2000, Junio Hamano wrote:

> >>>>> "JL" == John Lange <address@hidden> writes:
> 
> JL> tar -zvcpf backup.tar.gz --directory / --exclude=var/log .
> JL> It simply ignores the --exclude and includes all of /var/log.
> 
> Info (tar)exclude says this:
> 
>        A PATTERN containing `/' excludes a name if an initial subsequence
>     of the name's components matches PATTERN; a PATTERN without `/'
>     excludes a name if it matches any of its name components.  For example,
>     the pattern `*b/RCS' contains `/', so it excludes `blob/RCS' and
>     `.blob/RCS/f' but not `blob/RCSit/RCS' or `/blob/RCS', whereas the
>     pattern `RCS' excludes all these names.  Conversely, the pattern `*.o'
>     lacks `/', so it excludes `.f.o', `d/f.o', and `d.o/f'.
> 
> The above is from:
> 
>    This manual documents version 1.13.17 of GNU `tar'.
> 
> Maybe the followings are good enough examples to illustrate a
> proper use for --exclude feature.
> 
> $ gtar cf - /tmp/junk | tar tvf -
> gtar: Removing leading '/' from member names
> drwxrwxr-x 1012/1012      0 Sep 25 16:52 2000 tmp/junk/
> drwxrwxr-x 1012/1012      0 Sep 25 16:50 2000 tmp/junk/gomi/
> -rw-rw-r-- 1012/1012     29 Sep 25 16:50 2000 tmp/junk/gomi/kuzu
> -rw-rw-r-- 1012/1012     29 Sep 25 16:52 2000 tmp/junk/chiri
> 
> $ gtar cf - /tmp/junk --exclude=/tmp/junk/gomi | tar tvf -
> gtar: Removing leading '/' from member names
> drwxrwxr-x 1012/1012      0 Sep 25 16:52 2000 tmp/junk/
> -rw-rw-r-- 1012/1012     29 Sep 25 16:52 2000 tmp/junk/chiri

First, thank you for your reply.

Second, I decided to run my own test using the exact file names you
provided in your example, and again, my version of tar (GNU tar 1.13) did
not work. Here is the exact output:

# tar cf - /tmp/junk/ |tar tvf -
tar: Removing leading `/' from absolute path names in the archive
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/gomi/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/gomi/kuzu/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/chiri/
# tar cf - /tmp/junk --exclude=/tmp/junk/gomi | tar tvf -
tar: Removing leading `/' from absolute path names in the archive
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/gomi/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/gomi/kuzu/
drwx--x--x root/root         0 2000-09-25 21:27 tmp/junk/chiri/

As you can see, the --exclude is completely ignored thus confirming this
is a bug. What version of tar did you test with? What is current?

Again, this was tested with GNU tar 1.13 on Linux Slackware 7.1 with
kernel 2.2.16.

This is causing me some major greif at the moment. :)

Regards,

John Lange
Darkcore Administrator
address@hidden






reply via email to

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