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.73
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 inserts the contents of the default MANIFEST.SKIP file
182
183 #!include /Path/to/another/manifest.skip
184 This inserts the contents of the specified external file
185
186 The included contents will be inserted into the MANIFEST.SKIP file in
187 between #!start included /path/to/manifest.skip and #!end included
188 /path/to/manifest.skip markers. The original MANIFEST.SKIP is saved as
189 MANIFEST.SKIP.bak.
190
191 EXPORT_OK
192 &mkmanifest, &manicheck, &filecheck, &fullcheck, &maniread, and
193 &manicopy are exportable.
194
195 GLOBAL VARIABLES
196 $ExtUtils::Manifest::MANIFEST defaults to "MANIFEST". Changing it
197 results in both a different "MANIFEST" and a different "MANIFEST.SKIP"
198 file. This is useful if you want to maintain different distributions
199 for different audiences (say a user version and a developer version
200 including RCS).
201
202 $ExtUtils::Manifest::Quiet defaults to 0. If set to a true value, all
203 functions act silently.
204
205 $ExtUtils::Manifest::Debug defaults to 0. If set to a true value, or
206 if PERL_MM_MANIFEST_DEBUG is true, debugging output will be produced.
207
209 All diagnostic output is sent to "STDERR".
210
211 "Not in MANIFEST:" file
212 is reported if a file is found which is not in "MANIFEST".
213
214 "Skipping" file
215 is reported if a file is skipped due to an entry in
216 "MANIFEST.SKIP".
217
218 "No such file:" file
219 is reported if a file mentioned in a "MANIFEST" file does not
220 exist.
221
222 "MANIFEST:" $!
223 is reported if "MANIFEST" could not be opened.
224
225 "Added to MANIFEST:" file
226 is reported by mkmanifest() if $Verbose is set and a file is added
227 to MANIFEST. $Verbose is set to 1 by default.
228
230 PERL_MM_MANIFEST_DEBUG
231 Turns on debugging
232
234 ExtUtils::MakeMaker which has handy targets for most of the
235 functionality.
236
238 Andreas Koenig "andreas.koenig@anima.de"
239
240 Currently maintained by the Perl Toolchain Gang.
241
243 This software is copyright (c) 1996- by Andreas Koenig.
244
245 This is free software; you can redistribute it and/or modify it under
246 the same terms as the Perl 5 programming language system itself.
247
248
249
250perl v5.36.0 2023-01-20 ExtUtils::Manifest(3)