Parrot::Manifest - Re-create MANIFEST and MANIFEST.SKIP
use Parrot::Manifest; $mani = Parrot::Manifest->new($0); $manifest_lines_ref = $mani->prepare_manifest(); $need_for_files = $mani->determine_need_for_manifest($manifest_lines_ref); $mani->print_manifest($manifest_lines_ref) if $need_for_files; $print_str = $mani->prepare_manifest_skip(); $need_for_skip = $mani->determine_need_for_manifest_skip($print_str); $mani->print_manifest_skip($print_str) if $need_for_skip;
This package exports no functions. A Parrot::Manifest object is used in tools/dev/mk_manifest_and_skip.pl, which in turn is the basis of make manifest_tests.
make manifest_tests
$mani = Parrot::Manifest->new({ script => $0, file => $filename, skip => $skipfilename, })
Creates a Parrot::Manifest object by asking git status for verbose output, and parsing the results.
git status
file is the name of the file that the manifest will eventually be written to, and defaults to MANIFEST. skip is the name of the file that will hold the list of files to be skipped, and defaults to MANIFEST.SKIP.
file
skip
$manifest_lines_ref = $mani->prepare_manifest();
Prepares the manifest from the data read in by the new() method, and returns a hash of the files. The keys of the hash are the filenames, and the values are strings representing the package and a list of the meta flags.
new()
$need_for_files = $mani->determine_need_for_manifest($manifest_lines_ref);
Determines the need for the manifest. The checks are:
If there's no manifest yet, we need one.
If there's a difference between what's already there and what's in the list, we need a new one.
If a new manifest is needed, the return value is 1; otherwise it is undefined. The value passed in is the hash as returned from e.g., prepare_manifest().
1
prepare_manifest()
$mani->print_manifest($manifest_lines_ref) if $need_for_files;
Writes the manifest to a file. The example above does so only if an update is needed.
$print_str = $mani->prepare_manifest_skip();
Gets a list of the files that Git ignores, and returns a string that can be put into MANIFEST.SKIP.
$need_for_skip = $mani->determine_need_for_manifest_skip($print_str);
Determines whether MANIFEST.SKIP is needed. The tests used are:
If the file doesn't exist, we need one.
If the proposed and existing contents differ, we need one.
$mani->print_manifest_skip($print_str) if $need_for_skip;
Writes MANIFEST.SKIP to a file. The example above does so only if needed.
The format of the MANIFEST (currently MANIFEST and MANIFEST.generated are used) is:
source_path <whitespace> [package]meta1,meta2,...
or you may optionally specify a different destination path:
source_path <whitespace> [package]meta1,meta2,... <whitespace> destination
Additionally, there may be a * in front of the whole line to designate a generated file:
*
source_path <whitespace> *[package]meta1,meta2,... <whitespace> destination
The square brackets around package are literal. package gives the name of the RPM that the given file will be installed for, and is only used by this script to skip files that are not members of any package.
package
The various meta flags recognized are:
doc
Tag this file with %doc in the RPM, and omit the leading path (because rpm will put it into a directory of its choosing).
%doc
include
Write this file to the location given by the --includedir option.
--includedir
lib
Write this file to the location given by the --libdir option.
--libdir
bin
Write this file to the location given by the --bindir option.
--bindir
The optional destination field provides a general way to change where a file will be written to. It will be applied before any metadata tags.
destination
Example: if this line is in the MANIFEST.generated file
languages/snorkfest/snork-compile [main]bin
and the --bindir=/usr/parroty/bin, then the generated parrot-<VERSION>-1.<arch>.rpm file will contain the file /usr/parroty/bin/snork-compile.
--bindir=/usr/parroty/bin
/usr/parroty/bin/snork-compile
tools/dev/mk_manifest_and_skip.pl.
James E. Keenan (jkeenan@cpan.org) refactored code from earlier versions of tools/dev/mk_manifest_and_skip.pl.
This is free software which you may distribute under the same terms as Perl itself.
To install Rakudo::Star, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rakudo::Star
CPAN shell
perl -MCPAN -e shell install Rakudo::Star
For more information on module installation, please visit the detailed CPAN module installation guide.