Subject: tar -X doesn't accept exact matches
To: None <netbsd-users@netbsd.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: netbsd-users
Date: 06/17/2005 14:06:29
I've noticed that -X (a.k.a. --exclude-from) has broken between 1.6.2 and 
2.0.2. Paths which begin with ./ are only matched if the ./ is missing in 
the exclude file. For example:

ugly 1# tar -tzf etc.tgz > file
ugly 2# head file
./dev/MAKEDEV
./dev/MAKEDEV.local
./etc/defaults/daily.conf
./etc/defaults/monthly.conf
./etc/defaults/rc.conf
./etc/defaults/security.conf
./etc/defaults/weekly.conf
./etc/mail/helpfile
./etc/mail/aliases
./etc/mail/local-host-names
ugly 3# tar -tzf etc.tgz -X file

The last command lists all files with 2.0.2, but none with 1.6.2.

However:

ugly 4# sed 's:^\./::' file > file2
ugly 5# tar -tzf etc.tgz -X file2

This gives no output on 2.0.2, i.e. dev/MAKEDEV matches ./dev/MAKEDEV, but 
./dev/MAKEDEV doesn't match ./dev/MAKEDEV

Can someone quickly check this on -current and if it's still there, I'll 
file a PR.

-- 
Stephen