1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
$NetBSD: patch-ab,v 1.1.1.1 2003/07/24 05:21:07 atatat Exp $
--- digest.1.orig 2002-02-16 15:24:32.000000000 -0500
+++ digest.1
@@ -31,21 +31,29 @@
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
-.Dd February 28, 2001
-.Dt DIGEST 1
+.Dd July 24, 2003
+.Dt RDIGEST 1
.Os
.Sh NAME
-.Nm digest
-.Nd calculate message digests
+.Nm rdigest
+.Nd calculate message digests of files and directories
.Sh SYNOPSIS
.Nm
+.Op Fl x Ar directory
.Ar algorithm
.Op file ...
.Sh DESCRIPTION
The
.Nm
-utility calculates message digests of files or,
+utility calculates message digests of files, directories, or,
if no file is specified, standard input.
+The
+.Fl x
+option can be used as many times as required to indicate directories
+not to be included in a directory's hash.
+This allows you to skip, eg, CVS subdirectories in a given tree, which
+can have relatively volatile contents not pertinent to the hash.
+.Pp
The list of possible algorithms is:
.Bl -tag -width Ds
.It md5
@@ -81,11 +89,32 @@ algorithm implementations, which are loc
C library, and was designed to be scalable as new message digest
algorithms are developed.
.Pp
+The checksum for a directory is implemented as the hash over a list of
+one or two hashes for each of the items in the tree.
+.Bl -bullet
+.It
+For a file, the string
+.Li Dq f \&
+along with the path make up the data for one hash, and the contents of
+the file is used for the second hash.
+.It
+For a symbolic link, the string
+.Li Dq l \&
+along with the path to the symbolic link make up the data for one
+hash, and the target of the symbolic link is used for the second hash.
+.It
+For a directory, the string
+.Li Dq d \&
+along with the path make up the data for one hash.
+There is no second hash for a directory.
+.El
+.Pp
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr cksum 1 ,
+.Xr digest 1 ,
.Xr md5 3 ,
.Xr rmd160 3 ,
.Xr sha1 3
@@ -93,9 +122,13 @@ utility exits 0 on success, and >0 if an
The
.Nm
utility first appeared in
-.Nx 1.6 .
+.Nx 2.0 .
.Sh AUTHORS
The
+.Xr digest 1
+utility was written by Alistair G. Crooks \*[Lt]agc@netbsd.org\*[Gt].
.Nm
-utility was written by
-.An Alistair G. Crooks Aq agc@netbsd.org .
+was implemented by Andrew Brown \*[Lt]atatat@netbsd.org\*[Gt] as a
+patch to
+.Xr digest 1
+to add recursive capabilities.
|