summaryrefslogtreecommitdiff
path: root/pkgtools/rdigest/DESCR
diff options
context:
space:
mode:
authoratatat <atatat>2003-07-24 05:21:04 +0000
committeratatat <atatat>2003-07-24 05:21:04 +0000
commit1f6e524905f024b85765f8ea251ddf9d4d47df3c (patch)
tree0d4e8c1e05bb0a6917872193a8279fa9464cb84e /pkgtools/rdigest/DESCR
parent6e50554147a8956770a424950705e5b49b0ace72 (diff)
downloadpkgsrc-1f6e524905f024b85765f8ea251ddf9d4d47df3c.tar.gz
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.
Diffstat (limited to 'pkgtools/rdigest/DESCR')
-rw-r--r--pkgtools/rdigest/DESCR50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgtools/rdigest/DESCR b/pkgtools/rdigest/DESCR
new file mode 100644
index 00000000000..fec28fe43ca
--- /dev/null
+++ b/pkgtools/rdigest/DESCR
@@ -0,0 +1,50 @@
+This utility is a wrapper for the md5(3), sha1(3) and rmd160(3)
+routines.
+
+The utility is linked statically, so that it can be used without any
+shared libraries installed on the system.
+
+It is remarkably similar to the digest package, except that it
+can recursively checksum directory trees.
+
+While a simple checksum on a tar file is usually satisfactory, once
+said archive has been extracted, it is virtually impossible to
+repackage the extracted tree in a form that can yield a repeatable
+checksum. To be specific, changes in timestamps and ownership, and
+changes in file ordering within directories can affect the checksum of
+the archive, while not really impacting the actual code at all.
+
+The algorithm used to checksum a directory in this implementation is
+as follows:
+
+ cd into directory
+ initialize MASTER_HASH
+ walk directory tree, sorting all entries
+ foreach entry
+ if it is a directory:
+ skip it if it is named "RCS", "CVS", or "SCCS"
+ initialize SLAVE_HASH
+ add the string "d " into SLAVE_HASH
+ add the pathname of the directory into SLAVE_HASH
+ finish SLAVE_HASH
+ fold the hexified SLAVE_HASH result into MASTER_HASH
+ if it is a file:
+ initialize SLAVE_HASH
+ add the string "f " into SLAVE_HASH
+ add the pathname of the file into SLAVE_HASH
+ finish SLAVE_HASH
+ fold the hexified SLAVE_HASH result into MASTER_HASH
+ initialize SLAVE_HASH
+ add the contents of the file into SLAVE_HASH
+ finish SLAVE_HASH
+ fold the hexified SLAVE_HASH result into MASTER_HASH
+ if it is a symbolic link
+ initialize SLAVE_HASH
+ add the string "l " into SLAVE_HASH
+ add the pathname of the link into SLAVE_HASH
+ finish SLAVE_HASH
+ fold the hexified SLAVE_HASH result into MASTER_HASH
+ initialize SLAVE_HASH
+ add the contents of the link into SLAVE_HASH
+ finish SLAVE_HASH
+ fold the hexified SLAVE_HASH result into MASTER_HASH