1ExtUtils::Manifest(3) User Contributed Perl DocumentationExtUtils::Manifest(3)
2
3
4
6 ExtUtils::Manifest - Utilities to write and check a MANIFEST file
7
9 version 1.75
10
12 use ExtUtils::Manifest qw(...funcs to import...);
13
14 mkmanifest();
15
16 my @missing_files = manicheck;
17 my @skipped = skipcheck;
18 my @extra_files = filecheck;
19 my($missing, $extra) = fullcheck;
20
21 my $found = manifind();
22
23 my $manifest = maniread();
24
25 manicopy($read,$target);
26
27 maniadd({$file => $comment, ...});
28
30 ...
31
33 ExtUtils::Manifest exports no functions by default. The following are
34 exported on request:
35
36 mkmanifest
37 mkmanifest();
38
39 Writes all files in and below the current directory to your MANIFEST.
40 It works similar to the result of the Unix command
41
42 find . > MANIFEST
43
44 All files that match any regular expression in a file MANIFEST.SKIP (if
45 it exists) are ignored.
46
47 Any existing MANIFEST file will be saved as MANIFEST.bak.
48
49 manifind
50 my $found = manifind();
51
52 returns a hash reference. The keys of the hash are the files found
53 below the current directory.
54
55 manicheck
56 my @missing_files = manicheck();
57
58 checks if all the files within a "MANIFEST" in the current directory
59 really do exist. If "MANIFEST" and the tree below the current directory
60 are in sync it silently returns an empty list. Otherwise it returns a
61 list of files which are listed in the "MANIFEST" but missing from the
62 directory, and by default also outputs these names to STDERR.
63
64 filecheck
65 my @extra_files = filecheck();
66
67 finds files below the current directory that are not mentioned in the
68 "MANIFEST" file. An optional file "MANIFEST.SKIP" will be consulted.
69 Any file matching a regular expression in such a file will not be
70 reported as missing in the "MANIFEST" file. The list of any extraneous
71 files found is returned, and by default also reported to STDERR.
72
73 fullcheck
74 my($missing, $extra) = fullcheck();
75
76 does both a manicheck() and a filecheck(), returning then as two array
77 refs.
78
79 skipcheck
80 my @skipped = skipcheck();
81
82 lists all the files that are skipped due to your "MANIFEST.SKIP" file.
83
84 maniread
85 my $manifest = maniread();
86 my $manifest = maniread($manifest_file);
87
88 reads a named "MANIFEST" file (defaults to "MANIFEST" in the current
89 directory) and returns a HASH reference with files being the keys and
90 comments being the values of the HASH. Blank lines and lines which
91 start with "#" in the "MANIFEST" file are discarded.
92
93 maniskip
94 my $skipchk = maniskip();
95 my $skipchk = maniskip($manifest_skip_file);
96
97 if ($skipchk->($file)) { .. }
98
99 reads a named "MANIFEST.SKIP" file (defaults to "MANIFEST.SKIP" in the
100 current directory) and returns a CODE reference that tests whether a
101 given filename should be skipped.
102
103 manicopy
104 manicopy(\%src, $dest_dir);
105 manicopy(\%src, $dest_dir, $how);
106
107 Copies the files that are the keys in %src to the $dest_dir. %src is
108 typically returned by the maniread() function.
109
110 manicopy( maniread(), $dest_dir );
111
112 This function is useful for producing a directory tree identical to the
113 intended distribution tree.
114
115 $how can be used to specify a different methods of "copying". Valid
116 values are "cp", which actually copies the files, "ln" which creates
117 hard links, and "best" which mostly links the files but copies any
118 symbolic link to make a tree without any symbolic link. "cp" is the
119 default.
120
121 maniadd
122 maniadd({ $file => $comment, ...});
123
124 Adds an entry to an existing MANIFEST unless its already there.
125
126 $file will be normalized (ie. Unixified). UNIMPLEMENTED
127
128 MANIFEST
129 A list of files in the distribution, one file per line. The MANIFEST
130 always uses Unix filepath conventions even if you're not on Unix. This
131 means foo/bar style not foo\bar.
132
133 Anything between white space and an end of line within a "MANIFEST"
134 file is considered to be a comment. Any line beginning with # is also
135 a comment. Beginning with ExtUtils::Manifest 1.52, a filename may
136 contain whitespace characters if it is enclosed in single quotes;
137 single quotes or backslashes in that filename must be backslash-
138 escaped.
139
140 # this a comment
141 some/file
142 some/other/file comment about some/file
143 'some/third file' comment
144
145 MANIFEST.SKIP
146 The file MANIFEST.SKIP may contain regular expressions of files that
147 should be ignored by mkmanifest() and filecheck(). The regular
148 expressions should appear one on each line. Blank lines and lines which
149 start with "#" are skipped. Use "\#" if you need a regular expression
150 to start with a "#".
151
152 For example:
153
154 # Version control files and dirs.
155 \bRCS\b
156 \bCVS\b
157 ,v$
158 \B\.svn\b
159
160 # Makemaker generated files and dirs.
161 ^MANIFEST\.
162 ^Makefile$
163 ^blib/
164 ^MakeMaker-\d
165
166 # Temp, old and emacs backup files.
167 ~$
168 \.old$
169 ^#.*#$
170 ^\.#
171
172 If no MANIFEST.SKIP file is found, a default set of skips will be used,
173 similar to the example above. If you want nothing skipped, simply make
174 an empty MANIFEST.SKIP file.
175
176 In one's own MANIFEST.SKIP file, certain directives can be used to
177 include the contents of other MANIFEST.SKIP files. At present two such
178 directives are recognized.
179
180 #!include_default
181 This tells ExtUtils::Manifest to read the default MANIFEST.SKIP
182 file and skip files accordingly, but not to include it in the local
183 MANIFEST.SKIP. This is intended to skip files according to a system
184 default, which can change over time without requiring further
185 changes to the distribution's MANIFEST.SKIP.
186
187 #!include /Path/to/another/manifest.skip
188 This inserts the contents of the specified external file in the
189 local MANIFEST.SKIP. This is intended for authors to have a central
190 MANIFEST.SKIP file, and to include it with their various
191 distributions.
192
193 The included contents will be inserted into the MANIFEST.SKIP file in
194 between #!start included /path/to/manifest.skip and #!end included
195 /path/to/manifest.skip markers. The original MANIFEST.SKIP is saved as
196 MANIFEST.SKIP.bak.
197
198 EXPORT_OK
199 &mkmanifest, &manicheck, &filecheck, &fullcheck, &maniread, and
200 &manicopy are exportable.
201
202 GLOBAL VARIABLES
203 $ExtUtils::Manifest::MANIFEST defaults to "MANIFEST". Changing it
204 results in both a different "MANIFEST" and a different "MANIFEST.SKIP"
205 file. This is useful if you want to maintain different distributions
206 for different audiences (say a user version and a developer version
207 including RCS).
208
209 $ExtUtils::Manifest::Quiet defaults to 0. If set to a true value, all
210 functions act silently.
211
212 $ExtUtils::Manifest::Debug defaults to 0. If set to a true value, or
213 if PERL_MM_MANIFEST_DEBUG is true, debugging output will be produced.
214
216 All diagnostic output is sent to "STDERR".
217
218 "Not in MANIFEST:" file
219 is reported if a file is found which is not in "MANIFEST".
220
221 "Skipping" file
222 is reported if a file is skipped due to an entry in
223 "MANIFEST.SKIP".
224
225 "No such file:" file
226 is reported if a file mentioned in a "MANIFEST" file does not
227 exist.
228
229 "MANIFEST:" $!
230 is reported if "MANIFEST" could not be opened.
231
232 "Added to MANIFEST:" file
233 is reported by mkmanifest() if $Verbose is set and a file is added
234 to MANIFEST. $Verbose is set to 1 by default.
235
237 PERL_MM_MANIFEST_DEBUG
238 Turns on debugging
239
241 ExtUtils::MakeMaker which has handy targets for most of the
242 functionality.
243
245 Andreas Koenig "andreas.koenig@anima.de"
246
247 Currently maintained by the Perl Toolchain Gang.
248
250 This software is copyright (c) 1996- by Andreas Koenig.
251
252 This is free software; you can redistribute it and/or modify it under
253 the same terms as the Perl 5 programming language system itself.
254
255
256
257perl v5.38.0 2023-07-20 ExtUtils::Manifest(3)