module-build-checkins Mailing List for Module::Build (Page 21)
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(82) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(49) |
Feb
(57) |
Mar
(49) |
Apr
(49) |
May
(2) |
Jun
(147) |
Jul
(60) |
Aug
(55) |
Sep
(51) |
Oct
(68) |
Nov
(61) |
Dec
(44) |
| 2006 |
Jan
(27) |
Feb
(38) |
Mar
(89) |
Apr
(31) |
May
(17) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ken W. <kwi...@us...> - 2005-07-26 03:20:02
|
Update of /cvsroot/module-build/Module-Build/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12331 Modified Files: META-spec.html Log Message: Generated from META-spec.pod Index: META-spec.html =================================================================== RCS file: /cvsroot/module-build/Module-Build/website/META-spec.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- META-spec.html 25 Jul 2005 03:52:58 -0000 1.3 +++ META-spec.html 26 Jul 2005 03:19:46 -0000 1.4 @@ -1,254 +1,672 @@ -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> - <title>Specification for META.yml</title> +<title>CPAN::META::Specification - Specification for F<META.yml></title> +<link rev="made" href="mailto:" /> </head> -<body> -<h2 align=center>Specification for the META.yml file</h2> +<body style="background-color: white"> -<p>This document describes version 1.0 of the META.yml specification.</p> +<p><a name="__index__"></a></p> +<!-- INDEX BEGIN --> + +<ul> + + <li><a href="#name">NAME</a></li> + <li><a href="#synopsis">SYNOPSIS</a></li> + <li><a href="#description">DESCRIPTION</a></li> + <li><a href="#format">FORMAT</a></li> + <li><a href="#terminology">TERMINOLOGY</a></li> + <li><a href="#version_specifications">VERSION SPECIFICATIONS</a></li> + <li><a href="#header">HEADER</a></li> + <li><a href="#fields">FIELDS</a></li> + <ul> + + <li><a href="#metaspec">meta-spec</a></li> + <li><a href="#name">name</a></li> + <li><a href="#version">version</a></li> + <li><a href="#generation">generation</a></li> + <li><a href="#abstract">abstract</a></li> + <li><a href="#authored_by">authored_by</a></li> + <li><a href="#license">license</a></li> + <li><a href="#distribution_type">distribution_type</a></li> + <li><a href="#requires">requires</a></li> + <li><a href="#recommends">recommends</a></li> + <li><a href="#build_requires">build_requires</a></li> + <li><a href="#conflicts">conflicts</a></li> + <li><a href="#requires_build_tools">requires_build_tools</a></li> + <li><a href="#requires_packages">requires_packages</a></li> + <ul> + <li><a href="#version">version</a></li> + <li><a href="#has_library">has_library</a></li> + <li><a href="#has_program">has_program</a></li> + </ul> + + <li><a href="#dynamic_config">dynamic_config</a></li> + <li><a href="#configure">configure</a></li> + <li><a href="#requires_os">requires_os</a></li> + <li><a href="#excludes_os">excludes_os</a></li> + <li><a href="#private">private</a></li> + <li><a href="#index">index</a></li> + <ul> + + <li><a href="#file">file</a></li> + <li><a href="#dir">dir</a></li> + <li><a href="#package">package</a></li> + <li><a href="#namespace">namespace</a></li> + </ul> + + <li><a href="#no_index">no_index</a></li> + <ul> + + <li><a href="#file">file</a></li> + <li><a href="#dir">dir</a></li> + <li><a href="#package">package</a></li> + <li><a href="#namespace">namespace</a></li> + </ul> + + <li><a href="#keywords">keywords</a></li> + <li><a href="#generated_by">generated_by</a></li> + <li><a href="#auto_regenerate">auto_regenerate</a></li> + </ul> + + <li><a href="#see_also">SEE ALSO</a></li> + <li><a href="#history">HISTORY</a></li> +</ul> +<!-- INDEX END --> + +<hr /> <p> -The META.yml file describes important properties of contributed Perl -distributions such as the ones found on <a -href="http://www.cpan.org">CPAN</a>. It is typically created by tools -like <a -href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> -and <a -href="http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/">ExtUtils::MakeMaker</a>. </p> - +<h1><a name="name">NAME</a></h1> +<p>CPAN::META::Specification - Specification for <em>META.yml</em></p> <p> -The fields in the META.yml file are meant to be helpful to people +</p> +<hr /> +<h1><a name="synopsis">SYNOPSIS</a></h1> +<pre> + --- #YAML:1.0 + name: Module-Build + abstract: Build and install Perl modules + version: 0.20 + authored_by: + - Ken Williams <ke...@ma...> + license: perl + distribution_type: module + requires: + Config: 0 + Cwd: 0 + Data::Dumper: 0 + ExtUtils::Install: 0 + File::Basename: 0 + File::Compare: 0 + File::Copy: 0 + File::Find: 0 + File::Path: 0 + File::Spec: 0 + IO::File: 0 + perl: 5.005_03 + recommends: + Archive::Tar: 1.00 + ExtUtils::Install: 0.3 + ExtUtils::ParseXS: 2.02 + Pod::Text: 0 + YAML: 0.35 + build_requires: + Test: 0 + meta-spec: + version: 1.1 + url: <<a href="http://search.cpan.org/dist/CPAN-META-Specification-1.1/>">http://search.cpan.org/dist/CPAN-META-Specification-1.1/></a>; + generated_by: Module::Build version 0.20</pre> +<p> +</p> +<hr /> +<h1><a name="description">DESCRIPTION</a></h1> +<p>This document describes version 1.1 of the <em>META.yml</em> specification.</p> +<p>The <em>META.yml</em> file describes important properties of contributed +Perl distributions such as the ones found on CPAN. It is typically +created by tools like Module::Build, Module::Install, and +ExtUtils::MakeMaker.</p> +<p>The fields in the <em>META.yml</em> file are meant to be helpful for people maintaining module collections (like CPAN), for people writing -installation tools (like <a -href="http://search.cpan.org/author/ANDK/CPAN/">CPAN.pm</a> or <a -href="http://search.cpan.org/author/KANE/CPANPLUS/">CPANPLUS</a>), or -just people who want to know some stuff about a distribution before -downloading it and starting to install it. +installation tools (like CPAN.pm or CPANPLUS), or just for people who +want to know some stuff about a distribution before downloading it and +starting to install it.</p> +<p><em>Note: The latest version of this specification can always be found +at <a href="http://search.cpan.org/dist/CPAN-META-Specification/">http://search.cpan.org/dist/CPAN-META-Specification/</a>.</em></p> +<p> </p> - -<h3>Format</h3> - +<hr /> +<h1><a name="format">FORMAT</a></h1> +<p><em>META.yml</em> files are written in the YAML format (see +<a href="http://www.yaml.org/">http://www.yaml.org/</a>).</p> +<p>See the following links to learn why we chose YAML instead of, say, +XML or Data::Dumper:</p> +<ul> +<li></li> +Module::Build design plans +<p><a href="http://nntp.x.perl.org/group/perl.makemaker/406">http://nntp.x.perl.org/group/perl.makemaker/406</a></p> +<p></p> +<li></li> +Not keen on YAML +<p><a href="http://nntp.x.perl.org/group/perl.module-authors/1353">http://nntp.x.perl.org/group/perl.module-authors/1353</a></p> +<p></p> +<li></li> +META Concerns +<p><a href="http://nntp.x.perl.org/group/perl.module-authors/1385">http://nntp.x.perl.org/group/perl.module-authors/1385</a></p> +<p></p></ul> <p> -META.yml files are written in the <a -href="http://www.yaml.org/">YAML</a> format. The reasons we chose -YAML instead of, say, XML or Data::Dumper are discussed in <a -href="http://archive.develooper.com/mak...@pe.../msg00405.html">this -thread</a> on the MakeMaker mailing list. </p> - +<hr /> +<h1><a name="terminology">TERMINOLOGY</a></h1> +<dl> +<dt><strong><a name="item_distribution">distribution</a></strong><br /> +</dt> +<dd> +This is the primary object described by the <em>META.yml</em> +specification. In the context of this document it usually refers to a +collection of modules, scripts, and/or documents that are distributed +for other developers to use. +</dd> +<p></p> +<dt><strong><a name="item_module">module</a></strong><br /> +</dt> +<dd> +This refers to a reusable library of code typically contained in a +single file. Currently, we primarily talk of perl modules, but this +specification should be open enough to apply to other languages as +well (ex. python, ruby). +</dd> +<p></p></dl> <p> -The first line of a META.yml file should be a valid <a -href="http://www.yaml.org/spec/#.Document">YAML document header</a> -like <nobr><tt>"--- #YAML:1.0"</tt></nobr>. </p> - -<h3>Fields</h3> - +<hr /> +<h1><a name="version_specifications">VERSION SPECIFICATIONS</a></h1> +<p>Some fields require a version specification (ex. <a href="#requires">requires</a>, +<a href="#recommends">recommends</a>, <a href="#build_requires">build_requires</a>, etc.). This section details the +version specications that are currently supported.</p> +<p>If a single version is listed, then that version is considered to be +the minimum version supported.</p> +<p>If 0 is given as the version number, then any version is supported.</p> +<p>Additionally, for more complicated requirements, the specification +supports a list of versions, each of which may be optionally preceeded +by a relational operator.</p> +<p>Supported operators include < (less than), <= (less than or +equal), > (greater than), >= (greater than or equal), and != +(not equal).</p> +<p>If a list is given then it is evaluated from left to right so that any +specifications in the list that conflict with a previous specification +are overriden by the later.</p> +<p>Examples:</p> +<pre> + >= 1.2, != 1.5, < 2.0</pre> +<p>Any version from version 1.2 onward, except version 1.5, that also +preceeds version 2.0.</p> <p> -The rest of the META.yml file is one big YAML <a -href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a>, -whose keys are described here. </p> - -<ul> - -<li><b>name</b><br> -Example: <b>Module-Build</b> +<hr /> +<h1><a name="header">HEADER</a></h1> +<p>The first line of a <em>META.yml</em> file should be a valid YAML document +header like <code>"--- #YAML:1.0"</code>.</p> <p> -The name of the distribution. Often created by taking the "main -module" in the distribution and changing "::" to "-". Sometimes it's -completely different, however, as in the case of the <a -href="http://search.cpan.org/author/GAAS/libwww-perl/">libwww-perl</a> -distribution. </p> - -<li><b>version</b><br> -Example: <b>0.16</b> +<hr /> +<h1><a name="fields">FIELDS</a></h1> +<p>The rest of the <em>META.yml</em> file is one big YAML mapping whose keys +are described here.</p> <p> -The version of the distribution to which the META.yml file refers. -This is a mandatory field. </p> - +<h2><a name="metaspec">meta-spec</a></h2> +<p>Example:</p> +<pre> + meta-spec: + url: <<a href="http://search.cpan.org/dist/CPAN-META-Specification-1.1/>">http://search.cpan.org/dist/CPAN-META-Specification-1.1/></a>; + version: 1.1</pre> +<p>(Spec 1.1) [required] This mapping indicates the location of the +version of the META.yml specification used along with the version +number of that specification.</p> <p> - The version is essentially an arbitrary string, but <i>must</i> be - only ASCII characters, and <i>strongly should</i> be of the format - integer-dot-digit-digit, i.e. <tt>25.57</tt>, optionally followed by - underscore-digit-digit, i.e. <tt>25.57_04</tt>. </p> - +<h2><a name="name">name</a></h2> +<p>Example:</p> +<pre> + name: Module-Build</pre> +<p>(Spec 1.0) [required] The name of the distribution which is often +created by taking the ``main module'' in the distribution and changing +``::'' to ``-''. Sometimes it's completely different, however, as in the +case of the libww-perl distribution (see +<a href="http://search.cpan.org/author/GAAS/libwww-perl/">http://search.cpan.org/author/GAAS/libwww-perl/</a>).</p> <p> - The standard tools that deal with module distribution (PAUSE, CPAN, - etc.) form an identifier for each distribution by joining the 'name' - and 'version' attributes with a dash (<tt>-</tt>) character. Tools - who are prepared to deal with distributions that have no version - numbers generally omit the dash as well. </p> - - -<li><b>license</b><br> -Example: <b>perl</b> - +<h2><a name="version">version</a></h2> +<p>Example:</p> +<pre> + version: 0.20</pre> +<p>(Spec 1.0) [required] The version of the distribution to which the +<em>META.yml</em> file refers.</p> <p> - a descriptive term for the licenses ... not authoritative, but must - be consistent with licensure statements in the READMEs, documentation, etc. </p> - +<h2><a name="generation">generation</a></h2> +<p>Example:</p> +<pre> + generation: 2</pre> +<p>(Spec 1.1) [optional] Indicates which generation this version belongs +to. A generation is a way of indicating that a collection of versions +are all compatible with each other, whereas a version from a different +generation may include incompatibilities or other major +differences. This allows tools like CPAN and CPANPLUS to present to +its users the greatest version in each generation to choose from when +the user queries a package instead of only presenting a single highest +version.</p> <p> -The license under which this distribution may be used and -redistributed. See <a -href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">Module::Build</a> -for the list of valid options. </p> - -<li><b>license_uri</b><br> +<h2><a name="abstract">abstract</a></h2> +<p>Example:</p> +<pre> + abstract: Build and install Perl modules.</pre> +<p>(Spec 1.1) [required] A short description of the purpose of the +distribution.</p> <p> - This should contain a URI where the exact terms of the license may be found. </p> - -(change "unrestricted" to "redistributable"?) - - -<li><b>distribution_type</b><br> -Example: <b>module</b> +<h2><a name="authored_by">authored_by</a></h2> +<p>Example:</p> +<pre> + authored_by: + - Ken Williams <ke...@ma...></pre> +<p>(Spec 1.1) [required] A YAML sequence indicating the <code>author(s)</code> of the +distribution. The prefered form is author-name <email-address>.</p> <p> -What kind of stuff is contained in this distribution. Most things on -CPAN are <code>module</code>s (which can also mean a collection of -modules), but some things are <code>script</code>s. </p> - -This field is basically meaningless, and tools (like Module::Build or -MakeMaker) will likely stop generating it in the future. - - -<li><b>private</b><br> -WTF is going on here? - -index_ignore: any application that indexes the contents of -distributions (PAUSE, search.cpan.org) ought to ignore the items -(packages, files, directories, namespace hierarchies). - - -<li><b>requires</b><br> -Example:<br> -<b> - Data::Dumper: 0<br> - File::Find: 1.03<br> -</b> +<h2><a name="license">license</a></h2> +<p>Example:</p> +<pre> + license: perl</pre> +<p>(Spec 1.0) [required] The license under which this distribution may be +used and redistributed. See <a href="/Module/Build.html">the Module::Build manpage</a> for the list of valid +options.</p> <p> -A YAML <a -href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> -indicating the Perl modules this distribution requires for proper -operation. The keys are the module names, and the values are version -specifications as described in the <a -href="http://search.cpan.org/author/KWILLIAMS/Module-Build/lib/Module/Build.pm"> -documentation for Module::Build's "requires" parameter</a>. </p> - -<p><i>Note: the exact nature of the fancy specifications like -<nobr><tt>">= 1.2, != 1.5, < 2.0"</tt></nobr> is subject to -change. Advance notice will be given here. The simple specifications -like <tt>"1.2"</tt> will not change in format.</i> +<h2><a name="distribution_type">distribution_type</a></h2> +<p>Example:</p> +<pre> + distribution_type: module</pre> +<p>(Spec 1.0) [optional] What kind of stuff is contained in this +distribution. Most things on CPAN are <a href="#item_module"><code>module</code></a>s (which can also mean +a collection of modules), but some things are <code>script</code>s.</p> +<p> </p> - -<li><b>recommends</b><br> -Example:<br> -<b> - Data::Dumper: 0<br> - File::Find: 1.03<br> -</b> +<h2><a name="requires">requires</a></h2> +<p>Example:</p> +<pre> + requires: + Data::Dumper: 0 + File::Find: 1.03</pre> +<p>(Spec 1.0) [optional] A YAML mapping indicating the Perl modules this +distribution requires for proper operation. The keys are the module +names, and the values are version specifications as described in +<a href="/Module/Build.html">the Module::Build manpage</a> for the ``requires'' parameter.</p> <p> -A YAML <a -href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> -indicating the Perl modules this distribution recommends for enhanced -operation. </p> - -<li><b>build_requires</b><br> -Example:<br> -<b> - Data::Dumper: 0<br> - File::Find: 1.03<br> -</b> +<h2><a name="recommends">recommends</a></h2> +<p>Example:</p> +<pre> + recommends: + Data::Dumper: 0 + File::Find: 1.03</pre> +<p>(Spec 1.0) [optional] A YAML mapping indicating the Perl modules this +distribution recommends for enhanced operation.</p> +<p><em>ALTERNATIVE: It may be desirable to present to the user which +features are dependant on which modules so they can make an informed +decision about which recommended modules to install.</em></p> +<p>Example:</p> +<pre> + optional_features: + - foo: + description: Provides the ability to blah. + requires: + Data::Dumper: 0 + File::Find: 1.03 + - bar: + description: This feature is not available on this platform. + excludes_os: MSWin32</pre> +<p><em>(Spec 1.1) [optional] A YAML sequence of names for optional features +which are made available when its requirements are met. For each +feature a description is provided along with any of <a href="#requires">requires</a>, +<a href="#build_requires">build_requires</a>, <a href="#conflicts">conflicts</a>, <a href="#requires_packages">requires_packages</a>, +<a href="#requires_os">requires_os</a>, and <a href="#excludes_os">excludes_os</a> which have the same meaning in +this subcontext as described elsewhere in this document.</em></p> <p> -A YAML <a -href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> -indicating the Perl modules required for building and/or testing of -this distribution. These dependencies are not required after the -module is installed. </p> - -<li><b>conflicts</b><br> -Example:<br> -<b> - Data::Dumper: 0<br> - File::Find: 1.03<br> -</b> +<h2><a name="build_requires">build_requires</a></h2> +<p>Example:</p> +<pre> + build_requires: + Data::Dumper: 0 + File::Find: 1.03</pre> +<p>(Spec 1.0) [optional] A YAML mapping indicating the Perl modules +required for building and/or testing of this distribution. These +dependencies are not required after the module is installed.</p> <p> -A YAML <a -href="http://www.yaml.org/spec/#.-syntax-mapping-Mapping-">mapping</a> -indicating the Perl modules that cannot be installed while this -distribution is installed. This is a pretty uncommon situation. </p> - -- possibly separate out test-time prereqs, complications include: can -tests be meaningfully preserved for later running? are test-time -prereqs in addition to build-time, or exclusive? - -- make official location for installed *distributions*, which can -contain tests, etc. - - -<li><b>dynamic_config</b><br> -Example: <b>0</b> +<h2><a name="conflicts">conflicts</a></h2> +<p>Example:</p> +<pre> + conflicts: + Data::Dumper: 0 + File::Find: 1.03</pre> +<p>(Spec 1.0) [optional] A YAML mapping indicating the Perl modules that +cannot be installed while this distribution is installed. This is a +pretty uncommon situation.</p> <p> -A boolean flag indicating whether a <tt>Build.PL</tt> or -<tt>Makefile.PL</tt> (or similar) must be executed, or whether this +</p> +<h2><a name="requires_build_tools">requires_build_tools</a></h2> +<p>Example:</p> +<pre> + requires_build_tools: 1</pre> +<p>(Spec 1.1) [optional] A boolean that indicates external build tools +(i.e. compiler, linker, etc.) are required to build this package. If +not present it is assumed to be false.</p> +<p> +</p> +<h2><a name="requires_packages">requires_packages</a></h2> +<p>Example:</p> +<pre> + requires_packages: + - libiconv: + version: 1.9 + has_library: + - iconv + - charset + has_program: + - iconv + - zlib + has_library: + - z</pre> +<p>(Spec 1.1) [optional] A YAML sequence of fields whose names are the +names of non-perl distributions which are required by this +distribution. Each field is a YAML mapping that more specifically +describes the requirement.</p> +<p> +</p> +<h3><a name="version">version</a></h3> +<p>(Spec 1.1) [optional] A version specification indicating the required +<code>version(s)</code> of the required distribution.</p> +<p> +</p> +<h3><a name="has_library">has_library</a></h3> +<p>(Spec 1.1) [optional] A sequence of names of loadable or linkable +libraries provided by this distribution which must be present for the +distribution to be considered present.</p> +<p> +</p> +<h3><a name="has_program">has_program</a></h3> +<p>(Spec 1.1) [optional] A sequence of names of executable programs +provided by this distribution which must be present for the +distribution to be considered present.</p> +<p> +</p> +<h2><a name="dynamic_config">dynamic_config</a></h2> +<p>Example:</p> +<pre> + dynamic_config: 0</pre> +<p>(Spec 1.0) [optional] A boolean flag indicating whether a <em>Build.PL</em> +or <em>Makefile.PL</em> (or similar) must be executed, or whether this module can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, -sensing the environment, etc.) as part of its build/install process. +sensing the environment, etc.) as part of its build/install process.</p> +<p>Currently Module::Build doesn't actually do anything with this flag +- it's probably going to be up to higher-level tools like CPAN +to do something useful with it. It can potentially bring lots of +security, packaging, and convenience improvements.</p> +<p> </p> - +<h2><a name="configure">configure</a></h2> +<p>Example:</p> +<pre> + configure: auto</pre> +<p>(Spec 1.1) [optional] If the distribution requires configuration, this +field indicates whether the configuration process is <code>interactive</code> +and requires user intervention, <code>scriptable</code> and requires +intervention or an answer script, or <code>auto</code> and can configure its +self automatically.</p> <p> -Currently <tt>Module::Build</tt> doesn't actually do anything with -this flag - it's probably going to be up to higher-level tools like -<tt>CPAN.pm</tt> to do something useful with it. It can potentially -bring lots of security, packaging, and convenience improvements. </p> - -<li><b>generated_by</b><br> -Example: <b>Module::Build version 0.16</b> +<h2><a name="requires_os">requires_os</a></h2> +<p>Example:</p> +<pre> + requires_os: darwin</pre> +<p>(Spec 1.1) [optional] This field contains a sequence of operating +system names (ex. <code>$^O</code> in perl) that are required for this +distribution. This is an implied white list such that this +distribution will not run on any operating system unless it is listed +in this field. For an alternative way to manage operating system +dependencies see <a href="#excludes_os">excludes_os</a> below.</p> +<p><em>Note: If this field is specified, then <a href="#excludes_os">excludes_os</a> must not +be specified.</em></p> <p> -Indicates the tool that was used to create this META.yml file. It's -good form to include both the name of the tool and its version, but -this field is essentially opaque, at least for the moment. </p> - -* Ingy's suggestions -short_description: (add as field, containing abstract, maximum 80 characters, suggested minimum 40 characters) -description: (long version of abstract, should add?) -maturity: alpha, beta, gamma, mature, stable -author_id, owner_id: -categorization, keyword, chapter_id: -URL for further information: (could default to search.cpan.org on PAUSE) - - -namespaces: can be specified for single elements by prepending -dotted-form, i.e. "com.example.my_application.my_property". Default -namespace for META.yml is probably "org.cpan.meta_author" or -something. Precedent for this is Apple's Carbon namespaces, I think. - -</ul> - -<h3>History</h3> - +<h2><a name="excludes_os">excludes_os</a></h2> +<p>Example:</p> +<pre> + excludes_os: MSWin32</pre> +<p>(Spec 1.1) [optional] This field contains a sequence of operating +system names (ex. <code>$^O</code> in perl) that are incompatible with this +distribution. This is an implied black list such that this +distribution will run on any operating system except those listed in +this field. For an alternative way to manage operating system +dependencies see <a href="#requires_os">requires_os</a> above.</p> +<p><em>Note: If this field is specified, then <a href="#requires_os">requires_os</a> must not +be specified.</em></p> +<p> +</p> +<h2><a name="private">private</a></h2> +<p><em>(Deprecated)</em> (Spec 1.0) [optional] This field has been renamed to +<a href="#no_index">no_index</a>. See below.</p> +<p> +</p> +<h2><a name="index">index</a></h2> +<p>Example:</p> +<pre> + index: + file: + - My/Module.pm + dir: + - My/Private + package: + - My::Module::Stuff + namespace: + - My::Module::Stuff</pre> +<p>(Spec 1.1) [optional] A YAML mapping that describes any files, +directories, packages, and namespaces that are to be indexed. Anything +that is not explicitly listed here will be ignored by most compliant +searches and indexers.</p> +<p> +</p> +<h3><a name="file">file</a></h3> +<p>(Spec 1.1) [optional] Include any listed file(s).</p> +<p> +</p> +<h3><a name="dir">dir</a></h3> +<p>(Spec 1.1) [optional] Include everything below the listed +directory(ies).</p> +<p> +</p> +<h3><a name="package">package</a></h3> +<p>(Spec 1.1) [optional] Include the listed package(s).</p> +<p> +</p> +<h3><a name="namespace">namespace</a></h3> +<p>(Spec 1.1) [optional] Includes everything below the listed namespace(s), +but <em>not</em> the listed <code>namespace(s)</code> its self.</p> +<p> +</p> +<h2><a name="no_index">no_index</a></h2> +<p>Example:</p> +<pre> + no_index: + file: + - My/Module.pm + dir: + - My/Private + package: + - My::Module::Stuff + namespace: + - My::Module::Stuff</pre> +<p>(Spec 1.1) [optional] A YAML mapping that describes any files, +directories, packages, and namespaces that are private +(i.e. implementation artifacts) that are not of interest to searching +and indexing tools.</p> +<p> +</p> +<h3><a name="file">file</a></h3> +<p>(Spec 1.1) [optional] Exclude any listed file(s).</p> +<p> +</p> +<h3><a name="dir">dir</a></h3> +<p>(Spec 1.1) [optional] Exclude anything below the listed +directory(ies).</p> +<p> +</p> +<h3><a name="package">package</a></h3> +<p>(Spec 1.1) [optional] Exclude the listed package(s).</p> +<p> +</p> +<h3><a name="namespace">namespace</a></h3> +<p>(Spec 1.1) [optional] Excludes anything below the listed namespace(s), +but <em>not</em> the listed <code>namespace(s)</code> its self.</p> +<p> +</p> +<h2><a name="keywords">keywords</a></h2> +<p>Example:</p> +<pre> + keywords: + - make + - build + - install</pre> +<p>(Spec 1.1) [optional] A sequence of keywords/phrases that describe +this distribution.</p> +<p> +</p> +<h2><a name="generated_by">generated_by</a></h2> +<p>Example:</p> +<pre> + generated_by: Module::Build version 0.20</pre> +<p>(Spec 1.0) [required] Indicates the tool that was used to create this +<em>META.yml</em> file. It's good form to include both the name of the tool +and its version, but this field is essentially opaque, at least for +the moment. If <em>META.yml</em> was generated by hand, it is suggested that +the author be specified here.</p> +<p>[Note: My <em>meta_stats.pl</em> script which I use to gather statistics +regarding <em>META.yml</em> usage prefers the form listed above, i.e. it +splits on /\s+version\s+/ taking the first field as the name of the +tool that generated the file and the second field as version of that +tool. RWS]</p> +<p> +</p> +<h2><a name="auto_regenerate">auto_regenerate</a></h2> +<p>Example:</p> +<pre> + auto_regenerate: false</pre> +<p>(Spec 1.1) [optional] Some tools (Module::Build, ExtUtils::MakeMaker) +automaticaly generate a <em>META.yml</em> file. If you customize this file, +you should use this field to indicate to tools that follow the +specification that they should not overwrite your customizations. The +value of this field is assumed to be 'true' if not present.</p> +<p> +</p> +<hr /> +<h1><a name="see_also">SEE ALSO</a></h1> +<p>CPAN, <a href="http://www.cpan.org/">http://www.cpan.org/</a></p> +<p>CPAN.pm, <a href="http://search.cpan.org/author/ANDK/CPAN/">http://search.cpan.org/author/ANDK/CPAN/</a></p> +<p>CPANPLUS, <a href="http://search.cpan.org/author/KANE/CPANPLUS/">http://search.cpan.org/author/KANE/CPANPLUS/</a></p> +<p>Data::Dumper, <a href="http://search.cpan.org/author/ILYAM/Data-Dumper/">http://search.cpan.org/author/ILYAM/Data-Dumper/</a></p> +<p>ExtUtils::MakeMaker, <a href="http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/">http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/</a></p> +<p>Module::Build, <a href="http://search.cpan.org/author/KWILLIAMS/Module-Build/">http://search.cpan.org/author/KWILLIAMS/Module-Build/</a></p> +<p>Module::Install, <a href="http://search.cpan.org/author/KWILLIAMS/Module-Install/">http://search.cpan.org/author/KWILLIAMS/Module-Install/</a></p> +<p>XML, <a href="http://www.w3.org/XML/">http://www.w3.org/XML/</a></p> +<p>YAML, <a href="http://www.yaml.org/">http://www.yaml.org/</a></p> +<p> +</p> +<hr /> +<h1><a name="history">HISTORY</a></h1> +<dl> +<dt><strong><a name="item_2003">March 14, 2003 (Pi day)</a></strong><br /> +</dt> <ul> -<li><b>March 14, 2003</b> (Pi day) - created version 1.0 of this document.</li> -<li><b>May 8, 2003</b> - added the "dynamic_config" field, which was - missing from the initial version.</li> -</ul> +<li></li> +Created version 1.0 of this document. +<p></p></ul> +<dt><strong><a name="item_may_8_2c_2003">May 8, 2003</a></strong><br /> +</dt> +<ul> +<li></li> +Added the <a href="#dynamic_config">dynamic_config</a> field, which was missing from the initial +version. +<p></p></ul> +<dt><strong><a name="item_november_13_2c_2003">November 13, 2003</a></strong><br /> +</dt> +<ul> +<li></li> +Added more YAML rationale articles. +<p></p> +<li></li> +Fixed existing link to YAML discussion thread to point to new +<a href="http://nntp.x.perl.org/group/">http://nntp.x.perl.org/group/</a> site. +<p></p> +<li></li> +Added and deprecated the <a href="#private">private</a> field. +<p></p> +<li></li> +Added <a href="#abstract">abstract</a>, <a href="#configure">configure</a>, <a href="#requires_packages">requires_packages</a>, +<a href="#requires_os">requires_os</a>, <a href="#excludes_os">excludes_os</a>, and <a href="#no_index">no_index</a> fields. +<p></p> +<li></li> +Bumped version. +<p></p></ul> +<dt><strong><a name="item_november_16_2c_2003">November 16, 2003</a></strong><br /> +</dt> +<ul> +<li></li> +Added <a href="#generation">generation</a>, <a href="#authored_by">authored_by</a> fields. +<p></p> +<li></li> +Add alternative proposal to the <a href="#recommends">recommends</a> field. +<p></p> +<li></li> +Add proposal for a <a href="#requires_build_tools">requires_build_tools</a> field. +<p></p></ul> +<dt><strong><a name="item_december_9_2c_2003">December 9, 2003</a></strong><br /> +</dt> +<ul> +<li></li> +Added link to latest version of this specification on CPAN. +<p></p> +<li></li> +Added section <a href="#version_specifications">VERSION SPECIFICATIONS</a>. +<p></p> +<li></li> +Chang name from Module::Build::META-spec to CPAN::META::Specification. +<p></p> +<li></li> +Add proposal for <a href="#auto_regenerate">auto_regenerate</a> field. +<p></p></ul> +<dt><strong><a name="item_december_15_2c_2003">December 15, 2003</a></strong><br /> +</dt> +<ul> +<li></li> +Add <a href="#index">index</a> field as a compliment to <a href="#no_index">no_index</a> +<p></p> +<li></li> +Add <a href="#keywords">keywords</a> field as a means to aid searching distributions. +<p></p> +<li></li> +Add <a href="#terminology">TERMINOLOGY</a> section to explain certain terms that may be +ambiguous. +<p></p></ul> +</dl> </body> + </html> |
|
From: Ken W. <kwi...@us...> - 2005-07-26 03:19:11
|
Update of /cvsroot/module-build/Module-Build/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12243 Added Files: META-spec.pod Log Message: Randy's POD version of the new META.yml spec --- NEW FILE: META-spec.pod --- =head1 NAME CPAN::META::Specification - Specification for F<META.yml> =head1 SYNOPSIS --- #YAML:1.0 name: Module-Build abstract: Build and install Perl modules version: 0.20 authored_by: - Ken Williams <ke...@ma...> license: perl distribution_type: module requires: Config: 0 Cwd: 0 Data::Dumper: 0 ExtUtils::Install: 0 File::Basename: 0 File::Compare: 0 File::Copy: 0 File::Find: 0 File::Path: 0 File::Spec: 0 IO::File: 0 perl: 5.005_03 recommends: Archive::Tar: 1.00 ExtUtils::Install: 0.3 ExtUtils::ParseXS: 2.02 Pod::Text: 0 YAML: 0.35 build_requires: Test: 0 meta-spec: version: 1.1 url: <http://search.cpan.org/dist/CPAN-META-Specification-1.1/> generated_by: Module::Build version 0.20 =head1 DESCRIPTION This document describes version 1.1 of the F<META.yml> specification. The F<META.yml> file describes important properties of contributed Perl distributions such as the ones found on CPAN. It is typically created by tools like Module::Build, Module::Install, and ExtUtils::MakeMaker. The fields in the F<META.yml> file are meant to be helpful for people maintaining module collections (like CPAN), for people writing installation tools (like CPAN.pm or CPANPLUS), or just for people who want to know some stuff about a distribution before downloading it and starting to install it. I<Note: The latest version of this specification can always be found at L<http://search.cpan.org/dist/CPAN-META-Specification/>.> =head1 FORMAT F<META.yml> files are written in the YAML format (see L<http://www.yaml.org/>). See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper: =over 4 =item * Module::Build design plans L<http://nntp.x.perl.org/group/perl.makemaker/406> =item * Not keen on YAML L<http://nntp.x.perl.org/group/perl.module-authors/1353> =item * META Concerns L<http://nntp.x.perl.org/group/perl.module-authors/1385> =back =head1 TERMINOLOGY =over 4 =item distribution This is the primary object described by the F<META.yml> specification. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed for other developers to use. =item module This refers to a reusable library of code typically contained in a single file. Currently, we primarily talk of perl modules, but this specification should be open enough to apply to other languages as well (ex. python, ruby). =back =head1 VERSION SPECIFICATIONS Some fields require a version specification (ex. L<"requires">, L<"recommends">, L<"build_requires">, etc.). This section details the version specications that are currently supported. If a single version is listed, then that version is considered to be the minimum version supported. If 0 is given as the version number, then any version is supported. Additionally, for more complicated requirements, the specification supports a list of versions, each of which may be optionally preceeded by a relational operator. Supported operators include E<lt> (less than), E<lt>= (less than or equal), E<gt> (greater than), E<gt>= (greater than or equal), and != (not equal). If a list is given then it is evaluated from left to right so that any specifications in the list that conflict with a previous specification are overriden by the later. Examples: >= 1.2, != 1.5, < 2.0 Any version from version 1.2 onward, except version 1.5, that also preceeds version 2.0. =head1 HEADER The first line of a F<META.yml> file should be a valid YAML document header like C<"--- #YAML:1.0">. =head1 FIELDS The rest of the F<META.yml> file is one big YAML mapping whose keys are described here. =head2 meta-spec Example: meta-spec: url: <http://search.cpan.org/dist/CPAN-META-Specification-1.1/> version: 1.1 (Spec 1.1) [required] This mapping indicates the location of the version of the META.yml specification used along with the version number of that specification. =head2 name Example: name: Module-Build (Spec 1.0) [required] The name of the distribution which is often created by taking the "main module" in the distribution and changing "::" to "-". Sometimes it's completely different, however, as in the case of the libww-perl distribution (see L<http://search.cpan.org/author/GAAS/libwww-perl/>). =head2 version Example: version: 0.20 (Spec 1.0) [required] The version of the distribution to which the F<META.yml> file refers. =head2 generation Example: generation: 2 (Spec 1.1) [optional] Indicates which generation this version belongs to. A generation is a way of indicating that a collection of versions are all compatible with each other, whereas a version from a different generation may include incompatibilities or other major differences. This allows tools like CPAN and CPANPLUS to present to its users the greatest version in each generation to choose from when the user queries a package instead of only presenting a single highest version. =head2 abstract Example: abstract: Build and install Perl modules. (Spec 1.1) [required] A short description of the purpose of the distribution. =head2 authored_by Example: authored_by: - Ken Williams <ke...@ma...> (Spec 1.1) [required] A YAML sequence indicating the author(s) of the distribution. The prefered form is author-name <email-address>. =head2 license Example: license: perl (Spec 1.0) [required] The license under which this distribution may be used and redistributed. See L<Module::Build> for the list of valid options. =head2 distribution_type Example: distribution_type: module (Spec 1.0) [optional] What kind of stuff is contained in this distribution. Most things on CPAN are C<module>s (which can also mean a collection of modules), but some things are C<script>s. =head2 requires Example: requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] A YAML mapping indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in L<Module::Build> for the "requires" parameter. =head2 recommends Example: recommends: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] A YAML mapping indicating the Perl modules this distribution recommends for enhanced operation. I<ALTERNATIVE: It may be desirable to present to the user which features are dependant on which modules so they can make an informed decision about which recommended modules to install.> Example: optional_features: - foo: description: Provides the ability to blah. requires: Data::Dumper: 0 File::Find: 1.03 - bar: description: This feature is not available on this platform. excludes_os: MSWin32 I<(Spec 1.1) [optional] A YAML sequence of names for optional features which are made available when its requirements are met. For each feature a description is provided along with any of L<"requires">, L<"build_requires">, L<"conflicts">, L<"requires_packages">, L<"requires_os">, and L<"excludes_os"> which have the same meaning in this subcontext as described elsewhere in this document.> =head2 build_requires Example: build_requires: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] A YAML mapping indicating the Perl modules required for building and/or testing of this distribution. These dependencies are not required after the module is installed. =head2 conflicts Example: conflicts: Data::Dumper: 0 File::Find: 1.03 (Spec 1.0) [optional] A YAML mapping indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation. =head2 requires_build_tools Example: requires_build_tools: 1 (Spec 1.1) [optional] A boolean that indicates external build tools (i.e. compiler, linker, etc.) are required to build this package. If not present it is assumed to be false. =head2 requires_packages Example: requires_packages: - libiconv: version: 1.9 has_library: - iconv - charset has_program: - iconv - zlib has_library: - z (Spec 1.1) [optional] A YAML sequence of fields whose names are the names of non-perl distributions which are required by this distribution. Each field is a YAML mapping that more specifically describes the requirement. =head3 version (Spec 1.1) [optional] A version specification indicating the required version(s) of the required distribution. =head3 has_library (Spec 1.1) [optional] A sequence of names of loadable or linkable libraries provided by this distribution which must be present for the distribution to be considered present. =head3 has_program (Spec 1.1) [optional] A sequence of names of executable programs provided by this distribution which must be present for the distribution to be considered present. =head2 dynamic_config Example: dynamic_config: 0 (Spec 1.0) [optional] A boolean flag indicating whether a F<Build.PL> or F<Makefile.PL> (or similar) must be executed, or whether this module can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process. Currently Module::Build doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like CPAN to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements. =head2 configure Example: configure: auto (Spec 1.1) [optional] If the distribution requires configuration, this field indicates whether the configuration process is C<interactive> and requires user intervention, C<scriptable> and requires intervention or an answer script, or C<auto> and can configure its self automatically. =head2 requires_os Example: requires_os: darwin (Spec 1.1) [optional] This field contains a sequence of operating system names (ex. C<$^O> in perl) that are required for this distribution. This is an implied white list such that this distribution will not run on any operating system unless it is listed in this field. For an alternative way to manage operating system dependencies see L</"excludes_os"> below. I<Note: If this field is specified, then L</"excludes_os"> must not be specified.> =head2 excludes_os Example: excludes_os: MSWin32 (Spec 1.1) [optional] This field contains a sequence of operating system names (ex. C<$^O> in perl) that are incompatible with this distribution. This is an implied black list such that this distribution will run on any operating system except those listed in this field. For an alternative way to manage operating system dependencies see L</"requires_os"> above. I<Note: If this field is specified, then L</"requires_os"> must not be specified.> =head2 private I<(Deprecated)> (Spec 1.0) [optional] This field has been renamed to L</"no_index">. See below. =head2 index Example: index: file: - My/Module.pm dir: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff (Spec 1.1) [optional] A YAML mapping that describes any files, directories, packages, and namespaces that are to be indexed. Anything that is not explicitly listed here will be ignored by most compliant searches and indexers. =head3 file (Spec 1.1) [optional] Include any listed file(s). =head3 dir (Spec 1.1) [optional] Include everything below the listed directory(ies). =head3 package (Spec 1.1) [optional] Include the listed package(s). =head3 namespace (Spec 1.1) [optional] Includes everything below the listed namespace(s), but I<not> the listed namespace(s) its self. =head2 no_index Example: no_index: file: - My/Module.pm dir: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff (Spec 1.1) [optional] A YAML mapping that describes any files, directories, packages, and namespaces that are private (i.e. implementation artifacts) that are not of interest to searching and indexing tools. =head3 file (Spec 1.1) [optional] Exclude any listed file(s). =head3 dir (Spec 1.1) [optional] Exclude anything below the listed directory(ies). =head3 package (Spec 1.1) [optional] Exclude the listed package(s). =head3 namespace (Spec 1.1) [optional] Excludes anything below the listed namespace(s), but I<not> the listed namespace(s) its self. =head2 keywords Example: keywords: - make - build - install (Spec 1.1) [optional] A sequence of keywords/phrases that describe this distribution. =head2 generated_by Example: generated_by: Module::Build version 0.20 (Spec 1.0) [required] Indicates the tool that was used to create this F<META.yml> file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If F<META.yml> was generated by hand, it is suggested that the author be specified here. [Note: My F<meta_stats.pl> script which I use to gather statistics regarding F<META.yml> usage prefers the form listed above, i.e. it splits on /\s+version\s+/ taking the first field as the name of the tool that generated the file and the second field as version of that tool. RWS] =head2 auto_regenerate Example: auto_regenerate: false (Spec 1.1) [optional] Some tools (Module::Build, ExtUtils::MakeMaker) automaticaly generate a F<META.yml> file. If you customize this file, you should use this field to indicate to tools that follow the specification that they should not overwrite your customizations. The value of this field is assumed to be 'true' if not present. =head1 SEE ALSO CPAN, L<http://www.cpan.org/> CPAN.pm, L<http://search.cpan.org/author/ANDK/CPAN/> CPANPLUS, L<http://search.cpan.org/author/KANE/CPANPLUS/> Data::Dumper, L<http://search.cpan.org/author/ILYAM/Data-Dumper/> ExtUtils::MakeMaker, L<http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/> Module::Build, L<http://search.cpan.org/author/KWILLIAMS/Module-Build/> Module::Install, L<http://search.cpan.org/author/KWILLIAMS/Module-Install/> XML, L<http://www.w3.org/XML/> YAML, L<http://www.yaml.org/> =head1 HISTORY =over 4 =item March 14, 2003 (Pi day) =over 2 =item * Created version 1.0 of this document. =back =item May 8, 2003 =over 2 =item * Added the L</"dynamic_config"> field, which was missing from the initial version. =back =item November 13, 2003 =over 2 =item * Added more YAML rationale articles. =item * Fixed existing link to YAML discussion thread to point to new L<http://nntp.x.perl.org/group/> site. =item * Added and deprecated the L<"private"> field. =item * Added L<"abstract">, L<"configure">, L<"requires_packages">, L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields. =item * Bumped version. =back =item November 16, 2003 =over 2 =item * Added L<"generation">, L<"authored_by"> fields. =item * Add alternative proposal to the L<"recommends"> field. =item * Add proposal for a L<"requires_build_tools"> field. =back =item December 9, 2003 =over 2 =item * Added link to latest version of this specification on CPAN. =item * Added section L<"VERSION SPECIFICATIONS">. =item * Chang name from Module::Build::META-spec to CPAN::META::Specification. =item * Add proposal for L<"auto_regenerate"> field. =back =item December 15, 2003 =over 2 =item * Add L<"index"> field as a compliment to L<"no_index"> =item * Add L<"keywords"> field as a means to aid searching distributions. =item * Add L<"TERMINOLOGY"> section to explain certain terms that may be ambiguous. =back =back |
|
From: Ken W. <kwi...@us...> - 2005-07-25 03:53:08
|
Update of /cvsroot/module-build/Module-Build/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8380/website Modified Files: META-spec.html Log Message: A slightly later version (amended by Randy [I think]), preserved for posterity Index: META-spec.html =================================================================== RCS file: /cvsroot/module-build/Module-Build/website/META-spec.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- META-spec.html 5 Sep 2004 03:59:03 -0000 1.2 +++ META-spec.html 25 Jul 2005 03:52:58 -0000 1.3 @@ -68,10 +68,33 @@ Example: <b>0.16</b> <p> The version of the distribution to which the META.yml file refers. +This is a mandatory field. +</p> + +<p> + The version is essentially an arbitrary string, but <i>must</i> be + only ASCII characters, and <i>strongly should</i> be of the format + integer-dot-digit-digit, i.e. <tt>25.57</tt>, optionally followed by + underscore-digit-digit, i.e. <tt>25.57_04</tt>. +</p> + +<p> + The standard tools that deal with module distribution (PAUSE, CPAN, + etc.) form an identifier for each distribution by joining the 'name' + and 'version' attributes with a dash (<tt>-</tt>) character. Tools + who are prepared to deal with distributions that have no version + numbers generally omit the dash as well. </p> + <li><b>license</b><br> Example: <b>perl</b> + +<p> + a descriptive term for the licenses ... not authoritative, but must + be consistent with licensure statements in the READMEs, documentation, etc. +</p> + <p> The license under which this distribution may be used and redistributed. See <a @@ -79,6 +102,14 @@ for the list of valid options. </p> +<li><b>license_uri</b><br> +<p> + This should contain a URI where the exact terms of the license may be found. +</p> + +(change "unrestricted" to "redistributable"?) + + <li><b>distribution_type</b><br> Example: <b>module</b> <p> @@ -87,6 +118,18 @@ modules), but some things are <code>script</code>s. </p> +This field is basically meaningless, and tools (like Module::Build or +MakeMaker) will likely stop generating it in the future. + + +<li><b>private</b><br> +WTF is going on here? + +index_ignore: any application that indexes the contents of +distributions (PAUSE, search.cpan.org) ought to ignore the items +(packages, files, directories, namespace hierarchies). + + <li><b>requires</b><br> Example:<br> <b> @@ -149,6 +192,14 @@ distribution is installed. This is a pretty uncommon situation. </p> +- possibly separate out test-time prereqs, complications include: can +tests be meaningfully preserved for later running? are test-time +prereqs in addition to build-time, or exclusive? + +- make official location for installed *distributions*, which can +contain tests, etc. + + <li><b>dynamic_config</b><br> Example: <b>0</b> <p> @@ -175,15 +226,21 @@ this field is essentially opaque, at least for the moment. </p> -</ul> +* Ingy's suggestions +short_description: (add as field, containing abstract, maximum 80 characters, suggested minimum 40 characters) +description: (long version of abstract, should add?) +maturity: alpha, beta, gamma, mature, stable +author_id, owner_id: +categorization, keyword, chapter_id: +URL for further information: (could default to search.cpan.org on PAUSE) -<h3>Related Projects</h3> -<dl> - <dt>DOAP</dt> - <dd>An RDF vocabulary to describe software projects. <a - href="http://usefulinc.com/doap">http://usefulinc.com/doap</a>.</dd> -</dl> +namespaces: can be specified for single elements by prepending +dotted-form, i.e. "com.example.my_application.my_property". Default +namespace for META.yml is probably "org.cpan.meta_author" or +something. Precedent for this is Apple's Carbon namespaces, I think. + +</ul> <h3>History</h3> |
|
From: Ken W. <kwi...@us...> - 2005-07-25 03:52:28
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8226/lib/Module/Build Modified Files: Base.pm Log Message: Add the license_url field if present Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.462 retrieving revision 1.463 diff -u -d -r1.462 -r1.463 --- Base.pm 21 Jul 2005 00:52:46 -0000 1.462 +++ Base.pm 25 Jul 2005 03:52:10 -0000 1.463 @@ -2444,8 +2444,26 @@ } BEGIN { *scripts = \&script_files; } -sub valid_licenses { - return { map {$_, 1} qw(perl gpl artistic lgpl bsd mit mozilla apache open_source unrestricted restrictive unknown) }; +{ + my %licenses = + ( + perl => 'http://search.cpan.org/src/NWCLARK/perl-5.8.7/README', + gpl => 'http://www.opensource.org/licenses/gpl-license.php', + apache => 'http://apache.org/licenses/LICENSE-2.0', + artistic => 'http://opensource.org/licenses/artistic-license.php', + lgpl => 'http://opensource.org/licenses/artistic-license.php', + bsd => 'http://www.opensource.org/licenses/bsd-license.php', + gpl => 'http://www.opensource.org/licenses/gpl-license.php', + mit => 'http://opensource.org/licenses/mit-license.php', + mozilla => 'http://opensource.org/licenses/mozilla1.1.php', + open_source => undef, + unrestricted => undef, + restrictive => undef, + unknown => undef, + ); + sub valid_licenses { + return \%licenses; + } } sub meta_add { @@ -2572,6 +2590,9 @@ (my $name = $_) =~ s/^dist_//; $node->{$name} = $self->$_(); } + if (defined( my $url = $self->valid_licenses->{ $self->license } )) { + $node->{license_url} = $url; + } foreach ( @{$self->prereq_action_types} ) { $node->{$_} = $p->{$_} if exists $p->{$_} and keys %{ $p->{$_} }; |
|
From: Ken W. <kwi...@us...> - 2005-07-21 00:52:55
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31349/lib/Module/Build Modified Files: Base.pm Log Message: Refactor META.yml creation a bit Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.461 retrieving revision 1.462 diff -u -d -r1.461 -r1.462 --- Base.pm 19 Jul 2005 00:14:21 -0000 1.461 +++ Base.pm 21 Jul 2005 00:52:46 -0000 1.462 @@ -530,6 +530,7 @@ __PACKAGE__->add_property(html_backlink => '__top'); __PACKAGE__->add_property(meta_add => {}); __PACKAGE__->add_property(meta_merge => {}); +__PACKAGE__->add_property(metafile => 'META.yml'); __PACKAGE__->add_property($_) for qw( base_dir dist_name @@ -2309,9 +2310,9 @@ delete $dist_files->{SIGNATURE}; # Don't copy, create a fresh one die "No files found in MANIFEST - try running 'manifest' action?\n" unless ($dist_files and keys %$dist_files); - - $self->log_warn("*** Did you forget to add $self->{metafile} to the MANIFEST?\n") - unless exists $dist_files->{$self->{metafile}}; + my $metafile = $self->metafile; + $self->log_warn("*** Did you forget to add $metafile to the MANIFEST?\n") + unless exists $dist_files->{$metafile}; my $dist_dir = $self->dist_dir; $self->delete_filetree($dist_dir); @@ -2480,7 +2481,7 @@ my $self = shift; my $p = $self->{properties}; - my $file = $self->{metafile}; + my $file = $self->metafile; my $fh = IO::File->new("> $file") or die "Can't open $file: $!"; @@ -2503,15 +2504,15 @@ $self->do_create_makefile_pl if $self->create_makefile_pl; $self->do_create_readme if $self->create_readme; - $self->do_create_meta_yml; + $self->do_create_metafile; } -sub do_create_meta_yml { +sub do_create_metafile { my $self = shift; return if $self->{wrote_metadata}; my $p = $self->{properties}; - $self->{metafile} = 'META.yml'; + my $metafile = $self->metafile; unless ($p->{license}) { $self->log_warn("No license specified, setting license = 'unknown'\n"); @@ -2522,8 +2523,8 @@ } # If we're in the distdir, the metafile may exist and be non-writable. - $self->delete_filetree($self->{metafile}); - $self->log_info("Creating $self->{metafile}\n"); + $self->delete_filetree($metafile); + $self->log_info("Creating $metafile\n"); # Since we're building ourself, we have to do some special stuff # here: the ConfigData module is found in blib/lib. @@ -2533,6 +2534,13 @@ push @INC, File::Spec->catdir($self->blib, 'lib'); } + $self->write_metafile; +} + +sub write_metafile { + my $self = shift; + my $metafile = $self->metafile; + require Module::Build::ConfigData; # Only works after the 'build' if (Module::Build::ConfigData->feature('YAML_support')) { require YAML; @@ -2542,7 +2550,7 @@ # YAML API changed after version 0.30 my $yaml_sub = $YAML::VERSION le '0.30' ? \&YAML::StoreFile : \&YAML::DumpFile; - $self->{wrote_metadata} = $yaml_sub->($self->{metafile}, $node ); + $self->{wrote_metadata} = $yaml_sub->($metafile, $node ); } else { $self->log_warn(<<EOM); @@ -2553,7 +2561,7 @@ $self->_write_minimal_metadata; } - $self->_add_to_manifest('MANIFEST', $self->{metafile}); + $self->_add_to_manifest('MANIFEST', $metafile); } sub prepare_metadata { |
|
From: Ken W. <kwi...@us...> - 2005-07-21 00:52:54
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31349 Modified Files: Changes Log Message: Refactor META.yml creation a bit Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.365 retrieving revision 1.366 diff -u -d -r1.365 -r1.366 --- Changes 20 Jul 2005 02:39:36 -0000 1.365 +++ Changes 21 Jul 2005 00:52:45 -0000 1.366 @@ -19,6 +19,14 @@ - Fixed a pretty significant typo in the documentation for auto_features. [Spotted by Jonas B. Nielsen] + - In order to aid people who want to do customization of the META.yml + file, we've added a "metafile" property that can then be easily + overridden in subclasses, changed do_create_meta_yml() to + do_create_metafile(), and split out the code that actually + generates the YAML into a new method, write_metafile(). [David + Wheeler] + + 0.27_02 (Beta for 0.28) Fri Jul 15 07:34:58 CDT 2005 - Provided initial support for the --prefix installation parameter, |
|
From: Ken W. <kwi...@us...> - 2005-07-20 02:39:45
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29267 Modified Files: Changes Log Message: Mention CBuilder Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.364 retrieving revision 1.365 diff -u -d -r1.364 -r1.365 --- Changes 19 Jul 2005 00:29:01 -0000 1.364 +++ Changes 20 Jul 2005 02:39:36 -0000 1.365 @@ -2,6 +2,11 @@ 0.27_03 + - We now use ExtUtils::CBuilder to do all compiling of C code (for + example, when compiling XS modules). (This change actually + occurred in 0.27_01, but it was mistakenly omitted from the Changes + file.) + - Fixed an issue on Win32 (and other case-tolerant non-case-preserving systems, possibly like VMS?) in which the current working directory would sometimes be reported with @@ -120,6 +125,9 @@ - Now reads per-action default options from '$ENV{HOME}/.modulebuildrc' if it exists. Command line options override anything set in the rc file. + - We now use ExtUtils::CBuilder to do all compiling of C code (for + example, when compiling XS modules). + - Extend prerequisite specifications to apply to all actions. It is now a fatal error if 'requires' or 'conflicts' for a given action are not satisfied, except where necessary for backwards compatability. |
|
From: Ken W. <kwi...@us...> - 2005-07-19 00:29:09
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24983/lib/Module/Build Modified Files: Authoring.pod Log Message: Fix (and otherwise improve) the docs for auto_features Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Authoring.pod 19 Jul 2005 00:14:21 -0000 1.11 +++ Authoring.pod 19 Jul 2005 00:29:01 -0000 1.12 @@ -127,20 +127,25 @@ pg_support => { description => "Interface with Postgres databases", - requires => q{ DBD::Pg >= 23.3 && DateTime::Format::Pg }, + requires => { 'DBD::Pg' => 23.3, + 'DateTime::Format::Pg' => 0 }, }, mysql_support => { description => "Interface with MySQL databases", - requires => q{ DBD::mysql >= 17.9 && DateTime::Format::Pg }, + requires => { 'DBD::mysql' => 17.9, + 'DateTime::Format::MySQL' => 0}, }, ); -For each feature named, the prerequisite options will be checked, and +For each feature named, the required prerequisites will be checked, and if there are no failures, the feature will be enabled (set to C<1>). Otherwise the failures will be displayed to the user and the feature will be disabled (set to C<0>). +See the documentation for L<requires> for the details of how +requirements can be specified. + =item autosplit An optional C<autosplit> argument specifies a file which should be run @@ -173,6 +178,9 @@ the body of installed modules, and facilitates correct dependency checking on binary/packaged distributions of the module. +See the documentation for L<requires> for the details of how +requirements can be specified. + =item c_source An optional C<c_source> argument specifies a directory which contains @@ -188,6 +196,9 @@ refuse to install the given module if the given module/version is also installed. +See the documentation for L<requires> for the details of how +requirements can be specified. + =item create_makefile_pl This parameter lets you use Module::Build::Compat during the @@ -562,12 +573,15 @@ If a module is recommended but not required, all tests should still pass if the module isn't installed. This may mean that some tests -will be skipped if recommended dependencies aren't present. +may be skipped if recommended dependencies aren't present. Automated tools like CPAN.pm should inform the user when recommended modules aren't installed, and it should offer to install them if it wants to be helpful. +See the documentation for L<requires> for the details of how +requirements can be specified. + =item requires An optional C<requires> argument specifies any module prerequisites that @@ -596,7 +610,7 @@ One note: currently C<Module::Build> doesn't actually I<require> the user to have dependencies installed, it just strongly urges. In the -future we may require it. There's now a C<recommends> section for +future we may require it. There's also a C<recommends> section for things that aren't absolutely required. Automated tools like CPAN.pm should refuse to install a module if one |
|
From: Ken W. <kwi...@us...> - 2005-07-19 00:29:09
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24983 Modified Files: Changes Log Message: Fix (and otherwise improve) the docs for auto_features Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.363 retrieving revision 1.364 diff -u -d -r1.363 -r1.364 --- Changes 19 Jul 2005 00:14:20 -0000 1.363 +++ Changes 19 Jul 2005 00:29:01 -0000 1.364 @@ -11,6 +11,9 @@ - Added the Apache, MIT, and Mozilla licenses to the list of licenses that this module knows about. [Bob Ippolito] + - Fixed a pretty significant typo in the documentation for + auto_features. [Spotted by Jonas B. Nielsen] + 0.27_02 (Beta for 0.28) Fri Jul 15 07:34:58 CDT 2005 - Provided initial support for the --prefix installation parameter, |
|
From: Ken W. <kwi...@us...> - 2005-07-19 00:14:37
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20521/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Add Apache, MIT, and Mozilla licenses Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.460 retrieving revision 1.461 diff -u -d -r1.460 -r1.461 --- Base.pm 16 Jul 2005 03:10:53 -0000 1.460 +++ Base.pm 19 Jul 2005 00:14:21 -0000 1.461 @@ -2444,7 +2444,7 @@ BEGIN { *scripts = \&script_files; } sub valid_licenses { - return { map {$_, 1} qw(perl gpl artistic lgpl bsd open_source unrestricted restrictive unknown) }; + return { map {$_, 1} qw(perl gpl artistic lgpl bsd mit mozilla apache open_source unrestricted restrictive unknown) }; } sub meta_add { Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Authoring.pod 8 Jul 2005 01:43:32 -0000 1.10 +++ Authoring.pod 19 Jul 2005 00:14:21 -0000 1.11 @@ -387,6 +387,11 @@ =over 4 +=item apache + +The distribution is licensed under the Apache Software License +(http://opensource.org/licenses/apachepl.php). + =item artistic The distribution is licensed under the Artistic License, as specified @@ -399,15 +404,26 @@ =item gpl -The distribution is distributed under the terms of the Gnu General +The distribution is licensed under the terms of the Gnu General Public License (http://www.opensource.org/licenses/gpl-license.php). =item lgpl -The distribution is distributed under the terms of the Gnu Lesser +The distribution is licensed under the terms of the Gnu Lesser General Public License (http://www.opensource.org/licenses/lgpl-license.php). +=item mit + +The distribution is licensed under the MIT License +(http://opensource.org/licenses/mit-license.php). + +=item mozilla + +The distribution is licensed under the Mozilla Public +License. (http://opensource.org/licenses/mozilla1.0.php or +http://opensource.org/licenses/mozilla1.1.php) + =item open_source The distribution is licensed under some other Open Source @@ -437,7 +453,10 @@ Note that you must still include the terms of your license in your documentation - this field only lets automated tools figure out your -licensing restrictions. Humans still need something to read. +licensing restrictions. Humans still need something to read. If you +choose to provide this field, you should make sure that you keep it in +sync with your written documentation if you ever change your licensing +terms. It is a fatal error to use a license other than the ones mentioned above. This is not because I wish to impose licensing terms on you - |
|
From: Ken W. <kwi...@us...> - 2005-07-19 00:14:37
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20521 Modified Files: Changes Log Message: Add Apache, MIT, and Mozilla licenses Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.362 retrieving revision 1.363 diff -u -d -r1.362 -r1.363 --- Changes 16 Jul 2005 03:10:52 -0000 1.362 +++ Changes 19 Jul 2005 00:14:20 -0000 1.363 @@ -8,6 +8,9 @@ different case, fooling us into thinking that we were in the wrong directory. [David Golden] + - Added the Apache, MIT, and Mozilla licenses to the list of licenses + that this module knows about. [Bob Ippolito] + 0.27_02 (Beta for 0.28) Fri Jul 15 07:34:58 CDT 2005 - Provided initial support for the --prefix installation parameter, |
|
From: Ken W. <kwi...@us...> - 2005-07-16 03:54:37
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6727/t Modified Files: metadata.t Log Message: Use is_deeply() for clarity. Note that this exposes a few underspecified cases. Index: metadata.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- metadata.t 10 Jul 2005 12:25:35 -0000 1.3 +++ metadata.t 16 Jul 2005 03:54:28 -0000 1.4 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 102; +use Test::More tests => 33; use File::Spec (); @@ -33,7 +33,7 @@ use Module::Build; my $mb = Module::Build->new_from_context; - +my $provides; # Used a bunch of times below ############################## Single Module @@ -46,22 +46,17 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -my $provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), 'single package' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', ' in corresponding file' ); -is( $provides->{Simple}{version}, '1.23', ' with version' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Simple' => {file => 'lib/Simple.pm', + version => '1.23'}}); $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), 'single package' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', ' in corresponding file' ); -is( $provides->{Simple}{version}, undef, ' without version' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Simple' => {file => 'lib/Simple.pm'}}); # File with no corresponding package (w/ or w/o version) # Simple.pm => Foo::Bar v1.23 @@ -72,26 +67,17 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{'Foo::Bar'} ), 'single package' ); -is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm', - ' in non-corresponding file' ); -is( $provides->{'Foo::Bar'}{version}, '1.23', ' with version' ); -ok( ! exists( $provides->{Simple} ), ' no corresponding package for file' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Foo::Bar' => { file => 'lib/Simple.pm', + version => '1.23' }}); $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo::Bar; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{'Foo::Bar'} ), 'single package' ); -is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm', - ' in non-corresponding file' ); -is( $provides->{'Foo::Bar'}{version}, undef, ' without version' ); -ok( ! exists( $provides->{Simple} ), ' no corresponding package for file' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Foo::Bar' => { file => 'lib/Simple.pm'}}); # Single file with multiple differing packages (w/ or w/o version) @@ -106,13 +92,11 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -is( $provides->{Simple}{version}, '1.23', 'multiple packages with versions' ); -is( $provides->{'Foo::Bar'}{version}, '1.23' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' with file corresponding to one package' ); -is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm' ); -is( keys( %$provides ), 2 ); +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }, + 'Foo::Bar' => { file => 'lib/Simple.pm', + version => '1.23' }}); # Single file with multiple differing packages, no corresponding package @@ -127,12 +111,11 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -is( $provides->{Foo}{version}, '1.23', 'multiple packages with versions' ); -is( $provides->{'Foo::Bar'}{version}, '1.23' ); -ok( ! exists( $provides->{Simple} ), - ' without package corresponding to file' ); -is( keys( %$provides ), 2 ); +is_deeply($mb->find_dist_packages, + {'Foo' => { file => 'lib/Simple.pm', + version => '1.23' }, + 'Foo::Bar' => { file => 'lib/Simple.pm', + version => '1.23' }}); # Single file with same package appearing multiple times, no version @@ -146,11 +129,8 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), - 'single file with corresponding package multiple times' ); -ok( ! exists( $provides->{Simple}{version} ), ' without version' ); -is( keys( %$provides ), 1, ' records only one occurrence' ); +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm' }}); # Single file with same package appearing multiple times, single @@ -165,12 +145,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), - 'single file with corresponding package multiple times' ); -is( $provides->{Simple}{version}, '1.23', - ' with version only in first occurrence' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); # Single file with same package appearing multiple times, single @@ -185,12 +162,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), - 'single file with corresponding package multiple times' ); -is( $provides->{Simple}{version}, '1.23', - ' with version only in second occurrence' ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); # Single file with same package appearing multiple times, conflicting versions @@ -207,11 +181,10 @@ my $err = ''; $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Simple} ), - 'single file with corresponding package multiple times' ); +is_deeply($provides, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); # XXX should be 2.34? like( $err, qr/already declared/, ' with conflicting versions reported' ); -is( $provides->{Simple}{version}, '1.23', ' only first version is recorded' ); -is( keys( %$provides ), 1 ); # (Same as above three cases except with no corresponding package) @@ -227,11 +200,10 @@ $dist->regen( clean => 1 ); $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( ! exists( $provides->{Simple} ), - 'single file with non-corresponding package multiple times' ); +is_deeply($provides, + {'Foo' => { file => 'lib/Simple.pm', + version => '1.23' }}); # XXX should be 2.34? like( $err, qr/already declared/, ' with conflicting versions reported' ); -is( $provides->{Foo}{version}, '1.23', ' only first version is recorded' ); -is( keys( %$provides ), 1 ); @@ -249,13 +221,8 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); -ok( ! exists( $provides->{Simple}{version} ), ' without any versions' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' only recording occurrence in corresponding file' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -272,14 +239,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); -is( $provides->{Simple}{version}, '1.23', - ' with version in corresponding file' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' only recording occurrence with version' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -297,14 +259,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); -is( $provides->{Simple}{version}, '1.23', - ' with version in non-corresponding file' ); -is( $provides->{Simple}{file}, 'lib/Simple2.pm', - ' only recording occurrence with version' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple2.pm', + version => '1.23' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -323,14 +280,11 @@ $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is_deeply($provides, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); like( $err, qr/Found conflicting versions for package/, ' with conflicting versions reported' ); -is( $provides->{Simple}{version}, '1.23', - ' only recording occurrence with package in corresponding file' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm' ); -is( keys( %$provides ), 1 ); - $dist->remove_file( 'lib/Simple2.pm' ); @@ -349,13 +303,9 @@ $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); -is( $provides->{Simple}{version}, '1.23', ' with same version' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' only recording occurrence with package in corresponding file' ); -is( $err, '', ' no conflicts reported' ); -is( keys( %$provides ), 1 ); - +is_deeply($provides, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -376,11 +326,8 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Foo} ), 'multiple files with same package' ); -ok( ! exists( $provides->{Foo}{version} ), ' without any versions' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Foo' => { file => 'lib/Simple.pm' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -397,13 +344,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Foo} ), 'multiple files with same package' ); -is( $provides->{Foo}{version}, '1.23' ); -is( $provides->{Foo}{file}, 'lib/Simple.pm', - ' only recording occurrence with version' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Foo' => { file => 'lib/Simple.pm', + version => '1.23' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -420,13 +363,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Foo} ), 'multiple files with same package' ); -is( $provides->{Foo}{version}, '1.23' ); -is( $provides->{Foo}{file}, 'lib/Simple2.pm', - ' only recording occurrence with version' ); -is( keys( %$provides ), 1 ); - +is_deeply($mb->find_dist_packages, + {'Foo' => { file => 'lib/Simple2.pm', + version => '1.23' }}); $dist->remove_file( 'lib/Simple2.pm' ); @@ -445,13 +384,11 @@ $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +is_deeply($provides, + {'Foo' => { file => 'lib/Simple.pm', + version => '1.23' }}); like( $err, qr/Found conflicting versions for package/, ' with conflicting versions reported' ); -ok( exists( $provides->{Foo}{version} ), ' recording any version' ); -ok( exists( $provides->{Foo}{file} ), ' recording any file' ); -is( keys( %$provides ), 1 ); - $dist->remove_file( 'lib/Simple2.pm' ); @@ -470,15 +407,14 @@ $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Foo} ), 'multiple files with same package' ); -is( $provides->{Foo}{version}, '1.23', ' with same version' ); +is_deeply($provides, + {'Foo' => { file => 'lib/Simple.pm', + version => '1.23' }}); is( $err, '', ' no conflicts reported' ); -is( keys( %$provides ), 1 ); - $dist->remove_file( 'lib/Simple2.pm' ); ############################################################ -# Conflicts amoung primary & multiple alternatives +# Conflicts among primary & multiple alternatives # multiple files, conflicting version in corresponding file $dist->change_file( 'lib/Simple.pm', <<'---' ); @@ -496,14 +432,11 @@ $dist->regen( clean => 1 ); $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is_deeply($provides, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); like( $err, qr/Found conflicting versions for package/, ' corresponding package conflicts with multiple alternatives' ); -is( $provides->{Simple}{version}, '1.23' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' recording occurrence in corresponding file' ); -is( keys( %$provides ), 1 ); - $dist->remove_file( 'lib/Simple2.pm' ); $dist->remove_file( 'lib/Simple3.pm' ); @@ -523,14 +456,11 @@ $dist->regen( clean => 1 ); $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is_deeply($provides, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); like( $err, qr/Found conflicting versions for package/, ' only one alternative conflicts with corresponding package' ); -is( $provides->{Simple}{version}, '1.23' ); -is( $provides->{Simple}{file}, 'lib/Simple.pm', - ' recording occurrence in corresponding file' ); -is( keys( %$provides ), 1 ); - $dist->remove_file( 'lib/Simple2.pm' ); $dist->remove_file( 'lib/Simple3.pm' ); @@ -550,14 +480,9 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ), - 'single file with single non-private package' ); -ok( ! exists( $provides->{'Simple::_private'} ), - " no private package 'Simple::_private'" ); -ok( ! exists( $provides->{'Simple::_private::too'} ), - " no private sub-package 'Simple::_private::too'" ); -is( keys( %$provides ), 1 ); +is_deeply($mb->find_dist_packages, + {'Simple' => { file => 'lib/Simple.pm', + version => '1.23' }}); ############################################################ @@ -568,8 +493,7 @@ $dist->change_file( 'lib/Simple.pm', '' ); $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -is( keys( %$provides ), 0 ); +is_deeply( $mb->find_dist_packages, {} ); # Simple.pm => =pod..=cut (no package declaration) $dist->change_file( 'lib/Simple.pm', <<'---' ); @@ -587,13 +511,12 @@ --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$provides = $mb->find_dist_packages; -is( keys( %$provides ), 0 ); +is_deeply($mb->find_dist_packages, {}); ############################################################ # cleanup -chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +chdir( $cwd ) or die "Can't chdir to '$cwd': $!"; $dist->remove; use File::Path; |
|
From: Ken W. <kwi...@us...> - 2005-07-16 03:11:02
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1247/lib/Module/Build Modified Files: Base.pm Log Message: Be more resilient on case-tolerant filesystems Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.459 retrieving revision 1.460 diff -u -d -r1.459 -r1.460 --- Base.pm 10 Jul 2005 12:25:34 -0000 1.459 +++ Base.pm 16 Jul 2005 03:10:53 -0000 1.460 @@ -1011,6 +1011,9 @@ my %q = map {$_, $self->$_()} qw(config_dir base_dir); $q{base_dir} = Win32::GetShortPathName($q{base_dir}) if $^O eq 'MSWin32'; + my $case_tolerant = 0+(File::Spec->can('case_tolerant') + && File::Spec->case_tolerant); + $q{base_dir} = uc $q{base_dir} if $case_tolerant; my @myINC = $self->_added_to_INC; for (@myINC, values %q) { @@ -1031,6 +1034,7 @@ BEGIN { \$^W = 1; # Use warnings my \$curdir = File::Spec->canonpath( Cwd::cwd() ); + \$curdir = uc \$curdir if $case_tolerant; my \$is_same_dir = \$^O eq 'MSWin32' ? (Win32::GetShortPathName(\$curdir) eq '$q{base_dir}') : (\$curdir eq '$q{base_dir}'); unless (\$is_same_dir) { |
|
From: Ken W. <kwi...@us...> - 2005-07-16 03:11:01
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1247 Modified Files: Changes Log Message: Be more resilient on case-tolerant filesystems Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.361 retrieving revision 1.362 diff -u -d -r1.361 -r1.362 --- Changes 15 Jul 2005 12:35:39 -0000 1.361 +++ Changes 16 Jul 2005 03:10:52 -0000 1.362 @@ -1,5 +1,13 @@ Revision history for Perl extension Module::Build. +0.27_03 + + - Fixed an issue on Win32 (and other case-tolerant + non-case-preserving systems, possibly like VMS?) in which the + current working directory would sometimes be reported with + different case, fooling us into thinking that we were in the wrong + directory. [David Golden] + 0.27_02 (Beta for 0.28) Fri Jul 15 07:34:58 CDT 2005 - Provided initial support for the --prefix installation parameter, |
|
From: Ken W. <kwi...@us...> - 2005-07-15 12:42:38
|
Update of /cvsroot/module-build/Module-Build/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19278/inc Modified Files: ModuleBuildBuilder.pm Log Message: Fix a typo Index: ModuleBuildBuilder.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/inc/ModuleBuildBuilder.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ModuleBuildBuilder.pm 13 Jul 2005 21:09:12 -0000 1.4 +++ ModuleBuildBuilder.pm 15 Jul 2005 12:42:23 -0000 1.5 @@ -34,6 +34,6 @@ sub do_replace { my ($self, $code, $file) = @_; - $self->run_perl_commane(['-pi.bak', '-e', $code, $file]); + $self->run_perl_command(['-pi.bak', '-e', $code, $file]); 1 while unlink "$file.bak"; } |
|
From: Ken W. <kwi...@us...> - 2005-07-15 12:39:07
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18548 Modified Files: MANIFEST Log Message: Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/MANIFEST,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- MANIFEST 28 Jun 2005 10:14:57 -0000 1.46 +++ MANIFEST 15 Jul 2005 12:38:56 -0000 1.47 @@ -43,6 +43,7 @@ t/lib/Test/More.pm t/lib/Test/Simple.pm t/manifypods.t +t/metadata.t t/moduleinfo.t t/notes.t t/parents.t |
|
From: Ken W. <kwi...@us...> - 2005-07-15 12:35:49
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18139 Modified Files: Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.360 retrieving revision 1.361 diff -u -d -r1.360 -r1.361 --- Changes 14 Jul 2005 03:03:55 -0000 1.360 +++ Changes 15 Jul 2005 12:35:39 -0000 1.361 @@ -1,6 +1,6 @@ Revision history for Perl extension Module::Build. -0.27_02 (Beta for 0.28) +0.27_02 (Beta for 0.28) Fri Jul 15 07:34:58 CDT 2005 - Provided initial support for the --prefix installation parameter, which acts like MakeMaker's PREFIX. It is still highly recommended @@ -16,7 +16,7 @@ - Added a 'pure_install' action, which for the time being is identical to the 'install' action. [Jos Boumans] - - Fixed a POD error in a L<http://...> tag. [Offer Kaye] + - Fixed a POD error in an L<http://...> tag. [Offer Kaye] - Note several options for automatically creating a new module dev tree. [Suggested by Eric Wilhelm] |
|
From: Ken W. <kwi...@us...> - 2005-07-14 03:04:05
|
Update of /cvsroot/module-build/Module-Build/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25391/scripts Modified Files: config_data Log Message: Fix some auto_features stuff in config_data Index: config_data =================================================================== RCS file: /cvsroot/module-build/Module-Build/scripts/config_data,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- config_data 10 Oct 2004 03:54:58 -0000 1.1 +++ config_data 14 Jul 2005 03:03:56 -0000 1.2 @@ -8,7 +8,7 @@ module => {type => '=s', desc => 'The name of the module to configure (required)'}, feature => {type => ':s', - desc => 'Print the value of a feature'}, + desc => 'Print the value of a feature or all features'}, config => {type => ':s', desc => 'Print the value of a config option'}, set_feature => {type => '=s%', @@ -40,9 +40,13 @@ if (length $opts{feature}) { print $cf->feature($opts{feature}); } else { + my %auto; + # note: need to support older ConfigData.pm's + @auto{$cf->auto_feature_names} = () if $cf->can("auto_feature_names"); + print " Features defined in $cf:\n"; foreach my $name (sort $cf->feature_names) { - print " $name => ", $cf->feature($name), "\n"; + print " $name => ", $cf->feature($name), (exists $auto{$name} ? " (dynamic)" : ""), "\n"; } } |
|
From: Ken W. <kwi...@us...> - 2005-07-14 03:04:05
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25391/lib/Module/Build Modified Files: Notes.pm Log Message: Fix some auto_features stuff in config_data Index: Notes.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Notes.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Notes.pm 7 Jun 2005 03:34:07 -0000 1.7 +++ Notes.pm 14 Jul 2005 03:03:56 -0000 1.8 @@ -105,8 +105,6 @@ sub write_config_data { my ($self, %args) = @_; - # XXX need to handle auto_features - my $fh = IO::File->new("> $args{file}") or die "Can't create '$args{file}': $!"; printf $fh <<'EOF', $args{config_module}; @@ -122,7 +120,13 @@ sub set_config { $config->{$_[1]} = $_[2] } sub set_feature { $features->{$_[1]} = 0+!!$_[2] } # Constrain to 1 or 0 -sub feature_names { keys %%$features } +sub auto_feature_names { grep !exists $features->{$_}, keys %%$auto_features } + +sub feature_names { + my @features = (keys %%$features, auto_feature_names()); + @features; +} + sub config_names { keys %%$config } sub write { @@ -141,7 +145,7 @@ local $Data::Dumper::Terse = 1; seek($fh, tell($fh), 0); - $fh->print( Data::Dumper::Dumper([$config, $features]) ); + $fh->print( Data::Dumper::Dumper([$config, $features, $auto_features]) ); truncate($fh, tell($fh)); $fh->close; @@ -241,6 +245,13 @@ Returns a list of all the names of features currently defined in C<$notes_name>, or in scalar context the number of features. +=item auto_feature_names() + +Returns a list of all the names of features whose availability is +dynamically determined, or in scalar context the number of such +features. Does not include such features that have later been set to +a fixed value. + =item write() Commits any changes from C<set_config()> and C<set_feature()> to disk. |
|
From: Ken W. <kwi...@us...> - 2005-07-14 03:04:05
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25391 Modified Files: Changes Log Message: Fix some auto_features stuff in config_data Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.359 retrieving revision 1.360 diff -u -d -r1.359 -r1.360 --- Changes 13 Jul 2005 21:37:03 -0000 1.359 +++ Changes 14 Jul 2005 03:03:55 -0000 1.360 @@ -74,6 +74,9 @@ Module::Build itself can now be run on those platforms. [Yitzchak Scott-Thoennes] + - Improved the handling of auto_features in the config_data access + script. [Yitzchak Scott-Thoennes] + 0.27_01 (Beta for 0.28) Fri Apr 15 21:12:57 CDT 2005 Backward-incompatible (but better) changes: |
|
From: Ken W. <kwi...@us...> - 2005-07-13 21:37:11
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv442 Modified Files: Changes Log Message: Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.358 retrieving revision 1.359 diff -u -d -r1.358 -r1.359 --- Changes 8 Jul 2005 01:39:46 -0000 1.358 +++ Changes 13 Jul 2005 21:37:03 -0000 1.359 @@ -68,6 +68,12 @@ Module::Build->new() in its Build.PL. See ticket #12318 in rt.cpan.org. [Reported by Jos Boumans] + - Apparently on Windows and cygwin it's not possible to use the "-pi" + switch to perl without a backup extension, so now we use ".bak" and + remove the backup file when we're done. Thus the "dist" action for + Module::Build itself can now be run on those platforms. [Yitzchak + Scott-Thoennes] + 0.27_01 (Beta for 0.28) Fri Apr 15 21:12:57 CDT 2005 Backward-incompatible (but better) changes: |
|
From: Ken W. <kwi...@us...> - 2005-07-13 21:09:21
|
Update of /cvsroot/module-build/Module-Build/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26136/inc Modified Files: ModuleBuildBuilder.pm Log Message: On windows & cygwin, -i must take an argument. Index: ModuleBuildBuilder.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/inc/ModuleBuildBuilder.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ModuleBuildBuilder.pm 18 Dec 2004 21:16:07 -0000 1.3 +++ ModuleBuildBuilder.pm 13 Jul 2005 21:09:12 -0000 1.4 @@ -19,17 +19,21 @@ # Replace "<autogenerated_accessors>" with some POD lists my @need_doc = sort grep !$subs{$_}, $self->valid_properties; - $self->run_perl_command(['-pi', - '-e', - qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e], - $authoring_pod]); + $self->do_replace(qq[s{<autogenerated_accessors>}{ join "\\n\\n", map "=item \$_()", qw(@need_doc) }e], + $authoring_pod); # Replace "<action_list>" with a list of actions my $action_text = $self->_action_listing(scalar $self->known_actions); - $self->run_perl_command(['-pi', '-e', qq[s{<action_list>}{$action_text}], $build_pm]); + $self->do_replace(qq[s{<action_list>}{$action_text}], $build_pm); # Finally, sneakily rewrite the Build.PL to use a vanilla # Module::Build object instead of a ModuleBuildBuilder. - $self->run_perl_command(['-pi', '-e', qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs], $build_pl]); - $self->run_perl_command(['-pi', '-e', qq[s{ModuleBuildBuilder}{Module::Build}gs], $build_pl]); + $self->do_replace(qq[BEGIN{\$/=undef} s{<remove_me>.*</remove_me>}{}gs], $build_pl); + $self->do_replace(qq[s{ModuleBuildBuilder}{Module::Build}gs], $build_pl); +} + +sub do_replace { + my ($self, $code, $file) = @_; + $self->run_perl_commane(['-pi.bak', '-e', $code, $file]); + 1 while unlink "$file.bak"; } |
|
From: Randy W. S. <si...@us...> - 2005-07-10 12:25:44
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1973/t Modified Files: metadata.t Log Message: Rewrite the cataloging of 'provided' packages to generate better error messages and cover more edge cases. Index: metadata.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- metadata.t 9 Jul 2005 12:26:56 -0000 1.2 +++ metadata.t 10 Jul 2005 12:25:35 -0000 1.3 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 50; +use Test::More tests => 102; use File::Spec (); @@ -35,315 +35,563 @@ my $mb = Module::Build->new_from_context; -############################################################ +############################## Single Module # File with corresponding package (w/ or w/o version) -# Module/Foo.pm => Module::Foo v1.23 +# Simple.pm => Simple v1.23 +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Simple; +$VERSION = '1.23'; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; my $provides = $mb->find_dist_packages; -is( $provides->{Simple}{version}, '0.01' ); +ok( exists( $provides->{Simple} ), 'single package' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', ' in corresponding file' ); +is( $provides->{Simple}{version}, '1.23', ' with version' ); +is( keys( %$provides ), 1 ); + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Simple; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +ok( exists( $provides->{Simple} ), 'single package' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', ' in corresponding file' ); +is( $provides->{Simple}{version}, undef, ' without version' ); +is( keys( %$provides ), 1 ); # File with no corresponding package (w/ or w/o version) -# Module/Foo.pm => Module::Baz v1.23 (No Module::Foo) +# Simple.pm => Foo::Bar v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo::Bar; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( ! exists( $provides->{Simple} ) ); -is( $provides->{'Foo::Bar'}{version}, '1.23' ); +ok( exists( $provides->{'Foo::Bar'} ), 'single package' ); +is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm', + ' in non-corresponding file' ); +is( $provides->{'Foo::Bar'}{version}, '1.23', ' with version' ); +ok( ! exists( $provides->{Simple} ), ' no corresponding package for file' ); +is( keys( %$provides ), 1 ); + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo::Bar; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +ok( exists( $provides->{'Foo::Bar'} ), 'single package' ); +is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm', + ' in non-corresponding file' ); +is( $provides->{'Foo::Bar'}{version}, undef, ' without version' ); +ok( ! exists( $provides->{Simple} ), ' no corresponding package for file' ); is( keys( %$provides ), 1 ); + # Single file with multiple differing packages (w/ or w/o version) -# Module/Foo.pm => Module::Foo -# Module/Foo.pm => Module::Bar +# Simple.pm => Simple +# Simple.pm => Foo::Bar $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; package Foo::Bar; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -is( $provides->{Simple}{version}, '1.23' ); +is( $provides->{Simple}{version}, '1.23', 'multiple packages with versions' ); is( $provides->{'Foo::Bar'}{version}, '1.23' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' with file corresponding to one package' ); +is( $provides->{'Foo::Bar'}{file}, 'lib/Simple.pm' ); is( keys( %$provides ), 2 ); # Single file with multiple differing packages, no corresponding package -# Module/Foo.pm => Module::Baz -# Module/Foo.pm => Module::Bar +# Simple.pm => Foo +# Simple.pm => Foo::Bar $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo; $VERSION = '1.23'; -1; package Foo::Bar; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( ! exists( $provides->{Simple} ) ); -is( $provides->{'Foo'}{version}, '1.23' ); +is( $provides->{Foo}{version}, '1.23', 'multiple packages with versions' ); is( $provides->{'Foo::Bar'}{version}, '1.23' ); +ok( ! exists( $provides->{Simple} ), + ' without package corresponding to file' ); is( keys( %$provides ), 2 ); # Single file with same package appearing multiple times, no version -# Module/Foo.pm => Module::Foo -# Module/Foo.pm => Module::Foo +# only record a single instance +# Simple.pm => Simple +# Simple.pm => Simple $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; -1; package Simple; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{'Simple'} ) ); -ok( ! exists( $provides->{'Simple'}{version} ) ); -is( keys( %$provides ), 1 ); +ok( exists( $provides->{Simple} ), + 'single file with corresponding package multiple times' ); +ok( ! exists( $provides->{Simple}{version} ), ' without version' ); +is( keys( %$provides ), 1, ' records only one occurrence' ); -# Single file with same package appearing multiple times, single version -# Module/Foo.pm => Module::Foo v1.23 -# Module/Foo.pm => Module::Foo + +# Single file with same package appearing multiple times, single +# version 1st package: +# Simple.pm => Simple v1.23 +# Simple.pm => Simple $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; package Simple; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); +ok( exists( $provides->{Simple} ), + 'single file with corresponding package multiple times' ); +is( $provides->{Simple}{version}, '1.23', + ' with version only in first occurrence' ); is( keys( %$provides ), 1 ); -# Single file with same package appearing multiple times, single version -# Module/Foo.pm => Module::Foo -# Module/Foo.pm => Module::Foo v1.23 +# Single file with same package appearing multiple times, single +# version 2nd package +# Simple.pm => Simple +# Simple.pm => Simple v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; -1; package Simple; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); +ok( exists( $provides->{Simple} ), + 'single file with corresponding package multiple times' ); +is( $provides->{Simple}{version}, '1.23', + ' with version only in second occurrence' ); is( keys( %$provides ), 1 ); # Single file with same package appearing multiple times, conflicting versions -# Module/Foo.pm => Module::Foo v1.23 -# Module/Foo.pm => Module::Foo v2.34 +# Simple.pm => Simple v1.23 +# Simple.pm => Simple v2.34 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; package Simple; $VERSION = '2.34'; -1; --- $dist->regen( clean => 1 ); my $err = ''; $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); -like( $err, qr/already declared/ ); +ok( exists( $provides->{Simple} ), + 'single file with corresponding package multiple times' ); +like( $err, qr/already declared/, ' with conflicting versions reported' ); +is( $provides->{Simple}{version}, '1.23', ' only first version is recorded' ); is( keys( %$provides ), 1 ); + # (Same as above three cases except with no corresponding package) -# Module/Foo.pm => Module::Baz -# Module/Foo.pm => Module::Baz +# Simple.pm => Foo v1.23 +# Simple.pm => Foo v2.34 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Foo; $VERSION = '1.23'; -1; package Foo; $VERSION = '2.34'; -1; --- $dist->regen( clean => 1 ); $err = stderr_of( sub { $mb = Module::Build->new_from_context } ); $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{'Foo'}{version} ) ); -is( $provides->{'Foo'}{version}, '1.23' ); -like( $err, qr/already declared/ ); +ok( ! exists( $provides->{Simple} ), + 'single file with non-corresponding package multiple times' ); +like( $err, qr/already declared/, ' with conflicting versions reported' ); +is( $provides->{Foo}{version}, '1.23', ' only first version is recorded' ); is( keys( %$provides ), 1 ); + +############################## Multiple Modules + # Multiple files with same package, no version -# Module/Foo.pm => Module::Foo -# Module/Bar.pm => Module::Foo +# Simple.pm => Simple +# Simple2.pm => Simple $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; -1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{'Simple'} ) ); -ok( ! exists( $provides->{'Simple'}{version} ) ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +ok( ! exists( $provides->{Simple}{version} ), ' without any versions' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' only recording occurrence in corresponding file' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); + # Multiple files with same package, single version in corresponding package -# Module/Foo.pm => Module::Foo v1.23 -# Module/Bar.pm => Module::Foo +# Simple.pm => Simple v1.23 +# Simple2.pm => Simple $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is( $provides->{Simple}{version}, '1.23', + ' with version in corresponding file' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' only recording occurrence with version' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); + # Multiple files with same package, # single version in non-corresponding package -# Module/Foo.pm => Module::Foo -# Module/Bar.pm => Module::Foo v1.23 +# Simple.pm => Simple +# Simple2.pm => Simple v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; -1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; -$err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( ! exists( $provides->{'Simple'}{version} ) ); -ok( ! defined( $provides->{'Simple'}{version} ) ); -like( $err, qr/conflicts/ ); +$provides = $mb->find_dist_packages; +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is( $provides->{Simple}{version}, '1.23', + ' with version in non-corresponding file' ); +is( $provides->{Simple}{file}, 'lib/Simple2.pm', + ' only recording occurrence with version' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, conflicting versions -# Module/Foo.pm => Module::Foo v1.23 -# Module/Bar.pm => Module::Foo v2.34 +# Simple.pm => Simple v1.23 +# Simple2.pm => Simple v2.34 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '2.34'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); -like( $err, qr/conflicts/ ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +like( $err, qr/Found conflicting versions for package/, + ' with conflicting versions reported' ); +is( $provides->{Simple}{version}, '1.23', + ' only recording occurrence with package in corresponding file' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); # Multiple files with same package, multiple agreeing versions -# Module/Foo.pm => Module::Foo v1.23 -# Module/Bar.pm => Module::Foo v1.23 +# Simple.pm => Simple v1.23 +# Simple2.pm => Simple v1.23 $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; --- $dist->add_file( 'lib/Simple2.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $err = stderr_of( sub { $provides = $mb->find_dist_packages } ); -ok( exists( $provides->{'Simple'}{version} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); -is( $err, '' ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +is( $provides->{Simple}{version}, '1.23', ' with same version' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' only recording occurrence with package in corresponding file' ); +is( $err, '', ' no conflicts reported' ); is( keys( %$provides ), 1 ); $dist->remove_file( 'lib/Simple2.pm' ); +############################################################ +# # (Same as above five cases except with non-corresponding package) -# Module/Foo.pm => Module::Baz -# Module/Bar.pm => Module::Baz +# -# What about private packages? -# Module/Foo.pm => Module::_Private +# Multiple files with same package, no version +# Simple.pm => Foo +# Simple2.pm => Foo + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Foo; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +ok( ! exists( $provides->{Foo}{version} ), ' without any versions' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); + + +# Multiple files with same package, version in first file +# Simple.pm => Foo v1.23 +# Simple2.pm => Foo + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Foo; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +is( $provides->{Foo}{version}, '1.23' ); +is( $provides->{Foo}{file}, 'lib/Simple.pm', + ' only recording occurrence with version' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); + + +# Multiple files with same package, version in second file +# Simple.pm => Foo +# Simple2.pm => Foo v1.23 + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Foo; +$VERSION = '1.23'; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +is( $provides->{Foo}{version}, '1.23' ); +is( $provides->{Foo}{file}, 'lib/Simple2.pm', + ' only recording occurrence with version' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); + + +# Multiple files with same package, conflicting versions +# Simple.pm => Foo v1.23 +# Simple2.pm => Foo v2.34 + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Foo; +$VERSION = '2.34'; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$err = stderr_of( sub { $provides = $mb->find_dist_packages } ); +ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +like( $err, qr/Found conflicting versions for package/, + ' with conflicting versions reported' ); +ok( exists( $provides->{Foo}{version} ), ' recording any version' ); +ok( exists( $provides->{Foo}{file} ), ' recording any file' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); + + +# Multiple files with same package, multiple agreeing versions +# Simple.pm => Foo v1.23 +# Simple2.pm => Foo v1.23 + +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Foo; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Foo; +$VERSION = '1.23'; +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$err = stderr_of( sub { $provides = $mb->find_dist_packages } ); +ok( exists( $provides->{Foo} ), 'multiple files with same package' ); +is( $provides->{Foo}{version}, '1.23', ' with same version' ); +is( $err, '', ' no conflicts reported' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); + +############################################################ +# Conflicts amoung primary & multiple alternatives + +# multiple files, conflicting version in corresponding file +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Simple; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Simple; +$VERSION = '2.34'; +--- +$dist->add_file( 'lib/Simple3.pm', <<'---' ); +package Simple; +$VERSION = '2.34'; +--- +$dist->regen( clean => 1 ); +$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { $provides = $mb->find_dist_packages } ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +like( $err, qr/Found conflicting versions for package/, + ' corresponding package conflicts with multiple alternatives' ); +is( $provides->{Simple}{version}, '1.23' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' recording occurrence in corresponding file' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); +$dist->remove_file( 'lib/Simple3.pm' ); + +# multiple files, conflicting version in non-corresponding file +$dist->change_file( 'lib/Simple.pm', <<'---' ); +package Simple; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple2.pm', <<'---' ); +package Simple; +$VERSION = '1.23'; +--- +$dist->add_file( 'lib/Simple3.pm', <<'---' ); +package Simple; +$VERSION = '2.34'; +--- +$dist->regen( clean => 1 ); +$err = stderr_of( sub { $mb = Module::Build->new_from_context } ); +$err = stderr_of( sub { $provides = $mb->find_dist_packages } ); +ok( exists( $provides->{Simple} ), 'multiple files with same package' ); +like( $err, qr/Found conflicting versions for package/, + ' only one alternative conflicts with corresponding package' ); +is( $provides->{Simple}{version}, '1.23' ); +is( $provides->{Simple}{file}, 'lib/Simple.pm', + ' recording occurrence in corresponding file' ); +is( keys( %$provides ), 1 ); + +$dist->remove_file( 'lib/Simple2.pm' ); +$dist->remove_file( 'lib/Simple3.pm' ); + + +############################################################ +# Don't record private packages (beginning with underscore) +# Simple.pm => Simple::_private +# Simple.pm => Simple::_private::too $dist->change_file( 'lib/Simple.pm', <<'---' ); package Simple; $VERSION = '1.23'; -1; package Simple::_private; $VERSION = '2.34'; -1; +package Simple::_private::too; +$VERSION = '3.45'; --- $dist->regen( clean => 1 ); $mb = Module::Build->new_from_context; $provides = $mb->find_dist_packages; -ok( exists( $provides->{Simple} ) ); -is( $provides->{'Simple'}{version}, '1.23' ); -ok( ! exists( $provides->{'Simple::_private'} ) ); +ok( exists( $provides->{Simple} ), + 'single file with single non-private package' ); +ok( ! exists( $provides->{'Simple::_private'} ), + " no private package 'Simple::_private'" ); +ok( ! exists( $provides->{'Simple::_private::too'} ), + " no private sub-package 'Simple::_private::too'" ); is( keys( %$provides ), 1 ); +############################################################ # Files with no packages? -# Module/Foo.pm => =pod..=cut (no package declaration) +# Simple.pm => <empty> + +$dist->change_file( 'lib/Simple.pm', '' ); +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +is( keys( %$provides ), 0 ); + +# Simple.pm => =pod..=cut (no package declaration) +$dist->change_file( 'lib/Simple.pm', <<'---' ); +=pod +=head1 NAME +Simple - Pure Documentation +=head1 DESCRIPTION + +Doesn't do anything. + +=cut +--- +$dist->regen( clean => 1 ); +$mb = Module::Build->new_from_context; +$provides = $mb->find_dist_packages; +is( keys( %$provides ), 0 ); + + +############################################################ # cleanup chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-07-10 12:25:44
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1973/lib/Module/Build Modified Files: Base.pm Log Message: Rewrite the cataloging of 'provided' packages to generate better error messages and cover more edge cases. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.458 retrieving revision 1.459 diff -u -d -r1.458 -r1.459 --- Base.pm 9 Jul 2005 12:18:08 -0000 1.458 +++ Base.pm 10 Jul 2005 12:25:34 -0000 1.459 @@ -2606,61 +2606,146 @@ my @pm_files = grep {exists $dist_files{$_}} keys %{ $self->find_pm_files }; + # First, we enumerate all packages & versions, + # seperating into primary & alternative candidates my( %prime, %alt ); foreach my $file (@pm_files) { - next if $file =~ m{^t/}; # Skip things in t/ - - my @path = split( /\//, $file ); - (my $prime_package = join( '::', @path[1..$#path])) =~ s/\.pm$//; + next if $dist_files{$file} =~ m{^t/}; # Skip things in t/ - my $localfile = File::Spec->catfile( @path ); + my @path = split( /\//, $dist_files{$file} ); + (my $prime_package = join( '::', @path[1..$#path] )) =~ s/\.pm$//; - my $pm_info = Module::Build::ModuleInfo->new_from_file( $localfile ); + my $pm_info = Module::Build::ModuleInfo->new_from_file( $file ); - foreach my $package ($pm_info->packages_inside($localfile)) { - next if $package eq 'main'; # main can appear numerous times, ignore - next if (split( /::/, $package ))[-1] =~ /^_/; # private pkg, ignore + foreach my $package ( $pm_info->packages_inside ) { + next if $package eq 'main'; # main can appear numerous times, ignore + next if grep /^_/, split( /::/, $package ); # private package, ignore my $version = $pm_info->version( $package ); + if ( $package eq $prime_package ) { - $prime{$package}{file} = $dist_files{$file}; - $prime{$package}{version} = $version if defined( $version ); + if ( exists( $prime{$package} ) ) { + # M::B::ModuleInfo will handle this conflict + die "Unexpected conflict in '$package'; multiple versions found.\n"; + } else { + $prime{$package}{file} = $dist_files{$file}; + $prime{$package}{version} = $version if defined( $version ); + } } else { - if ( exists( $alt{$package} ) && - exists( $alt{$package}{version} ) && - defined( $alt{$package}{version} ) ) { - # This should never happen because M::B::ModuleInfo catches it first - if ( $self->compare_versions( $version, '!=', - $alt{$package}{version} ) ) { - $self->log_warn( "$package ($alt{$package}{version}) conflicts " . - "with $package ($version)\n" ); - } - } else { - $alt{$package}{file} = $dist_files{$file}; - $alt{$package}{version} = $version if defined( $version ); - } + push( @{$alt{$package}}, { + file => $dist_files{$file}, + version => $version, + } ); } } } + # Then we iterate over all the packages found above, identifying conflicts + # and selecting the "best" candidate for recording the file & version + # for each package. foreach my $package ( keys( %alt ) ) { - if ( exists( $prime{$package} ) ) { - my $p_vers = exists( $prime{$package}{version} ) ? - $prime{$package}{version} : '<undef>'; - if ( exists( $alt{$package}{version} ) && - $alt{$package}{version} ne $p_vers ) { - $self->log_warn( "Version declaration for package '$package' in " . - "'$prime{$package}{file}' ($p_vers) conflicts with " . - "'$alt{$package}{file}' ($alt{$package}{version})\n" ); + my $result = $self->_resolve_module_versions( $alt{$package} ); + + if ( exists( $prime{$package} ) ) { # primary package selected + if ( $result->{err} ) { + # Use the selected primary package, but there are conflicting + # errors amoung multiple alternative packages that need to be + # reported + $self->log_warn( + "Found conflicting versions for package '$package'\n" . + " $prime{$package}{file} ($prime{$package}{version})\n" . + $result->{err} + ); + + } elsif ( defined( $result->{version} ) ) { + # There is a primary package selected, and exactly one + # alternative package + + if ( exists( $prime{$package}{version} ) && + defined( $prime{$package}{version} ) ) { + # Unless the version of the primary package agrees with the + # version of the alternative package, report a conflict + if ( $self->compare_versions( $prime{$package}{version}, '!=', + $result->{version} ) ) { + $self->log_warn( + "Found conflicting versions for package '$package'\n" . + " $prime{$package}{file} ($prime{$package}{version})\n" . + " $result->{file} ($result->{version})\n" + ); + } + + } else { + # The prime package selected has no version so, we choose to + # use any alternative package that does have a version + $prime{$package}{file} = $result->{file}; + $prime{$package}{version} = $result->{version}; + } + + } else { + # no alt package found with a version, but we have a prime + # package so we use it whether it has a version or not } - } else { - $prime{$package} = $alt{$package}; + + } else { # No primary package was selected, use the best alternative + + if ( $result->{err} ) { + $self->log_warn( + "Found conflicting versions for package '$package'\n" . + $result->{err} + ); + } + + # Despite possible conflicting versions, we choose to record + # something rather than nothing + $prime{$package}{file} = $result->{file}; + $prime{$package}{version} = $result->{version} + if defined( $result->{version} ); } } + return \%prime; } +# seperate out some of the conflict resolution logic from +# $self->find_dist_packages(), above, into a helper function. +# +sub _resolve_module_versions { + my $self = shift; + + my $packages = shift; + + my( $file, $version ); + my $err = ''; + foreach my $p ( @$packages ) { + if ( defined( $p->{version} ) ) { + if ( defined( $version ) ) { + if ( $self->compare_versions( $version, '!=', $p->{version} ) ) { + $err .= " $p->{file} ($p->{version})\n"; + } else { + # same version declared multiple times, ignore + } + } else { + $file = $p->{file}; + $version = $p->{version}; + } + } + $file ||= $p->{file} if defined( $p->{file} ); + } + + if ( $err ) { + $err = " $file ($version)\n" . $err; + } + + my %result = ( + file => $file, + version => $version, + err => $err + ); + + return \%result; +} + sub make_tarball { my ($self, $dir, $file) = @_; $file ||= $dir; |
|
From: Randy W. S. <si...@us...> - 2005-07-09 12:27:05
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17668/t Modified Files: metadata.t Log Message: Specify distribution version in the generated 'Build.PL' file for our test distributions so that our mucking around with versions in the module files don't generate errors. Index: metadata.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- metadata.t 1 Jul 2005 11:20:01 -0000 1.1 +++ metadata.t 9 Jul 2005 12:26:56 -0000 1.2 @@ -17,6 +17,16 @@ use DistGen; my $dist = DistGen->new( dir => $tmp ); +$dist->change_file( 'Build.PL', <<"---" ); +use Module::Build; +my \$builder = Module::Build->new( + module_name => '@{[$dist->name]}', + dist_version => '3.14159265', + license => 'perl', +); + +\$builder->create_build_script(); +--- $dist->regen; chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; |