tar xf a.tar dir/dir fix added to svn

Glenn L McGrath bug1 at ihug.co.nz
Sun Sep 3 23:25:24 UTC 2006


On Sat, 2 Sep 2006 21:15:44 +0200
Denis Vlasenko <vda.linux at googlemail.com> wrote:

> http://www.busybox.net/lists/busybox/2006-April/020371.html
> http://www.busybox.net/lists/busybox/2006-April/020461.html
> http://www.busybox.net/lists/busybox/2006-July/023285.html
> 
> Quote:
> 
> 	if (fnmatch(list->data, filename, 0) == 0) 
>  
> replacing it with: 
>  
> 	if (fnmatch(list->data, filename, FNM_LEADING_DIR) == 0) 
>  
> makes "--exclude" at least start to function a *little* more
> properly, but i'll leave it up to the maintainers to decide how to
> handle this. 
>   more to the point, why are there two totally separate routines
> whose purpose it is to do filename/pattern matching?
> 
> end quote.
> 
> I also added a testsuite entry.
> 
> However, http://bugs.busybox.net/view.php?id=991
> contains a bit different looking patch.
> 
> I am not closind that one for now.

The problem with fixing stuff like this is that it probably breaks
something else, so its not fixing bugs, its changing from a known bug
to unknown bug(s).

I did post an testsuite example of where it does break ar (i think, i
cant find the post at the moment).

There is different behaviour expected by different utilities, for
example, with cpio you are supposed to be able extract specific
files/directories without it acting recursively.

I think a proper solution is to use a different filematching function
for different applications and parse it in with the function pointers.

It wouldnt be that hard to do, but the big picture shows me that the
code needs to be redesigned, which is something ive been in an endless
loop trying to do.


Glenn



More information about the busybox mailing list