ppd.html
来自「perl教程」· HTML 代码 · 共 435 行 · 第 1/2 页
HTML
435 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../../displayToc.js"></script>
<script language="JavaScript" src="../../../tocParas.js"></script>
<script language="JavaScript" src="../../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../../scineplex.css">
<title>ActivePerl::PPM::PPD - Parser for PPD files</title>
<link rel="stylesheet" href="../../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',3);</script>
<h1><a>ActivePerl::PPM::PPD - Parser for PPD files</a></h1>
<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="#ppd_xml_format">PPD XML FORMAT</a></li>
<ul>
<li><a href="#changes_since_ppm3">Changes since PPM3</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>ActivePerl::PPM::PPD - Parser for PPD files</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
<span class="keyword">my</span> <span class="variable">$ppd</span> <span class="operator">=</span> <span class="variable">ActivePerl::PPM::Package</span><span class="operator">-></span><span class="variable">new_ppd</span><span class="operator">(</span><span class="string">'<SOFTPKG NAME="Foo">...</SOFTPKG>'</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module adds the <a href="#item_new_ppd"><code>new_ppd</code></a> constructor to the
<code>ActivePerl::PPM::Package</code> class. This constructor parses PPD
files and allow package objects to be initialized from these
files. PPD is an XML based format that is used to describe PPM
packages.</p>
<p>The following methods are added:</p>
<dl>
<dt><strong><a name="item_new_ppd">$ppd = ActivePerl::PPM::Package->new_ppd( $ppd_document, %opt )</a></strong>
<dt><strong>$ppd = ActivePerl::PPM::Package->new_ppd( $parsed_ppd_hashref, %opt )</strong>
<dd>
<p>The constructor take a literal document as argument and will return
and object representing the PPD. The method returns <a href="../../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a> if
$ppd_document does not contain the expected XML.</p>
</dd>
<dd>
<p>The following options are supported:</p>
</dd>
<dl>
<dt><strong><a name="item_arch__3d_3e__24archname">arch => $archname</a></strong>
<dd>
<p>The $archname should be specified to select attributes for a specific
architecture where the PPD describes multiple implementations. The
value <code>noarch</code> is the default and will only select
implementation sections without any ARCHITECTURE restriction.</p>
</dd>
</li>
<dt><strong><a name="item_base__3d_3e__24base_uri">base => $base_uri</a></strong>
<dd>
<p>All URIs in the PPD will be made absolute with $base_uri as base.</p>
</dd>
</li>
<dt><strong><a name="item_rel_base__3d_3e__24base_uri">rel_base => $base_uri</a></strong>
<dd>
<p>All URIs in the PPD will be made relative if they can be resolved from
$base_uri. Only safe to use together with <code>base</code> which is applied
first. If both <code>base</code> and <code>rel_base</code> are the same, they cancel
each other out and the effect is the same as if none of them where
specified.</p>
</dd>
</li>
</dl>
</dl>
<p>
</p>
<hr />
<h1><a name="ppd_xml_format">PPD XML FORMAT</a></h1>
<p>The PPM PPD is an XML based format used to describe PPM packages.
The format is based on the now defunct OSD specification
(<a href="http://www.w3.org/TR/NOTE-OSD">http://www.w3.org/TR/NOTE-OSD</a>). This shows an example of a
minimal PPD document:</p>
<pre>
<SOFTPKG NAME="Acme-Buffy" VERSION="1.3" DATE="2002-03-27">
<AUTHOR>Leon Brocard (leon@astray.com)</AUTHOR>
<ABSTRACT>
An encoding scheme for Buffy the Vampire Slayer fans
</ABSTRACT>
<PROVIDE NAME="Acme::Buffy" VERSION="1.3"/>
<IMPLEMENTATION>
<CODEBASE HREF="i686-linux-thread-multi-5.8/Acme-Buffy.tar.gz"/>
<ARCHITECTURE NAME="i686-linux-thread-multi-5.8"/>
</IMPLEMENTATION>
</SOFTPKG></pre>
<p>The following elements are used:</p>
<dl>
<dt><strong><a name="item__3cabstract_3e_2e_2e_2e_3c_2fabstract_3e"><ABSTRACT>...</ABSTRACT></a></strong>
<dd>
<p>Content is a short statement describing the purpose of this
package. No attributes. Parent must be a SOFTPKG element.</p>
</dd>
</li>
<dt><strong><a name="item__3carchitecture_name_3d_22_2e_2e_2e_22_2f_3e"><ARCHITECTURE NAME="..."/></a></strong>
<dd>
<p>The required attribute NAME should match
<code>$Config{archname}-$major_vers</code> for the perl this package was
compiled for. If this element is missing, it's the same as
specifying <ARCHITECTURE NAME="noarch"/>. No content. Parent must be
either SOFTPKG or IMPLEMENTATION.</p>
</dd>
<dd>
<p>Packages or implementations marked with "noarch" are assumed to
installable on any architecture.</p>
</dd>
</li>
<dt><strong><a name="item__3cauthor_3e_2e_2e_2e_3c_2fauthor_3e"><AUTHOR>...</AUTHOR></a></strong>
<dd>
<p>Content is the package author's name (with email address). No
attributes. Parent must be a SOFTPKG element.</p>
</dd>
</li>
<dt><strong><a name="item__3ccodebase_href_3d_22_2e_2e_2e_22_2f_3e"><CODEBASE HREF="..."/></a></strong>
<dd>
<p>The required HREF attribute provides a URI where the binary package
(the tared up <code>blib</code> tree) of the package can be obtained. The URI
can be relative and is then resolved based on the URI of the PPD
document. No content. Parent must be SOFTPKG or
IMPLEMENTATION.</p>
</dd>
</li>
<dt><strong><a name="item__3cdependency_name_3d_22_2e_2e_2e_22_version_3d_22"><DEPENDENCY NAME="..." VERSION="..."/></a></strong>
<dd>
<p>Deprecated. Required attribute is NAME. Optional attribute is
VERSION. No content. Element might be repeated any number of
times. Parent must be an IMPLEMENTATION element.</p>
</dd>
<dd>
<p>This element expresses a dependency on another package with the given
name and with the given version number or better. The other package
must be installed for this package to work.</p>
</dd>
<dd>
<p>This element is still recommended for PPDs that are to be used by
both PPM4 and PPM3 clients, as the PPM3 clients will ignore any
REQUIRE elements provided. PPM4 clients regard DEPENDENCY the same as
REQUIRE, but will simply ignore the VERSION provided.</p>
</dd>
</li>
<dt><strong><a name="item__3cimplementation_3e_2e_2e_2e_3c_2fimplementation_"><IMPLEMENTATION>...</IMPLEMENTATION></a></strong>
<dd>
<p>No attributes. Optional container for ARCHITECTURE, DEPENDENCY,
INSTALL, PROVIDE, REQUIRE, UNINSTALL elements. Parent must be
SOFTPKG. There can be multiple instances of IMPLEMENTATION but they
should each contain an ARCHITECTURE element that differ from each
other.</p>
</dd>
</li>
<dt><strong><a name="item__3cinstall_exec_3d_22_2e_2e_2e_22_href_3d_22_2e_2e"><INSTALL EXEC="..." HREF="..."/></a></strong>
<dt><strong><a name="item__3cinstall_exec_3d_22_2e_2e_2e_22_3e_2e_2e_2e_3c_2"><INSTALL EXEC="...">...</INSTALL></a></strong>
<dd>
<p>Optional attributes are EXEC and HREF. Textual content can be included.
Provides a script or commands to run after the <code>blib</code> files of the package
have been installed, a so called post-install script. The script to
run can either be provided inline or externally via HREF. If both
are provided then only the HREF is used. Parent must be either SOFTPKG or
IMPLEMENTATION.</p>
</dd>
<dd>
<p>If EXEC is provided, it gives the name of the interpreter to run the
script. For historical reasons, if the script is not obtained via HREF
then any occurences of double semicolon ";;" is replaced by newline
before it is saved in a temporary file and passed as the first argument to
the EXEC interpreter. The special value "PPM_PERL" ensures that the
script runs with the same perl interpreter that runs PPM. The special
value "SELF" make the script run as a self contained executable.</p>
</dd>
<dd>
<p>If EXEC is not provided, the commands of the script are passed to
the system command interpreter (via <a href="../../../lib/Pod/perlfunc.html#item_system"><code>system(3)</code></a>) one by one. If the
script was obtained via HREF, each line is considered a command.
If the script was obtained from the content, then a double semicolon
";;" is used to separate commands.</p>
</dd>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?