/usr/share/doc/lintian/api.html/Lintian/DepMap.html is in lintian 2.5.43.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Lintian::DepMap</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" title="blkbluw" type="text/css" href="../_blkbluw.css" media="all" >
<link rel="alternate stylesheet" title="blkmagw" type="text/css" href="../_blkmagw.css" media="all" >
<link rel="alternate stylesheet" title="blkcynw" type="text/css" href="../_blkcynw.css" media="all" >
<link rel="alternate stylesheet" title="whtprpk" type="text/css" href="../_whtprpk.css" media="all" >
<link rel="alternate stylesheet" title="whtnavk" type="text/css" href="../_whtnavk.css" media="all" >
<link rel="alternate stylesheet" title="grygrnk" type="text/css" href="../_grygrnk.css" media="all" >
<link rel="alternate stylesheet" title="whtgrng" type="text/css" href="../_whtgrng.css" media="all" >
<link rel="alternate stylesheet" title="blkgrng" type="text/css" href="../_blkgrng.css" media="all" >
<link rel="alternate stylesheet" title="grygrnw" type="text/css" href="../_grygrnw.css" media="all" >
<link rel="alternate stylesheet" title="blkbluw" type="text/css" href="../_blkbluw.css" media="all" >
<link rel="alternate stylesheet" title="whtpurk" type="text/css" href="../_whtpurk.css" media="all" >
<link rel="alternate stylesheet" title="whtgrng" type="text/css" href="../_whtgrng.css" media="all" >
<link rel="alternate stylesheet" title="grygrnw" type="text/css" href="../_grygrnw.css" media="all" >
<script type="text/javascript" src="../_podly.js"></script>
</head>
<body class='pod'>
<!-- start doc -->
<p class="backlinktop"><b><a name="___top" href="../index.html" accesskey="1" title="All Documents"><<</a></b></p>
<div class='indexgroup'>
<ul class='indexList indexList1'>
<li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
<li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
<li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
<li class='indexItem indexItem1'><a href='#AUTHOR'>AUTHOR</a>
</ul>
</div>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>
<p>Lintian::DepMap - Dependencies map/tree creator</p>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="SYNOPSIS"
>SYNOPSIS</a></h1>
<pre> use Lintian::DepMap;
my $map = Lintian::DepMap->new();
# know about A:
$map->add('A');
# B depends on A:
$map->add('B', 'A');
# prints 'A':
print $map->selectable();
# indicate we are working on 'A' (optional):
$map->select('A');
# do 'A' ... work work work
# we are done with A:
$map->satisfy('A');
# prints 'B':
print $map->selectable();</pre>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>
<p>Lintian::DepMap is a simple dependencies map/tree creator and "resolver". It works by creating a tree based on the indicated dependencies and destroying it to resolve it.</p>
<p>Note: in the below documentation a <code>node</code> means a node name; no internal reference is ever returned and therefore never accepted as a parameter.</p>
<dl>
<dt><a name="new()"
>new()</a></dt>
<dd>
<p>Creates a new Lintian::DepMap object and returns a reference to it.</p>
<dt><a name="initialise()"
>initialise()</a></dt>
<dd>
<p>Ensure, by reconstructing if necessary, the map's status is the initial. That is, partially or fully resolved maps can be restored to its original state by calling this method.</p>
<p>This can be useful when the same map will be used multiple times.</p>
<p>E.g.</p>
<pre> $map->add('A');
$map->satisfy('A');
# prints nothing
print $map->selectable();
$map->initialise();
print $map->selectable();</pre>
<dt><a name="add(node[,_dependency[,_dependency[,_...]]])"
>add(node[, dependency[, dependency[, ...]]])</a></dt>
<dd>
<p>Adds the given <code>node</code> to the map marking any second or more parameter as its dependencies. E.g.</p>
<pre> # A has no dependency:
$map->add('A');
# B depends on A:
$map->add('B', 'A');</pre>
<dt><a name="addp(node[,_prefix,_dependency[,_dependency[,_...]]])"
>addp(node[, prefix, dependency[, dependency[, ...]]])</a></dt>
<dd>
<p>Adds the given <code>node</code> to the map marking any third or more parameters, after prefixing them with <code>prefix</code>, as its dependencies. E.g.</p>
<pre> # pA and pB have no dependency:
$map->add('pA');
$map->add('pA');
# C depends on pA and pB:
$map->addp('C', 'p', 'A', 'B');</pre>
<dt><a name="satisfy(node)"
>satisfy(node)</a></dt>
<dd>
<p>Indicates that the given <code>node</code> has been satisfied/done.</p>
<p>The given <code>node</code> is no longer marked as being selected, if it was; all of its branches that have no other parent are now selectable() and all the references to <code>node</code> are deleted except the one from the known() list.</p>
<p>E.g.</p>
<pre> # A has no dependencies:
$map->add('A');
# B depends on A:
$map->add('B', 'A');
# we work on A, and we are done:
$map->satisfy('A');
# B is now available:
$map->selectable('B');</pre>
<p><b>Note</b>: shall the requested node not exist this method die()s.</p>
<dt><a name="done(node)"
>done(node)</a></dt>
<dd>
<p>Returns whether the given <code>node</code> has been satisfied/done.</p>
<p>E.g.</p>
<pre> # A has no dependencies:
$map->add('A');
# we work on A, and we are done:
$map->satisfy('A');
print "A is done!"
if ($map->done('A'));</pre>
<dt><a name="unlink(node)"
>unlink(node)</a></dt>
<dd>
<p>Removes all references to the given <code>node</code> except for the entry in the known() table.</p>
<p><b>IMPORTANT</b>: since all references are deleted it is possible that a node that depended on <code>node</code> may become available even when it was not expected to.</p>
<p><b>IMPORTANT</b>: this operation can <b>not</b> be reversed by the means of initialise().</p>
<p>E.g.</p>
<pre> $map->add('A');
# Prints A
print $map->selectable();
# we later notice we don't want A
$map->unlink('A');
# Prints nothing
print $map->selectable();</pre>
<p><b>Note</b>: shall the requested node not exist this method die()s.</p>
<dt><a name="select(node)"
>select(node)</a></dt>
<dd>
<p>Marks the given <code>node</code> as selected to indicate that whatever it represents is being worked on. Note: this operation is not atomic.</p>
<p>E.g.</p>
<pre> $map->add('A');
$map->add('B', 'A');
while($map->pending()) {
for my $node ($map->selectable()) {
$map->select($node);
# work work work
$map->satisfy($node);
}
}</pre>
<dt><a name="selectable([node])"
>selectable([node])</a></dt>
<dd>
<p>If a <code>node</code> is specified returns TRUE if it can be select()ed.</p>
<p><b>Note</b>: already select()ed nodes can not be re-selected, i.e. if the given <code>node</code> has already been selected this function will return FALSE; or any selected item will be omitted from the returned array, in case no <code>node</code> is specified.</p>
<dt><a name="selected([node])"
>selected([node])</a></dt>
<dd>
<p>If a <code>node</code> is specified returns TRUE if it is has been selected, FALSE otherwise.</p>
<p>If no <code>node</code> is specified it returns an array with the name of all the nodes that have been select()ed but not yet satisfied.</p>
<p>E.g.</p>
<pre> # We are going to work on A
$map->select('A');
# Returns true
$map->selected('A');
# Prints A
print $map->selected();</pre>
<dt><a name="selectAll()"
>selectAll()</a></dt>
<dd>
<p>select()s all the selectable() nodes.</p>
<dt><a name="parents(node)"
>parents(node)</a></dt>
<dd>
<p>Return an array with the name of the parent nodes for the given <code>node</code>.</p>
<p>E.g.</p>
<pre> $map->add('A');
$map->add('B', 'A');
# Prints 'A'
print $map->parents('B');</pre>
<p><b>Note</b>: shall the requested node not exist this method die()s.</p>
<dt><a name="pending()"
>pending()</a></dt>
<dd>
<p>Return the number of nodes that can or have already been selected. E.g.</p>
<pre> $map->add('B', 'A');
# prints 1:
print $map->pending();
$map->select('A');
# prints 1:
print $map->pending();
$map->satisfy('A');
# prints 1 ('B' is now available):
print $map->pending();</pre>
<dt><a name="known()"
>known()</a></dt>
<dd>
<p>Return an array containing the names of nodes that were added. E.g.</p>
<pre> $map->add('B', 'A');
# prints 'B':
print $map->known();
$map->add('A');
# prints 'A' and 'B':
print $map->known();</pre>
<dt><a name="known(NODE)"
>known(NODE)</a></dt>
<dd>
<p>Returns a truth value if NODE is known or <code>undef</code> otherwise.</p>
<dt><a name="missing()"
>missing()</a></dt>
<dd>
<p>Return an array containing the names of nodes that were not added but that another node depended on it. E.g.</p>
<pre> $map->add('B', 'A');
# prints 'A':
print $map->missing();
$map->add('A');
# prints nothing:
print $map->missing();
# this also works; A depends on 'Z':
$map->add('A', 'Z');
# but now this prints 'Z':
print $map->missing();</pre>
<dt><a name="circular(['deep'])"
>circular(['deep'])</a></dt>
<dd>
<p>Returns an array of nodes that have a circular dependency.</p>
<p>E.g.</p>
<pre> $map->add('A', 'B');
$map->add('B', 'A');
# Prints A and B
print $map->circular();</pre>
<p><b>Note</b>: since recursive/deep circular dependencies detection is a bit more resource expensive it is not the default.</p>
<pre> $map->add('A', 'B');
$map->add('B', 'C');
$map->add('C', 'A');
# No deep/recursive scanning is performed, prints nothing
print $map->circular();
# deep scan, prints 'A, B, C'
print $map->circular('deep');</pre>
</dd>
</dl>
<h1><a class='u' href='#___top' title='click to go to top of document'
name="AUTHOR"
>AUTHOR</a></h1>
<p>Originally written by Raphael Geissert <atomo64@gmail.com> for Lintian.</p>
<p class="backlinkbottom"><b><a name="___bottom" href="../index.html" title="All Documents"><<</a></b></p>
<!-- end doc -->
</body></html>
|