head	1.6;
access;
symbols;
locks; strict;
comment	@# @;


1.6
date	2005.09.02.15.25.51;	author shd;	state Exp;
branches;
next	1.5;

1.5
date	2005.09.02.14.39.16;	author shd;	state Exp;
branches;
next	1.4;

1.4
date	2005.09.02.14.35.24;	author shd;	state Exp;
branches;
next	1.3;

1.3
date	2005.09.02.14.32.08;	author shd;	state Exp;
branches;
next	1.2;

1.2
date	2004.01.18.21.19.11;	author shd;	state Exp;
branches;
next	1.1;

1.1
date	2004.01.18.16.52.23;	author shd;	state Exp;
branches;
next	;


desc
@@


1.6
log
@*** empty log message ***
@
text
@md5sum checker for nfo/md5 files
--------------------------------

usage:
	ckmd5 [-c] FILE1 [FILE2 ...]

ckmd5 verifies md5 checksums from .nfo and .md5 files. It has two modes:

Mode 1:
For each given file (say, FILE1.avi, FILE2.mpg, ...) ckmd5 looks for an
associated nfo or md5 file. If one is found, it scans that file for md5
checksums. Each checksum must have string 'md5' on the same line before the
actual checksum. However, if a checksum is in the beginning of a line then
the 'md5' string is not required. For example, an nfo should contain a line:

        md5sum: 14758f1afd44c09b7992073ccf00b43d
or
	^14758f1afd44c09b7992073ccf00b43d

Where ^ denotes line start.

It grabs those checksums, and computes md5 checksums of the given
files. Computed checksums are compared to reference checksums. If any
checksum in an associated nfo/md5 file matches that of the computed checksum,
the file is considered valid and success is returned. Otherwise an error is
returned. Note that this mode does not read filenames from nfo/md5 files like
normal 'md5sum -c md5.txt' does.

ckmd5 uses various heuristics to map files into associated nfo file names.
If '-cdX', where X is a number, is found from the file name, then it is removed
from the name. Thus foo-cd1-bar.avi would be associated with foo-bar.nfo.
The same replacement policy is used for: '-cdX', '-partX' and '-sample'.

Mode 2:
By using -c switch the ckmd5 operates like 'md5sum -c' does. It reads lines
from a given text file, and compares found checksums with checksums of files
listed in the same text file. man md5sum for more info.

Examples:

	Example 1:
	Given an avi file, and an nfo file with mode 1 compliant checksums 
	inside:
		ckmd5 foo.avi
	Should report whether foo.nfo contains valid or invalid checksum.

	Example 2:
	Following should return success for ckmd5:
		echo >> foo.nfo
		md5sum foo.avi >> foo.nfo
		ckmd5 -c foo.nfo

	Example 3:
	Use ckmd5 like md5sum:
		ckmd5 -c md5.txt

Author:
	Heikki Orsila <heikki.orsila@@iki.fi>

Web site:
	http://www.iki.fi/shd/foss/ckmd5/
@


1.5
log
@*** empty log message ***
@
text
@d13 2
a14 1
actual checksum. For example, the nfo should contain a line:
d17 4
@


1.4
log
@*** empty log message ***
@
text
@d36 1
a36 1
Example 1:
d42 1
a42 1
Example 2:
d48 1
a48 1
Example 3:
d52 1
a52 1
author:
d54 3
@


1.3
log
@*** empty log message ***
@
text
@d26 1
a26 1
from the name. Thus foo-cd1.avi would be associated with foo.nfo.
@


1.2
log
@*** empty log message ***
@
text
@d5 1
a5 1
	ckmd5 FILE1 FILE2 ...
d7 1
a7 2
ckmd5 computes md5sums of parameter files, and compares the sums to
values found from associated .nfo or .md5 files.
d9 42
a50 23
example 1:
	initial setup: there exists files:
		foo.avi
		foo.nfo
			foo.nfo contains a line with 'md5' and 32 consecutive
			hex digits after the 'md5' text string.
	ckmd5 foo.avi
		will do following:
		1. locate the md5sum from the file foo.nfo
		2. compute the md5sum of the file foo.avi
		3. compare the md5sums, and report if okay, bad or sum not
		   found

example 2:
	initial setup: there exists files:
		redhat.linux.iso
		redhat.linux.md5
	ckmd5 redhat.linux.iso
		will do following:
		1. locate the md5sum from the file redhat.linux.md5
		2. compute the md5sum of the file redhat.linux.iso
		3. compare the md5sums, and report if okay, bad or sum not
		   found
@


1.1
log
@*** empty log message ***
@
text
@d5 1
a5 1
	ckmd5.sh FILE1 FILE2 ...
d7 1
a7 1
ckmd5.sh computes md5sums of parameter files, and compares the sums to
a9 6
md5test executable is provided which is similar to md5sum command. the problem
with md5sum command is that it doesn't flush stdout often enough for
impatient people wanting to see progress of md5sum computations. md5sum
command could be launched separately for each file and hence md5test would
be useless, but separate launches would also be more bloat.

d16 1
a16 1
	ckmd5.sh foo.avi
d18 2
a19 2
		1. compute the md5sum of the file foo.avi
		2. locate the md5sum from the file foo.nfo
d27 1
a27 1
	ckmd5.sh redhat.linux.iso
d29 2
a30 2
		1. compute the md5sum of the file redhat.linux.iso
		2. locate the md5sum from the file redhat.linux.md5
a32 3

requirements:
	- python 1.x or 2.x
@

