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

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

Non Exclusion of files - a feature?


From: Robert Goodwill
Subject: Non Exclusion of files - a feature?
Date: Mon, 23 Apr 2001 18:43:28 +1000 (EST)

Hello,
  thanks to you and all the others working on the GNU tar.  I have noticed
with a number of versions 1.12 and 1.13 at least that explicitly listed files
are dumped to a tar even if they match an exclusion rule:

So if you have a directory with files a,b,c,d
 and you did
tar --exclude=a -cvf /dev/null *

all files including a will be dumped. This may be sensible (on a "you asked for
it you've got it" basis) unless you are doing something like:

find . -type f -newer .last -print | tar -X excluding -s -T - -cvf /dev/null

all files found by the find will be dumped whether they are in the "excluding"
list or not.

I am unsure if this is a feature (intentional or not), or a bona-fide bug, 
I just found it annoying when I was using the incremental dump like the
second example above, and thought others may have been similarly annoyed.

A trap in the top of the dump_file function in create.c will cause the
exclusion list to be honoured (over and above the explicit naming of files).
This does make the check for exclusion later in the dump_file function
redundant. It also does add an extra function call of dump_file for each
file which matches the exclusion criteria.

ie. a 3 line context context diff output
>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*** src/create-dist.c   Mon Apr 23 18:09:51 2001
--- src/create.c        Mon Apr 23 18:25:29 2001
***************
*** 814,819 ****
--- 814,822 ----
    /* FIXME: `header' and `upperbound' might be used uninitialized in this
       function.  Reported by Bruno Haible.  */
  
+   if ( excluded_filename (excluded, p))
+     return;
+ 
    if (interactive_option && !confirm ("add", p))
      return;
  
***************
*** 1480,1487 ****
        {
          /* Skip `.', `..', and excluded file names.  */
  
!         if (is_dot_or_dotdot (entry->d_name)
!             || excluded_filename (excluded, entry->d_name))
            continue;
  
          if ((int) NAMLEN (entry) + len >= buflen)
--- 1483,1489 ----
        {
          /* Skip `.', `..', and excluded file names.  */
  
!         if (is_dot_or_dotdot (entry->d_name))
            continue;
  
          if ((int) NAMLEN (entry) + len >= buflen)
>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

A similar test before each call to dump_file would have a similar effect
(without the overhead of the extra call to dump_file).

  Many thanks,
--
Robert Goodwill         Programmer , School of Information Technology
address@hidden  James Cook University, Townsville, Australia.
Myself:(07)47814992     Fax: (07)47814029       School: (07)47814622



reply via email to

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