.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 >0, 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 "Module::Manifest 3pm" .TH Module::Manifest 3pm "2022-06-15" "perl v5.34.0" "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" Module::Manifest \- Parse and examine a Perl distribution MANIFEST file .SH "VERSION" .IX Header "VERSION" version 1.09 .SH "SYNOPSIS" .IX Header "SYNOPSIS" Open and parse a \s-1MANIFEST\s0 and \s-1MANIFEST.SKIP:\s0 .PP .Vb 1 \& my $manifest = Module::Manifest\->new( \*(AqMANIFEST\*(Aq, \*(AqMANIFEST.SKIP\*(Aq ); .Ve .PP Check if a given file matches any known skip masks: .PP .Vb 1 \& print "yes\en" if $manifest\->skipped(\*(Aq.svn\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBModule::Manifest\fR is a simple utility module created originally for use in Module::Inspector. .PP It can load a \fI\s-1MANIFEST\s0\fR file that comes in a Perl distribution tarball, examine the contents, and perform some simple tasks. It can also load the \&\fI\s-1MANIFEST.SKIP\s0\fR file and check that. .PP Granted, the functionality needed to do this is quite simple, but the Perl distribution \fI\s-1MANIFEST\s0\fR specification contains a couple of little idiosyncracies, such as line comments and space-seperated inline comments. .PP The use of this module means that any little nigglies are dealt with behind the scenes, and you can concentrate the main task at hand. .SS "Comparison to ExtUtil::Manifest" .IX Subsection "Comparison to ExtUtil::Manifest" This module is quite similar to ExtUtils::Manifest, or is at least similar in scope. However, there is a general difference in approach. .PP ExtUtils::Manifest is imperative, requires the existence of the actual \&\fI\s-1MANIFEST\s0\fR file on disk, and requires that your current directory remains the same. .PP Module::Manifest treats the \fI\s-1MANIFEST\s0\fR file as an object, can load a the file from anywhere on disk, and can run some of the same functionality without having to change your current directory context. .PP That said, note that Module::Manifest is aimed at reading and checking existing \s-1MANFIFEST\s0 files, rather than creating new ones. .SH "COMPATIBILITY" .IX Header "COMPATIBILITY" This module should be compatible with Perl 5.005 and above. However, it has only been rigorously tested under Perl 5.10.0 on Linux. .PP If you encounter any problems on a different version or architecture, please contact the maintainer. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& Module::Manifest\->new( $manifest, $skip ) .Ve .PP Creates a \f(CW\*(C`Module::Manifest\*(C'\fR object, which either parses the files referenced by the \f(CW$manifest\fR (for \s-1MANIFEST\s0) and \f(CW$skip\fR (for \s-1MANIFEST.SKIP\s0). If no parameters are specified, it creates an empty object. .PP Example code: .PP .Vb 3 \& my $manifest = Module::Manifest\->new; \& my $manifest = Module::Manifest\->new( $manifest ); \& my $manifest = Module::Manifest\->new( $manifest, $skip ); .Ve .PP This method will return an appropriate \fBModule::Manifest\fR object or throws an exception on error. .SS "open" .IX Subsection "open" .Vb 1 \& $manifest\->open( $type => $filename ) .Ve .PP Open and parse the file given by \f(CW$filename\fR, which may be a relative path. The available \f(CW$type\fR options are either: 'skip' or 'manifest' .PP Example code: .PP .Vb 2 \& $manifest\->open( skip => \*(AqMANIFEST.SKIP\*(Aq ); \& $manifest\->open( manifest => \*(AqMANIFEST\*(Aq ); .Ve .PP This method doesn't return anything, but may throw an exception on error. .SS "parse" .IX Subsection "parse" .Vb 1 \& $manifest\->parse( $type => \e@files ) .Ve .PP Parse \f(CW\*(C`\e@files\*(C'\fR, which is an array reference containing a list of files or regular expression masks. The available \f(CW$type\fR options are either: 'skip' or 'manifest' .PP Example code: .PP .Vb 5 \& $manifest\->parse( skip => [ \& \*(Aq\eB\e.svn\eb\*(Aq, \& \*(Aq^Build$\*(Aq, \& \*(Aq\ebMakefile$\*(Aq, \& ]); .Ve .PP This method doesn't return anything, but may throw an exception on error. .SS "skipped" .IX Subsection "skipped" .Vb 1 \& $manifest\->skipped( $filename ) .Ve .PP Check if \f(CW$filename\fR matches any masks that should be skipped, given the regular expressions provided to either the \f(CW\*(C`parse\*(C'\fR or \f(CW\*(C`open\*(C'\fR methods. .PP Absolute path names must first be relativized and converted to a Unix-like path string by using the \f(CW\*(C`normalize\*(C'\fR method. .PP Example code: .PP .Vb 3 \& if ($manifest\->skipped(\*(AqMakefile.PL\*(Aq)) { \& # do stuff \& } .Ve .PP This method returns a boolean true or false value indicating whether the file path is skipped according the \f(CW\*(C`skipfile\*(C'\fR. .SS "normalize" .IX Subsection "normalize" .Vb 2 \& Module::Manifest\->normalize( $path, $rel ) \& $manifest\->normalize( $path, $rel ) .Ve .PP This method takes a given platform-specific path string and converts it to a Unix-style string compatible with the \s-1MANIFEST\s0 and \s-1MANIFEST.SKIP\s0 specifications. .PP Note that this method normalizes paths depending on the platform detected by \f(CW$^O\fR \*(-- that is, Win32 style paths can only be normalized if the module is currently running under Win32. .PP By default, this method will relativize file paths to the current working directory (using File::Spec's \f(CW\*(C`abs2rel\*(C'\fR method without a \f(CW$root\fR). To disable this behaviour, set \f(CW$rel\fR to a false value. .PP Example code: .PP .Vb 3 \& # Useful for normalizing Win32\-style paths \& my $normal = Module::Manifest\->normalize(\*(Aqt\e\etest\e\efile\*(Aq); \& # Returns: t/test/file (ie, in Unix style for MANIFEST) .Ve .PP This returns a normalized version of the given path. .SS "file" .IX Subsection "file" .Vb 1 \& $manifest\->file .Ve .PP The \f(CW\*(C`file\*(C'\fR accessor returns the absolute path of the \s-1MANIFEST\s0 file that was loaded. .SS "skipfile" .IX Subsection "skipfile" .Vb 1 \& $manifest\->skipfile .Ve .PP The \f(CW\*(C`skipfile\*(C'\fR accessor returns the absolute path of the \s-1MANIFEST.SKIP\s0 file that was loaded. .SS "dir" .IX Subsection "dir" .Vb 1 \& $manifest\->dir .Ve .PP The \f(CW\*(C`dir\*(C'\fR accessor returns the path to the directory that contains the \&\s-1MANIFEST\s0 or skip file, and thus \s-1SHOULD\s0 be the root of the distribution. .SS "files" .IX Subsection "files" .Vb 1 \& $manifest\->files .Ve .PP The \f(CW\*(C`files\*(C'\fR method returns the (relative, unix-style) list of files within the manifest. In scalar context, returns the number of files in the manifest. .PP Example code: .PP .Vb 1 \& my @files = $manifest\->files; .Ve .SH "LIMITATIONS" .IX Header "LIMITATIONS" The directory returned by the \f(CW\*(C`dir\*(C'\fR method is overwritten whenever \f(CW\*(C`open\*(C'\fR is called. This means that, if \s-1MANIFEST\s0 and \s-1MANIFEST.SKIP\s0 are not in the same directory, the module may get a bit confused. .SH "SUPPORT" .IX Header "SUPPORT" This module is stored in an Open Repository at the following address: .PP .PP Write access to the repository is made available automatically to any published \s-1CPAN\s0 author, and to most other volunteers on request. .PP If you are able to submit your bug report in the form of new (failing) unit tests, or can apply your fix directly instead of submitting a patch, you are \&\fBstrongly\fR encouraged to do so. The author currently maintains over 100 modules and it may take some time to deal with non-critical bug reports or patches. .PP This will guarantee that your issue will be addressed in the next release of the module. .PP If you cannot provide a direct test or fix, or don't have time to do so, then regular bug reports are still accepted and appreciated via the \s-1CPAN\s0 bug tracker. .PP .PP For other issues, for commercial enhancement and support, or to have your write access enabled for the repository, contact the author at the email address above. .SH "AUTHOR" .IX Header "AUTHOR" Adam Kennedy .SS "\s-1CONTIRBUTORS\s0" .IX Subsection "CONTIRBUTORS" Jonathan Yu .SH "SEE ALSO" .IX Header "SEE ALSO" ExtUtils::Manifest .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2006 \- 2010 Adam Kennedy .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \s-1LICENSE\s0 file included with this module.