head 1.7; access; symbols pkgsrc-2026Q1:1.7.0.34 pkgsrc-2026Q1-base:1.7 pkgsrc-2025Q4:1.7.0.32 pkgsrc-2025Q4-base:1.7 pkgsrc-2025Q3:1.7.0.30 pkgsrc-2025Q3-base:1.7 pkgsrc-2025Q2:1.7.0.28 pkgsrc-2025Q2-base:1.7 pkgsrc-2025Q1:1.7.0.26 pkgsrc-2025Q1-base:1.7 pkgsrc-2024Q4:1.7.0.24 pkgsrc-2024Q4-base:1.7 pkgsrc-2024Q3:1.7.0.22 pkgsrc-2024Q3-base:1.7 pkgsrc-2024Q2:1.7.0.20 pkgsrc-2024Q2-base:1.7 pkgsrc-2024Q1:1.7.0.18 pkgsrc-2024Q1-base:1.7 pkgsrc-2023Q4:1.7.0.16 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.14 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.12 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.10 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.8 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.6 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.4 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.2 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.6.0.48 pkgsrc-2021Q4-base:1.6 pkgsrc-2021Q3:1.6.0.46 pkgsrc-2021Q3-base:1.6 pkgsrc-2021Q2:1.6.0.44 pkgsrc-2021Q2-base:1.6 pkgsrc-2021Q1:1.6.0.42 pkgsrc-2021Q1-base:1.6 pkgsrc-2020Q4:1.6.0.40 pkgsrc-2020Q4-base:1.6 pkgsrc-2020Q3:1.6.0.38 pkgsrc-2020Q3-base:1.6 pkgsrc-2020Q2:1.6.0.34 pkgsrc-2020Q2-base:1.6 pkgsrc-2020Q1:1.6.0.14 pkgsrc-2020Q1-base:1.6 pkgsrc-2019Q4:1.6.0.36 pkgsrc-2019Q4-base:1.6 pkgsrc-2019Q3:1.6.0.32 pkgsrc-2019Q3-base:1.6 pkgsrc-2019Q2:1.6.0.30 pkgsrc-2019Q2-base:1.6 pkgsrc-2019Q1:1.6.0.28 pkgsrc-2019Q1-base:1.6 pkgsrc-2018Q4:1.6.0.26 pkgsrc-2018Q4-base:1.6 pkgsrc-2018Q3:1.6.0.24 pkgsrc-2018Q3-base:1.6 pkgsrc-2018Q2:1.6.0.22 pkgsrc-2018Q2-base:1.6 pkgsrc-2018Q1:1.6.0.20 pkgsrc-2018Q1-base:1.6 pkgsrc-2017Q4:1.6.0.18 pkgsrc-2017Q4-base:1.6 pkgsrc-2017Q3:1.6.0.16 pkgsrc-2017Q3-base:1.6 pkgsrc-2017Q2:1.6.0.12 pkgsrc-2017Q2-base:1.6 pkgsrc-2017Q1:1.6.0.10 pkgsrc-2017Q1-base:1.6 pkgsrc-2016Q4:1.6.0.8 pkgsrc-2016Q4-base:1.6 pkgsrc-2016Q3:1.6.0.6 pkgsrc-2016Q3-base:1.6 pkgsrc-2016Q2:1.6.0.4 pkgsrc-2016Q2-base:1.6 pkgsrc-2016Q1:1.6.0.2 pkgsrc-2016Q1-base:1.6 pkgsrc-2015Q4:1.5.0.20 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.18 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.16 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.14 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.12 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.10 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.8 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.6 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.4 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.2 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.3.0.70 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.68 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.66 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.3.0.64 pkgsrc-2012Q3-base:1.3 pkgsrc-2012Q2:1.3.0.62 pkgsrc-2012Q2-base:1.3 pkgsrc-2012Q1:1.3.0.60 pkgsrc-2012Q1-base:1.3 pkgsrc-2011Q4:1.3.0.58 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.56 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.54 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.52 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.50 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.48 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.46 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.44 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.42 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.40 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.38 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.36 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.34 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.32 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.30 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.28 pkgsrc-2008Q2-base:1.3 cwrapper-base:1.3 cwrapper:1.3.0.26 pkgsrc-2008Q1:1.3.0.24 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.22 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.20 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.18 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.16 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.14 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.12 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.10 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.8 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.6 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.4 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.2 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.1.1.1.0.12 pkgsrc-2005Q1-base:1.1.1.1 pkgsrc-2004Q4:1.1.1.1.0.10 pkgsrc-2004Q4-base:1.1.1.1 pkgsrc-2004Q3:1.1.1.1.0.8 pkgsrc-2004Q3-base:1.1.1.1 pkgsrc-2004Q2:1.1.1.1.0.6 pkgsrc-2004Q2-base:1.1.1.1 pkgsrc-2004Q1:1.1.1.1.0.4 pkgsrc-2004Q1-base:1.1.1.1 pkgsrc-2003Q4:1.1.1.1.0.2 pkgsrc-2003Q4-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.7 date 2022.03.25.10.30.25; author wiz; state Exp; branches; next 1.6; commitid 8bWuNt7hVCOFjAxD; 1.6 date 2016.03.31.17.06.18; author agc; state Exp; branches; next 1.5; commitid NpwX6AXfGV2NJO0z; 1.5 date 2013.07.25.08.25.26; author wiz; state Exp; branches; next 1.4; commitid J2fZBQL11TFmmPYw; 1.4 date 2013.07.20.21.50.54; author wiz; state Exp; branches; next 1.3; commitid JkeZW8O0bOxzYfYw; 1.3 date 2005.03.31.05.02.24; author atatat; state Exp; branches; next 1.2; 1.2 date 2005.03.28.20.52.55; author agc; state Exp; branches; next 1.1; 1.1 date 2003.07.24.05.21.07; author atatat; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.07.24.05.21.07; author atatat; state Exp; branches; next ; desc @@ 1.7 log @rdigest: fix patch context so this builds again @ text @$NetBSD: patch-ab,v 1.6 2016/03/31 17:06:18 agc Exp $ Patch digest man page for rdigest functionality --- digest.1.orig 2022-03-25 10:29:21.419832305 +0000 +++ digest.1 @@@@ -24,20 +24,21 @@@@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd September 28, 2021 -.Dt DIGEST 1 +.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 "Vt" +.Op Fl x Ar directory .Ar algorithm .Op Ar .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. .Pp It can also run self tests via the @@@@ -46,6 +47,12 @@@@ command line option; the only self tests for the .Dv SHA3 set of digests. +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 .Fl V @@@@ -119,12 +126,32 @@@@ utility is a simple wrapper for the vari algorithm implementations, which are located in the standard C library, and was designed to be scalable as new message digest algorithms are developed. +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 +.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 +.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 +.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 \*[Gt]0 if an error occurs. .Sh SEE ALSO .Xr cksum 1 , +.Xr digest 1 , .Xr md5 3 , .Xr rmd160 3 , .Xr sha1 3 @@@@ -132,9 +159,13 @@@@ utility exits 0 on success, and \*[Gt]0 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 Mt agc@@netbsd.org . +was implemented by Andrew Brown \*[Lt]atatat@@netbsd.org\*[Gt] as a +patch to +.Xr digest 1 +to add recursive capabilities. @ 1.6 log @Build fixes for rdigest, following previous changes to pkgtools/digest in February. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.5 2013/07/25 08:25:26 wiz Exp $ d5 2 a6 2 --- digest.1.orig 2016-03-31 09:37:14.729218330 -0700 +++ digest.1 2016-03-31 09:40:35.110066257 -0700 d10 1 a10 1 .Dd February 16, 2016 d33 1 a33 1 @@@@ -46,6 +47,12 @@@@ d46 1 a46 1 @@@@ -111,12 +118,32 @@@@ d79 1 a79 1 @@@@ -124,9 +151,13 @@@@ @ 1.5 log @regen @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.4 2013/07/20 21:50:54 wiz Exp $ d3 6 a8 11 --- digest.1.orig 2013-07-25 08:24:59.000000000 +0000 +++ digest.1 @@@@ -2,5 +2,5 @@@@ .\" .\" -.\" Copyright (c) 2001 Alistair G. Crooks. All rights reserved. +.\" Copyright (c) 2001-2005 Alistair G. Crooks. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@@@ -32,12 +32,13 @@@@ .\" d10 1 a10 1 -.Dd March 23, 2005 a11 1 +.Dd March 31, 2005 d21 1 d24 2 a25 2 .Op file ... @@@@ -45,6 +46,13 @@@@ d31 6 d43 5 a47 4 +.Pp The list of possible algorithms is: .Bl -tag -width Ds @@@@ -89,4 +97,23 @@@@ algorithm implementations, which are loc d71 2 a72 1 @@@@ -95,4 +122,5 @@@@ utility exits 0 on success, and \*[Gt]0 d78 3 a80 1 @@@@ -102,8 +130,12 @@@@ The @ 1.4 log @Use Mt for email addresses. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.3 2005/03/31 05:02:24 atatat Exp $ d3 1 a3 1 --- digest.1.orig 2005-03-30 23:40:39.000000000 -0500 @ 1.3 log @Fix the man page patch to match the current digest man page. While I'm here, also adjust the length of DESCR to less than 24 lines (requested in private email). @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.2 2005/03/28 20:52:55 agc Exp $ d86 1 a86 1 -.An Alistair G. Crooks Aq agc@@netbsd.org . @ 1.2 log @Update this package after the additions of the new hashes to the digest package. Fixes PR 29795 from A L Meyers. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.1.1.1 2003/07/24 05:21:07 atatat Exp $ d3 3 a5 4 --- digest.1.orig 2005-03-28 21:41:50.000000000 +0100 +++ digest.1 2005-03-28 21:45:50.000000000 +0100 @@@@ -1,7 +1,7 @@@@ .\" $NetBSD: digest.1,v 1.6 2005/03/23 14:32:19 agc Exp $ d12 1 a12 2 .\" modification, are permitted provided that the following conditions @@@@ -32,20 +32,28 @@@@ d15 1 a15 1 .Dd March 23, 2005 d17 1 d30 1 a30 1 .Sh DESCRIPTION d45 1 a45 3 .It md5 @@@@ -88,12 +96,32 @@@@ algorithm implementations, which are located in the standard d53 1 a53 1 +.Li Dq f \& d58 1 a58 1 +.Li Dq l \& d63 1 a63 1 +.Li Dq d \& d69 1 a69 2 .Nm utility exits 0 on success, and \*[Gt]0 if an error occurs. d75 1 a75 3 .Xr sha1 3 @@@@ -101,9 +129,13 @@@@ The @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d3 4 a6 4 --- 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. d9 9 a17 1 -.Dd February 28, 2001 a18 1 +.Dd July 24, 2003 d47 2 a48 1 @@@@ -81,11 +89,32 @@@@ algorithm implementations, which are loc a50 1 .Pp d70 1 a70 1 +.Pp d73 1 a73 1 utility exits 0 on success, and >0 if an error occurs. d80 1 a80 1 @@@@ -93,9 +122,13 @@@@ utility exits 0 on success, and >0 if an @ 1.1.1.1 log @A strange meta-package of a sort, rdigest is implemented as a jumbo patch to the well-known digest package. The output is the same for files, but if rdigest is given a directory as an argument, it will recursively checksum the directory in such a manner as to: (1) give a repeatable checksum (2) with no regard for file ownership (3) or timestamps (4) or modes (5) while taking into account empty files and directories such that the checksum of an extracted tar file will match the checksum of the same tree as retrieved via cvs, or two allegedly matching trees from different cvs servers, etc. @ text @@