Subject: Re: bin/28786: mtree bug (in verify.c)
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: netbsd-bugs
Date: 09/23/2006 19:45:02
The following reply was made to PR bin/28786; it has been noted by GNATS.

From: Jukka Salmi <j+nbsd@2006.salmi.ch>
To: gnats-bugs@NetBSD.org
Cc: sketch@netbsd.org
Subject: Re: bin/28786: mtree bug (in verify.c)
Date: Sat, 23 Sep 2006 21:44:12 +0200

 sketch@netbsd.org wrote:
 > State-Changed-From-To: open->feedback
 > State-Changed-By: sketch@netbsd.org
 > State-Changed-When: Sat, 23 Sep 2006 18:35:45 +0000
 > State-Changed-Why:
 > I think this is the correct behaviour, e.g. if you just want an mtree spec
 > to verify a directory structure and ignore the files within.  By specifying
 > a file, you get warnings about differences according to the spec, but an
 > empty spec should probably produce empty output...
 > 
 > Let us know if you mean something different, though, else we can close this PR
 
 I don't think this is correct behaviour. Quoting mtree(8):
 
 	DESCRIPTION
 	[...]
 	Messages are written to the standard output for any files whose
 	characteristics do not match the specification, or which are
 	missing from either the file hierarchy or the specification.
 
 To ignore non-directory files there's the -d option.
 
 If this is correct behaviour it's not possible to write a specification
 containing a directory without contents, e.g.:
 
 	/set type=file
 	. type=dir
 		file1
 		subdir type=dir
 		..
 		file2
 
 The directory `subdir' should not contain any files. Thus running mtree using this specification on the followin directory hierarchy
 
 	$ ls -lR
 	total 4
 	-rw-r--r--  1 jukka  jukka    0 Sep 23 21:34 file1
 	-rw-r--r--  1 jukka  jukka    0 Sep 23 21:34 file2
 	drwxr-xr-x  3 jukka  jukka  512 Sep 23 21:37 subdir/
 	
 	dir/subdir:
 	total 4
 	-rw-r--r--  1 jukka  jukka    0 Sep 23 21:27 file1
 	-rw-r--r--  1 jukka  jukka    0 Sep 23 21:27 file2
 	drwxr-xr-x  2 jukka  jukka  512 Sep 23 21:34 subsubdir/
 	
 	dir/subdir/subsubdir:
 
 should print
 
 	extra: subdir/file1
 	extra: subdir/file2
 	extra: subdir/subsubdir
 
 IMHO, but it doesn't:
 
 	$ mtree -f spec -p dir
 	$ 
 
 
 Regards, Jukka
 
 P.S.: the mail address I used when submitting this PR is not valid
 anymore (as you noticed). This address is, at least until 2007-12-31
 ;-)
 
 -- 
 If fifty million people say a foolish thing,
 it is still a foolish thing.
 
 	Anatole France