.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CPAN::Checksums 3pm" .TH CPAN::Checksums 3pm "2016-07-01" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CPAN::Checksums \- Write a "CHECKSUMS" file for a directory as on CPAN .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use CPAN::Checksums qw(updatedir); \& my $success = updatedir($directory); .Ve .SH "INCOMPATIBILITY ALERT" .IX Header "INCOMPATIBILITY ALERT" Since version 1.0 the generation of the attribute \f(CW\*(C`shortname\*(C'\fR is turned off by default. It was too slow and was not used as far as I know, and above all, it could fail on large directories. The shortname feature can still be turned on by setting the global variable \&\f(CW$TRY_SHORTNAME\fR to a true value. .SH "DESCRIPTION" .IX Header "DESCRIPTION" .ie n .IP "$success = updatedir($dir)" 2 .el .IP "\f(CW$success\fR = updatedir($dir)" 2 .IX Item "$success = updatedir($dir)" \&\f(CW\*(C`updatedir()\*(C'\fR takes a directory name as argument and writes a typical \&\f(CW\*(C`CHECKSUMS\*(C'\fR file in that directory as used on \s-1CPAN\s0 unless a previously written \f(CW\*(C`CHECKSUMS\*(C'\fR file is there that is still valid. Returns 2 if a new \f(CW\*(C`CHECKSUMS\*(C'\fR file has been written, 1 if a valid \f(CW\*(C`CHECKSUMS\*(C'\fR file is already there, otherwise dies. .Sp Note: since version 2.0 updatedir on empty directories behaves just the same. In older versions it silently did nothing. .SS "Global Variables in package CPAN::Checksums" .IX Subsection "Global Variables in package CPAN::Checksums" .ie n .IP "$IGNORE_MATCH" 4 .el .IP "\f(CW$IGNORE_MATCH\fR" 4 .IX Item "$IGNORE_MATCH" If the global variable \f(CW$IGNORE_MATCH\fR is set, then all files matching this expression will be completely ignored and will not be included in the \s-1CPAN \s0\f(CW\*(C`CHECKSUMS\*(C'\fR files. Per default this variable is set to .Sp .Vb 1 \& qr{(?i\-xsm:readme$)} .Ve .ie n .IP "$CAUTION" 4 .el .IP "\f(CW$CAUTION\fR" 4 .IX Item "$CAUTION" Setting the global variable \f(CW$CAUTION\fR causes \fIupdatedir()\fR to report changes of files in the attributes \f(CW\*(C`size\*(C'\fR, \f(CW\*(C`mtime\*(C'\fR, \f(CW\*(C`md5\*(C'\fR, or \&\f(CW\*(C`md5\-ungz\*(C'\fR to \s-1STDERR.\s0 .ie n .IP "$TRY_SHORTNAME" 4 .el .IP "\f(CW$TRY_SHORTNAME\fR" 4 .IX Item "$TRY_SHORTNAME" By setting the global variable \f(CW$TRY_SHORTNAME\fR to a true value, you can tell \fIupdatedir()\fR to include an attribute \f(CW\*(C`shortname\*(C'\fR in the resulting hash that is 8.3\-compatible. Please note, that \fIupdatedir()\fR in this case may be slow and may even fail on large directories, because it will always only try 1000 iterations to find a name that is not yet taken and then give up. .ie n .IP "$SIGNING_KEY" 4 .el .IP "\f(CW$SIGNING_KEY\fR" 4 .IX Item "$SIGNING_KEY" Setting the global variable \f(CW$SIGNING_KEY\fR makes the generated \f(CW\*(C`CHECKSUMS\*(C'\fR file to be clear-signed by the command specified in \f(CW$SIGNING_PROGRAM\fR (defaults to \f(CW\*(C`gpg \-\-clearsign \-\-default\-key \*(C'\fR), passing the signing key as an extra argument. The resulting \f(CW\*(C`CHECKSUMS\*(C'\fR file should look like: .Sp .Vb 3 \& 0&&<<\*(Aq\*(Aq; # this PGP\-signed message is also valid perl \& \-\-\-\-\-BEGIN PGP SIGNED MESSAGE\-\-\-\-\- \& Hash: SHA1 \& \& # CHECKSUMS file written on ... by CPAN::Checksums (v...) \& $cksum = { \& ... \& }; \& \& _\|_END_\|_ \& \-\-\-\-\-BEGIN PGP SIGNATURE\-\-\-\-\- \& ... \& \-\-\-\-\-END PGP SIGNATURE\-\-\-\-\- .Ve .Sp note that the actual data remains intact, but two extra lines are added to make it legal for both OpenPGP and perl syntax. .ie n .IP "$MIN_MTIME_CHECKSUMS" 4 .el .IP "\f(CW$MIN_MTIME_CHECKSUMS\fR" 4 .IX Item "$MIN_MTIME_CHECKSUMS" If the global variable \f(CW$MIN_MTIME_CHECKSUMS\fR is set, then updatedir will renew signatures on checksum files that have an older mtime than the given value. .SH "PREREQUISITES" .IX Header "PREREQUISITES" DirHandle, IO::File, Digest::MD5, Digest::SHA, Compress::Bzip2, Compress::Zlib, File::Spec, Data::Dumper, Data::Compare, File::Temp .SH "BUGS" .IX Header "BUGS" If updatedir is interrupted, it may leave a temporary file lying around. These files have the File::Temp template \f(CW\*(C`CHECKSUMS.XXXX\*(C'\fR and should be harvested by a cronjob. .SH "AUTHOR" .IX Header "AUTHOR" Andreas Koenig, andreas.koenig@anima.de; GnuPG support by Autrijus Tang .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright (c) 2002\-2008 Andreas Koenig, Audrey Tang, Steve Peters. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1).