ExtUtils::Manifest

Utilities to write and check a MANIFEST file

Latest version: 1.75 registry icon
Maintenance score
0
Safety score
0
Popularity score
22
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
1.75 0 0 0 0 0
1.74 0 0 0 0 0
1.73 0 0 0 0 0
1.72 0 0 0 0 0
1.70 0 0 0 0 0
1.69 0 0 0 0 0

Stability
Latest release:

1.75 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Artistic-1.0   -   Artistic License 1.0

Not a wildcard

Not proprietary

OSI Compliant


GPL-1.0-or-later   -   GNU General Public License v1.0 or later

Not a wildcard

Not proprietary

OSI Compliant



=pod

=head1 NAME

ExtUtils::Manifest - Utilities to write and check a MANIFEST file

=head1 VERSION

version 1.75

=head1 SYNOPSIS

use ExtUtils::Manifest qw(...funcs to import...);

mkmanifest();

my @missing_files    = manicheck;
my @skipped          = skipcheck;
my @extra_files      = filecheck;
my($missing, $extra) = fullcheck;

my $found    = manifind();

my $manifest = maniread();

manicopy($read,$target);

maniadd({$file => $comment, ...});

=head1 DESCRIPTION

...

=head1 FUNCTIONS

ExtUtils::Manifest exports no functions by default. The following are exported on request:

=head2 mkmanifest

mkmanifest();

Writes all files in and below the current directory to your F. It works similar to the result of the Unix command

find . > MANIFEST

All files that match any regular expression in a file F<MANIFEST.SKIP> (if it exists) are ignored.

Any existing F file will be saved as F<MANIFEST.bak>.

=head2 manifind

my $found = manifind();

returns a hash reference. The keys of the hash are the files found below the current directory.

=head2 manicheck

my @missing_files = manicheck();

checks if all the files within a C in the current directory really do exist. If C and the tree below the current directory are in sync it silently returns an empty list. Otherwise it returns a list of files which are listed in the C but missing from the directory, and by default also outputs these names to STDERR.

=head2 filecheck

my @extra_files = filecheck();

finds files below the current directory that are not mentioned in the C file. An optional file C<MANIFEST.SKIP> will be consulted. Any file matching a regular expression in such a file will not be reported as missing in the C file. The list of any extraneous files found is returned, and by default also reported to STDERR.

=head2 fullcheck

my($missing, $extra) = fullcheck();

does both a manicheck() and a filecheck(), returning then as two array refs.

=head2 skipcheck

my @skipped = skipcheck();

lists all the files that are skipped due to your C<MANIFEST.SKIP> file.

=head2 maniread

my $manifest = maniread();
my $manifest = maniread($manifest_file);

reads a named C file (defaults to C in the current directory) and returns a HASH reference with files being the keys and comments being the values of the HASH. Blank lines and lines which start with C<#> in the C file are discarded.

=head2 maniskip

my $skipchk = maniskip();
my $skipchk = maniskip($manifest_skip_file);

if ($skipchk->($file)) { .. }

reads a named C<MANIFEST.SKIP> file (defaults to C<MANIFEST.SKIP> in the current directory) and returns a CODE reference that tests whether a given filename should be skipped.

=head2 manicopy

manicopy(\%src, $dest_dir);
manicopy(\%src, $dest_dir, $how);

Copies the files that are the keys in %src to the $dest_dir. %src is typically returned by the maniread() function.

manicopy( maniread(), $dest_dir );

This function is useful for producing a directory tree identical to the intended distribution tree.

$how can be used to specify a different methods of "copying". Valid values are C, which actually copies the files, C which creates hard links, and C which mostly links the files but copies any symbolic link to make a tree without any symbolic link. C is the default.

=head2 maniadd

maniadd({ $file => $comment, ...});

Adds an entry to an existing F unless its already there.

$file will be normalized (ie. Unixified). B

=head2 MANIFEST

A list of files in the distribution, one file per line. The MANIFEST always uses Unix filepath conventions even if you're not on Unix. This means F<foo/bar> style not F<foo\bar>.

Anything between white space and an end of line within a C file is considered to be a comment. Any line beginning with # is also a comment. Beginning with ExtUtils::Manifest 1.52, a filename may contain whitespace characters if it is enclosed in single quotes; single quotes or backslashes in that filename must be backslash-escaped.

# this a comment
some/file
some/other/file            comment about some/file
'some/third file'          comment

=head2 MANIFEST.SKIP

The file MANIFEST.SKIP may contain regular expressions of files that should be ignored by mkmanifest() and filecheck(). The regular expressions should appear one on each line. Blank lines and lines which start with C<#> are skipped. Use C<#> if you need a regular expression to start with a C<#>.

For example:

# Version control files and dirs.
\bRCS\b
\bCVS\b
,v$
\B\.svn\b

# Makemaker generated files and dirs.
^MANIFEST\.
^Makefile$
^blib/
^MakeMaker-\d

# Temp, old and emacs backup files.
~$
\.old$
^#.*#$
^\.#

If no MANIFEST.SKIP file is found, a default set of skips will be used, similar to the example above. If you want nothing skipped, simply make an empty MANIFEST.SKIP file.

In one's own MANIFEST.SKIP file, certain directives can be used to include the contents of other MANIFEST.SKIP files. At present two such directives are recognized.

=over 4

=item #!include_default

This tells ExtUtils::Manifest to read the default F<MANIFEST.SKIP> file and skip files accordingly, but I to include it in the local F<MANIFEST.SKIP>. This is intended to skip files according to a system default, which can change over time without requiring further changes to the distribution's F<MANIFEST.SKIP>.

=item #!include /Path/to/another/manifest.skip

This inserts the contents of the specified external file in the local F<MANIFEST.SKIP>. This is intended for authors to have a central F<MANIFEST.SKIP> file, and to include it with their various distributions.

=back

The included contents will be inserted into the MANIFEST.SKIP file in between I<#!start included /path/to/manifest.skip> and I<#!end included /path/to/manifest.skip> markers. The original MANIFEST.SKIP is saved as MANIFEST.SKIP.bak.

=head2 EXPORT_OK

C<&mkmanifest>, C<&manicheck>, C<&filecheck>, C<&fullcheck>, C<&maniread>, and C<&manicopy> are exportable.

=head2 GLOBAL VARIABLES

C<$ExtUtils::Manifest::MANIFEST> defaults to C. Changing it results in both a different C and a different C<MANIFEST.SKIP> file. This is useful if you want to maintain different distributions for different audiences (say a user version and a developer version including RCS).

C<$ExtUtils::Manifest::Quiet> defaults to 0. If set to a true value, all functions act silently.

C<$ExtUtils::Manifest::Debug> defaults to 0. If set to a true value, or if PERL_MM_MANIFEST_DEBUG is true, debugging output will be produced.

=head1 DIAGNOSTICS

All diagnostic output is sent to C.

=over 4

=item C I

is reported if a file is found which is not in C.

=item C I

is reported if a file is skipped due to an entry in C<MANIFEST.SKIP>.

=item C I

is reported if a file mentioned in a C file does not exist.

=item CMANIFEST: I<$!>

is reported if C could not be opened.

=item C I

is reported by mkmanifest() if $Verbose is set and a file is added to MANIFEST. $Verbose is set to 1 by default.

=back

=head1 ENVIRONMENT

=over 4

=item B<PERL_MM_MANIFEST_DEBUG>

Turns on debugging

=back

=head1 SEE ALSO

LExtUtils::MakeMaker which has handy targets for most of the functionality.

=head1 AUTHOR

Andreas Koenig Candreas.koenig@anima.de

Currently maintained by the Perl Toolchain Gang.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 1996- by Andreas Koenig.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

=cut