/usr/share/doc/aptitude/html/en/ch02s05s01.html is in aptitude-doc-en 0.8.10-6ubuntu1.
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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | <?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Customizing the package list</title><link rel="stylesheet" type="text/css" href="aptitude.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="home" href="index.html" title="aptitude user's manual" /><link rel="up" href="ch02s05.html" title="Customizing aptitude" /><link rel="prev" href="ch02s05.html" title="Customizing aptitude" /><link rel="next" href="ch02s05s02.html" title="Customizing keybindings" /><link rel="preface" href="pr01.html" title="Introduction" /><link rel="chapter" href="ch01.html" title="Chapter 1. Getting started" /><link rel="chapter" href="ch02.html" title="Chapter 2. aptitude reference guide" /><link rel="chapter" href="ch03.html" title="Chapter 3. aptitude frequently asked questions" /><link rel="chapter" href="ch04.html" title="Chapter 4. Credits" /><link rel="reference" href="rn01.html" title="Command-line reference" /><link rel="refentry" href="rn01re01.html" title="aptitude" /><link rel="refentry" href="rn01re02.html" title="aptitude-create-state-bundle" /><link rel="refentry" href="rn01re03.html" title="aptitude-run-state-bundle" /><link rel="subsection" href="ch02s05s01.html#secDisplayFormat" title="Customizing how packages are displayed" /><link rel="subsection" href="ch02s05s01.html#secGroupingPolicy" title="Customizing the package hierarchy" /><link rel="subsection" href="ch02s05s01.html#secSortingPolicy" title="Customizing how packages are sorted" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Customizing the package list</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html"><img src="images/prev.gif" alt="Prev" /></a> </td><th width="60%" align="center">Customizing <span class="command"><strong>aptitude</strong></span></th><td width="20%" align="right"> <a accesskey="n" href="ch02s05s02.html"><img src="images/next.gif" alt="Next" /></a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm4308"></a>Customizing the package list</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ch02s05s01.html#secDisplayFormat">Customizing how packages are displayed</a></span></dt><dt><span class="section"><a href="ch02s05s01.html#secGroupingPolicy">Customizing the package hierarchy</a></span></dt><dt><span class="section"><a href="ch02s05s01.html#secSortingPolicy">Customizing how packages are sorted</a></span></dt></dl></div><p>
The package list can be heavily customized: how packages are
displayed, how the package hierarchy is formed, how packages
are sorted, and even how the display is organized are all
open to change.
</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="secDisplayFormat"></a>Customizing how packages are displayed</h4></div></div></div><p>
This section describes how to configure the contents and
format of the package list, status line, and header line,
as well as the output of <code class="literal"><a class="link" href="rn01re01.html#cmdlineSearch">aptitude search</a></code>.
</p><p>
The format of each of these locations is defined by a
<span class="quote">“<span class="quote">format string</span>”</span>. A format string is a string of text
containing <code class="literal">%</code>-escapes such as
<code class="literal">%p</code>, <code class="literal">%S</code>, and so on.
The resulting output is created by taking the text and
replacing the <code class="literal">%</code>-escapes according to
their meanings (given below).
</p><p>
A <code class="literal">%</code>-escape can either have a fixed
size, in which case it is always replaced by the same
amount of text (with extra space characters added to fill
it out as necessary), or it can be <span class="quote">“<span class="quote">expandable</span>”</span>, meaning
that it takes up the space that is not claimed by
fixed-size columns. If there are several expandable
columns, the extra space is divided evenly between them.
</p><p>
All <code class="literal">%</code>-escapes come with a default size
and/or expandability. The size of a
<code class="literal">%</code>-escape can be changed by writing it
between the <code class="literal">%</code> and the character
identifying the escape; for instance,
<code class="literal">%20V</code> generates the <a class="link" href="ch02s05s01.html#formatCandVer">candidate version</a> of the
package, 20 characters wide. Placing a question mark
(<code class="literal">?</code>) between the <code class="literal">%</code>
and the character identifying the escape causes the
column's <span class="quote">“<span class="quote">basic</span>”</span> width to vary depending on
its content. Note that the resulting columns might not
line up vertically!
</p><p>
If you want a particular <code class="literal">%</code>-escape to be
expandable, even though it normally has a fixed width,
place a pound sign (ie,
<span class="quote">“<span class="quote"><code class="literal">#</code></span>”</span>) immediately after it.
For instance, to display the candidate version of a
package, no matter how long it is, use the format string
<code class="literal">%V#</code>. You can also place
<code class="literal">#</code> after something that is not a
<code class="literal">%</code>-escape; <span class="command"><strong>aptitude</strong></span> will
<span class="quote">“<span class="quote">expand</span>”</span> the text preceding the
<code class="literal">#</code> by inserting extra spaces after it.
</p><p>
In summary, the syntax of a <code class="literal">%</code>-escape is:
</p><pre class="synopsis"><code class="literal">%</code>[<span class="optional"><em class="replaceable"><code>width</code></em></span>][<span class="optional"><code class="literal">?</code></span>]<em class="replaceable"><code>code</code></em>[<span class="optional"><code class="literal">#</code></span>]</pre><p>
The configuration variables <code class="literal"><a class="link" href="ch02s05s05.html#configPackage-Display-Format">Aptitude::UI::Package-Display-Format</a></code>,
<code class="literal"><a class="link" href="ch02s05s05.html#configPackage-Header-Format">Aptitude::UI::Package-Header-Format</a></code>,
and <code class="literal"><a class="link" href="ch02s05s05.html#configPackage-Status-Format">Aptitude::UI::Package-Status-Format</a></code>
define the default formats the package list, the header at the top
of the package list, and the status line below the package list
respectively. To change how the results of an <code class="literal"><a class="link" href="rn01re01.html#cmdlineSearch">aptitude search</a></code> command are
displayed, use the <code class="literal"><a class="link" href="rn01re01.html#cmdlineOptionFormat">-F</a></code> option.
</p><p>
The following <code class="literal">%</code>-escapes are available
in format strings:
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>
Some of the descriptions below refer to <span class="quote">“<span class="quote">the package</span>”</span>.
In the GUI, this is either the package being displayed
or the currently selected package; in the command-line
search, this is the package being displayed.
</p></td></tr></table></div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Escape</th><th>Name</th><th>Default size</th><th>Expandable</th><th>Description</th></tr></thead><tbody><tr class="oddrow"><td class="seg"><code class="literal">%%</code></td><td class="seg">Literal <code class="literal">%</code></td><td class="seg">1</td><td class="seg">No</td><td class="seg">
This is not really an escape; it simply inserts a
percent sign into the output at the point at which it
occurs.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%#<em class="replaceable"><code>number</code></em></code></td><td class="seg">Parameter Replacement</td><td class="seg">Variable</td><td class="seg">No</td><td class="seg">
In some circumstances, a display format string will
have <span class="quote">“<span class="quote">parameters</span>”</span>: for instance, in the
command-line <code class="literal">search</code>, the groups
matched by the search are used as parameters when
displaying the result. This format code will be
replaced by the parameter indicated by
<em class="replaceable"><code>number</code></em>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%a</code></td><td class="seg">Action Flag</td><td class="seg">1</td><td class="seg">No</td><td class="seg">
A single-character flag summarizing any action to be
performed on the package, as described in
<a class="xref" href="ch02s02s02.html#figureActionFlag" title="Figure 2.10. Values of the “action” flag">Figure 2.10, “Values of the <span class="quote">“<span class="quote">action</span>”</span> flag”</a>.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%A</code></td><td class="seg">Action</td><td class="seg">10</td><td class="seg">No</td><td class="seg">
A somewhat more verbose description of the action to
be performed on the package.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%B</code></td><td class="seg">Broken Count</td><td class="seg">12</td><td class="seg">No</td><td class="seg">
If there are no broken packages, produces nothing.
Otherwise, produces a string such as
<span class="quote">“<span class="quote"><code class="computeroutput">Broken: 10</code></span>”</span>
describing the number of broken packages.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%c</code></td><td class="seg">Current State Flag</td><td class="seg">1</td><td class="seg">No</td><td class="seg">
A single-character flag summarizing the current state
of the package, as described in <a class="xref" href="ch02s02s02.html#figureCurrentFlag" title="Figure 2.9. Values of the “current state” flag">Figure 2.9, “Values of the <span class="quote">“<span class="quote">current state</span>”</span> flag”</a>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%C</code></td><td class="seg">Current State</td><td class="seg">11</td><td class="seg">No</td><td class="seg">
A more verbose description of the current state of the
package.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%d</code></td><td class="seg">Description</td><td class="seg">40</td><td class="seg">Yes</td><td class="seg">
The package's short description.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%D</code></td><td class="seg">Package Size</td><td class="seg">8</td><td class="seg">No</td><td class="seg">
The size of the package file containing the package.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%E</code></td><td class="seg">Architecture</td><td class="seg">10</td><td class="seg">No</td><td class="seg">
Outputs the string of the architecture, for example
<span class="quote">“<span class="quote"><code class="computeroutput">amd64</code></span>”</span>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%e</code></td><td class="seg">Source</td><td class="seg">30</td><td class="seg">No</td><td class="seg">
Outputs the source package, for example
<span class="quote">“<span class="quote"><code class="computeroutput">aptitude</code></span>”</span> for
<span class="quote">“<span class="quote"><code class="computeroutput">aptitude-doc-en</code></span>”</span>.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%H</code></td><td class="seg">Hostname</td><td class="seg">15</td><td class="seg">No</td><td class="seg">
The name of the computer on which <span class="command"><strong>aptitude</strong></span> is running.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%i</code></td><td class="seg">Pin priority</td><td class="seg">4</td><td class="seg">No</td><td class="seg">
Displays the highest priority assigned to a package
version; for packages, displays the priority of the
version which will be forced to be installed (if any).
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%I</code></td><td class="seg">Installed Size</td><td class="seg">8</td><td class="seg">No</td><td class="seg">
The (estimated) amount of space the package takes up on disk.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%m</code></td><td class="seg">Maintainer</td><td class="seg">30</td><td class="seg">Yes</td><td class="seg">
The maintainer of the package.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%M</code></td><td class="seg">Automatic Flag</td><td class="seg">1</td><td class="seg">No</td><td class="seg">
If the package is automatically installed, outputs
<span class="quote">“<span class="quote"><code class="computeroutput">A</code></span>”</span>; otherwise,
outputs nothing.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%n</code></td><td class="seg">Program Version</td><td class="seg">The length of <span class="quote">“<span class="quote">0.8.10</span>”</span>.</td><td class="seg">No</td><td class="seg">
Outputs the version of <span class="command"><strong>aptitude</strong></span> that is running,
currently
<span class="quote">“<span class="quote"><code class="computeroutput">0.8.10</code></span>”</span>.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%N</code></td><td class="seg">Program Name</td><td class="seg">The length of the name.</td><td class="seg">No</td><td class="seg">
Outputs the name of the program; usually
<span class="quote">“<span class="quote"><code class="computeroutput">aptitude</code></span>”</span>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%o</code></td><td class="seg">Download Size</td><td class="seg">17</td><td class="seg">No</td><td class="seg">
If no packages are going to be installed, outputs
nothing. Otherwise, outputs a string describing the
total size of all the package files which will be
installed (an estimate of how much needs to be
downloaded); for instance, <span class="quote">“<span class="quote"><code class="computeroutput">DL size:
1000B</code></span>”</span>.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%O</code></td><td class="seg">Origin</td><td class="seg">30</td><td class="seg">No</td><td class="seg">
Outputs a string of the origin of the package, for example
<span class="quote">“<span class="quote"><code class="computeroutput">Debian:unstable
[amd64]</code></span>”</span>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%p</code></td><td class="seg">Package Name</td><td class="seg">30</td><td class="seg">Yes</td><td class="seg">
Outputs the name of the package. When a package is
displayed in a tree context, the name of the package
will be indented, if possible, according to its depth
in the tree.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%P</code></td><td class="seg">Priority</td><td class="seg">9</td><td class="seg">No</td><td class="seg">
Outputs the priority of the package.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%r</code></td><td class="seg">Reverse Depends Count</td><td class="seg">2</td><td class="seg">No</td><td class="seg">
Outputs the approximate number of installed packages
which depend upon the package.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%R</code></td><td class="seg">Abbreviated Priority</td><td class="seg">3</td><td class="seg">No</td><td class="seg">
Outputs an abbreviated description of the package's
priority: for instance,
<span class="quote">“<span class="quote"><code class="computeroutput">Important</code></span>”</span> becomes
<span class="quote">“<span class="quote"><code class="computeroutput">Imp</code></span>”</span>.
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%s</code></td><td class="seg">Section</td><td class="seg">10</td><td class="seg">No</td><td class="seg">
Outputs the section of the package.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%S</code></td><td class="seg">Trust Status</td><td class="seg">1</td><td class="seg">No</td><td class="seg">
If the package is untrusted, displays the letter "U".
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%t</code></td><td class="seg">Archive</td><td class="seg">10</td><td class="seg">Yes</td><td class="seg">
The archive in which the package is found.
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%T</code></td><td class="seg">Tagged (and user-tags)</td><td class="seg">30</td><td class="seg">No</td><td class="seg">
<p>
Outputs <span class="quote">“<span class="quote"><code class="computeroutput">*</code></span>”</span> if
the package is tagged, nothing
otherwise.<a href="#ftn.idm4608" class="footnote" id="idm4608"><sup class="footnote">[19]</sup></a>
</p>
<p>
This field also includes user-tags.
</p>
</td></tr><tr class="oddrow"><td class="seg"><code class="literal">%u</code></td><td class="seg">Disk Usage Change</td><td class="seg">30</td><td class="seg">No</td><td class="seg">
If the scheduled actions will alter the amount of
space used on the disk, outputs a description of the
change in disk space; for instance,
<span class="quote">“<span class="quote"><code class="computeroutput">Will use 100MB of disk
space.</code></span>”</span>
</td></tr><tr class="seglistitem"><td class="seg"><code class="literal">%v</code></td><td class="seg">Current Version</td><td class="seg">14</td><td class="seg">No</td><td class="seg">
Outputs the currently installed version of the
package, or
<code class="computeroutput"><none></code> if the
package is not currently installed.
</td></tr><tr class="oddrow"><td class="seg"><a id="formatCandVer"></a><code class="literal">%V</code></td><td class="seg">Candidate Version</td><td class="seg">14</td><td class="seg">No</td><td class="seg">
Outputs the version of the package which would be
installed if <span class="guimenu">Package</span> → <span class="guimenuitem">Install</span> (<span class="shortcut"><strong><span class="keycap"><strong>+</strong></span></strong></span>) were issued on the
package, or
<code class="computeroutput"><none></code> if the
package is not currently available.
</td></tr><tr class="seglistitem"><td class="seg"><a id="formatSizeChange"></a><code class="literal">%Z</code></td><td class="seg">Size Change</td><td class="seg">9</td><td class="seg">No</td><td class="seg">
Outputs how much additional space will be used or how
much space will be freed by installing, upgrading, or
removing a package.
</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="secGroupingPolicy"></a>Customizing the package hierarchy</h4></div></div></div><p>
The package hierarchy is generated by a
<em class="firstterm">grouping policy</em>: rules describing
how the hierarchy should be built. The grouping policy
describes a <span class="quote">“<span class="quote">pipeline</span>”</span> of rules; each rule
can discard packages, create sub-hierarchies in which
packages reside, or otherwise manipulate the tree. The
configuration items <code class="literal"><a class="link" href="ch02s05s05.html#configDefault-Grouping">Aptitude::UI::Default-Grouping</a></code>
and <code class="literal"><a class="link" href="ch02s05s05.html#configDefault-Preview-Grouping">Aptitude::UI::Default-Preview-Grouping</a></code>
set the grouping policies for newly created package lists
and preview screens, respectively. You can set the
grouping policy for the <span class="emphasis"><em>current</em></span>
package list by pressing <span class="keycap"><strong>G</strong></span>.
</p><p>
The grouping policy is described by a comma-separated list
of rules:
<code class="literal"><em class="replaceable"><code>rule1</code></em>,<em class="replaceable"><code>rule2</code></em>,<em class="replaceable"><code>...</code></em></code>.
Each <em class="replaceable"><code>rule</code></em> consists of the name
of the rule, possibly followed by arguments: for instance,
<code class="literal">versions</code> or
<code class="literal">section(subdir)</code>. Whether arguments are
required and how many arguments are required (or allowed)
depends on the type of rule.
</p><p>
Rules can be <em class="firstterm">non-terminal</em> or
<em class="firstterm">terminal</em>. A non-terminal rule will
process a package by generating some part of the
hierarchy, then passing the package on to a later rule. A
terminal rule, on the other hand, will also generate part
of the tree (typically items corresponding to the
package), but does not pass its package to a later rule.
If no terminal rule is specified, <span class="command"><strong>aptitude</strong></span> will use the
default rule, which is to create the standard <span class="quote">“<span class="quote">package
items</span>”</span>.
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><pre class="synopsis">action</pre></span></dt><dd><p>
Groups packages according to the action scheduled on
them; packages that are not upgradable and will be
unchanged are ignored. This is the grouping that is
used in preview trees.
</p></dd><dt><span class="term"><pre class="synopsis">architecture</pre></span></dt><dd><p>
Groups packages according to their architecture.
</p></dd><dt><span class="term"><pre class="synopsis">deps</pre></span></dt><dd><p>
This is a terminal rule.
</p><p>
Creates standard package items which can be expanded
to reveal the dependencies of the package.
</p></dd><dt><span class="term"><pre class="synopsis">filter(<em class="replaceable"><code>pattern</code></em>)</pre></span></dt><dd><p>
Include only packages for which at least one version
matches <em class="replaceable"><code>pattern</code></em>.
</p><p>
If <em class="replaceable"><code>pattern</code></em> is
<span class="quote">“<span class="quote">missing</span>”</span>, no packages are discarded.
This is a backwards compatibility feature and may be
removed in the future.
</p></dd><dt><span class="term"><pre class="synopsis">firstchar[<span class="optional">(<em class="replaceable"><code>mode</code></em>)</span>]</pre></span></dt><dd><p>
Groups packages based on the first character of their name.
</p><p>
To be precise, it is not always the first letter -- for
packages starting with <code class="literal">lib*</code> the name of the
group is <code class="literal">liba</code>, <code class="literal">libb</code>,
... like in Debian FTPs.
</p><p>
<em class="replaceable"><code>mode</code></em> can be one of the following:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">binary</code></span></dt><dd><p>
Group based on the binary package name. This is the
default if no <em class="replaceable"><code>mode</code></em> is
specified.
</p><div class="example"><a id="idm4719"></a><p class="title"><strong>Example 2.7. Grouping policy <code class="literal">firstchar</code> or
<code class="literal">firstchar(binary)</code></strong></p><div class="example-contents"><p>
With the source package <code class="literal">dpkg</code> as an
example, the binary packages
<code class="literal">dselect</code>, <code class="literal">dpkg</code>
and <code class="literal">dpkg-dev</code> would be grouped under
<code class="literal">d</code>, while
<code class="literal">libdpkg-dev</code> and
<code class="literal">libdpkg-perl</code> would be added to the
<code class="literal">libd</code> group.
</p></div></div><br class="example-break" /></dd><dt><span class="term"><code class="literal">source</code></span></dt><dd><p>
Group based on the source package name.
</p><p>
This is useful for example when browsing packages coming
from the same source package (<a class="link" href="ch02s05s01.html#SourceGroupingPolicy">source</a> grouping
policy) within large collections (examples: all
installed packages, all upgradable packages, all
packages from "main" section), to add an intermediate
grouping step. In this way, one can for example emulate
the hierarchy of FTPs (try grouping:
<code class="literal">"section(topdir),firstchar(source),source"</code>).
</p><div class="example"><a id="idm4740"></a><p class="title"><strong>Example 2.8. Grouping policy
<code class="literal">firstchar(source)</code></strong></p><div class="example-contents"><p>
Again, with the source package <code class="literal">dpkg</code>
as an example, all the binary packages
<code class="literal">dselect</code>, <code class="literal">dpkg</code>,
<code class="literal">dpkg-dev</code>,
<code class="literal">libdpkg-dev</code> and
<code class="literal">libdpkg-perl</code> would be grouped under
<code class="literal">d</code>.
</p></div></div><br class="example-break" /></dd></dl></div></dd><dt><span class="term"><pre class="synopsis">pattern(<em class="replaceable"><code>pattern</code></em> [<span class="optional">=> <em class="replaceable"><code>title</code></em></span>] [<span class="optional">{ <em class="replaceable"><code>policy</code></em> }</span>] [<span class="optional">, ...</span>])</pre></span></dt><dd><p>
A customizable grouping policy. Each version of
every package is matched against the given
<em class="replaceable"><code>pattern</code></em>s. The first
match found is used to assign a
<em class="replaceable"><code>title</code></em> to the package;
packages are then grouped by their
<em class="replaceable"><code>title</code></em>. Strings of the
form <code class="literal">\N</code> that occur in
<em class="replaceable"><code>title</code></em> will be replaced by
the Nth result of the match. If
<em class="replaceable"><code>title</code></em> is not present, it
is assumed to be <code class="literal">\1</code>. Note that
packages which do not match any
<em class="replaceable"><code>pattern</code></em>s will not appear
in the tree at all.
</p><div class="example"><a id="idm4770"></a><p class="title"><strong>Example 2.9. Use of <code class="literal">pattern</code> to group packages by their maintainer</strong></p><div class="example-contents"><p>
<code class="literal">pattern(<code class="literal"><a class="link" href="ch02s04s05.html#searchMaintainer">?maintainer</a></code>() => \1)</code>
</p></div></div><br class="example-break" /><p>
The example above will group packages according to
their Maintainer field. The policy
<code class="literal">pattern(<code class="literal"><a class="link" href="ch02s04s05.html#searchMaintainer">?maintainer</a></code>())</code> will do
the same thing, as the absent
<em class="replaceable"><code>title</code></em> defaults to
<code class="literal">\1</code>.
</p><p>
Instead of <code class="literal">=>
<em class="replaceable"><code>title</code></em></code>, an entry
may end with <code class="literal">||</code>. This indicates
that packages matching the corresponding
<em class="replaceable"><code>pattern</code></em> will be inserted
into the tree at the same level as the
<code class="literal">pattern</code> grouping, rather than
being placed in subtrees.
</p><div class="example"><a id="idm4789"></a><p class="title"><strong>Example 2.10.
Use of <code class="literal">pattern</code> with some
packages placed at the top level
</strong></p><div class="example-contents"><p>
<code class="literal">pattern(<code class="literal"><a class="link" href="ch02s04s05.html#searchAction">?action</a></code>(remove) => Packages
Being Removed, <code class="literal"><a class="link" href="ch02s04s05.html#searchTrue">?true</a></code> ||)</code>
</p></div></div><br class="example-break" /><p>
The example above will place packages that are being
removed into a subtree, and place all the other
packages at the current level, grouped according to
the policies that follow <code class="literal">pattern</code>.
</p><p>
By default, all the packages that match each pattern
are grouped according to the rules that follow the
<code class="literal">pattern</code> policy. To specify a
different policy for some packages, write the policy
in braces (<code class="literal">{}</code>) after the title of
the group, after the <code class="literal">||</code>, or after
the pattern if neither is present. For instance:
</p><div class="example"><a id="examplePatternGroupingPolicyWithSubPolicies"></a><p class="title"><strong>Example 2.11.
Use of the <code class="literal">pattern</code> grouping policy with sub-policies
</strong></p><div class="example-contents"><p>
<code class="literal">pattern(<code class="literal"><a class="link" href="ch02s04s05.html#searchAction">?action</a></code>(remove) => Packages
Being Removed {}, <code class="literal"><a class="link" href="ch02s04s05.html#searchAction">?action</a></code>(install) => Packages
Being Installed, <code class="literal"><a class="link" href="ch02s04s05.html#searchTrue">?true</a></code> || {status})</code>
</p></div></div><br class="example-break" /><p>
The policy in the above example has the following
effects:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Packages that are being removed are placed into
a subtree labeled <span class="quote">“<span class="quote">Packages Being
Removed</span>”</span>; the grouping policy for this
subtree is empty, so the packages are placed
into a flat list.
</p></li><li class="listitem"><p>
Packages that are being installed are placed
into a subtree labeled <code class="literal">Packages Being
Installed</code> and grouped according to the
policies that follow <code class="literal">pattern</code>.
</p></li><li class="listitem"><p>
All remaining packages are placed at the top
level of the tree, grouped according to their
status.
</p></li></ul></div><p>
See <a class="xref" href="ch02s04.html" title="Search patterns">the section called “Search patterns”</a>
for more information on the format of
<em class="replaceable"><code>pattern</code></em>.
</p></dd><dt><span class="term"><pre class="synopsis">priority</pre></span></dt><dd><p>
Groups packages according to their priority.
</p></dd><dt><span class="term"><pre class="synopsis">section[<span class="optional">(<em class="replaceable"><code>mode</code></em>[<span class="optional">,passthrough</span>])</span>]</pre></span></dt><dd><p>
Groups packages according to their Section field.
</p><p>
<em class="replaceable"><code>mode</code></em> can be one of the
following:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">none</code></span></dt><dd><p>
Group based on the whole Section field, so
categories like <span class="quote">“<span class="quote">non-free/games</span>”</span> will be
created. This is the default if no
<em class="replaceable"><code>mode</code></em> is specified.
</p></dd><dt><span class="term"><code class="literal">topdir</code></span></dt><dd><p>
Group based on the part of the Section field
before the first <code class="literal">/</code>
character; if this part of the Section is not
recognized, or if there is no
<code class="literal">/</code>, the first entry in the
list <code class="literal"><a class="link" href="ch02s05s05.html#configTop-Sections">Aptitude::Sections::Top-Sections</a></code>
will be used instead.
</p></dd><dt><span class="term"><code class="literal">subdir</code></span></dt><dd><p>
Group based on the part of the Section field
after the first <code class="literal">/</code>
character, if it is contained in the list
<code class="literal"><a class="link" href="ch02s05s05.html#configTop-Sections">Aptitude::Sections::Top-Sections</a></code>.
If not, or if there is no
<code class="literal">/</code>, group based on the
entire Section field instead.
</p></dd><dt><span class="term"><code class="literal">subdirs</code></span></dt><dd><p>
Group based on the part of the Section field
after the first <code class="literal">/</code>
character, if the portion of the field
preceding it is contained in the list
<code class="literal"><a class="link" href="ch02s05s05.html#configTop-Sections">Aptitude::Sections::Top-Sections</a></code>;
if not, or if there is no
<code class="literal">/</code>, the entire field will be
used. If there are multiple
<code class="literal">/</code> characters in the portion
of the field that is used, a hierarchy of
groups will be formed. For instance, if
<span class="quote">“<span class="quote"><code class="literal">games</code></span>”</span> is not
a member of <code class="literal"><a class="link" href="ch02s05s05.html#configTop-Sections">Aptitude::Sections::Top-Sections</a></code>,
then a package with a section of
<span class="quote">“<span class="quote"><code class="literal">games/arcade</code></span>”</span>
will be placed under the top-level heading
<span class="quote">“<span class="quote"><code class="literal">games</code></span>”</span>, in a
sub-tree named
<span class="quote">“<span class="quote"><code class="literal">arcade</code></span>”</span>.
</p></dd></dl></div><p>
If <code class="literal">passthrough</code> is present,
packages which for some reason lack a true Section
(for instance, virtual packages) will be passed
directly to the next level of grouping without first
being placed in sub-categories.
</p></dd><dt><span class="term"><pre class="synopsis">status</pre></span></dt><dd><p>
Groups packages into the following categories:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Security Updates</p></li><li class="listitem"><p>Upgradable</p></li><li class="listitem"><p>New</p></li><li class="listitem"><p>Installed</p></li><li class="listitem"><p>Not Installed</p></li><li class="listitem"><p>Obsolete and Locally Created</p></li><li class="listitem"><p>Virtual</p></li></ul></div></dd><dt><a id="SourceGroupingPolicy"></a><span class="term"><pre class="synopsis">source</pre></span></dt><dd><p>
Groups packages according to their source package name.
</p></dd><dt><span class="term"><pre class="synopsis">tag[<span class="optional">(<em class="replaceable"><code>facet</code></em>)</span>]</pre></span></dt><dd><p>
Groups packages according to the Tag information
stored in the Debian package files. If
<em class="replaceable"><code>facet</code></em> is provided, then
only tags corresponding to that facet will be
displayed, and packages lacking this facet will be
hidden; otherwise, all packages will be displayed at
least once (with tagless packages listed separately
from packages that have tags).
</p><p>
For more information on debtags, see <a class="ulink" href="http://debtags.alioth.debian.org" target="_top">http://debtags.alioth.debian.org</a>.
</p></dd><dt><span class="term"><pre class="synopsis">task</pre></span></dt><dd><p>
Creates a tree called <span class="quote">“<span class="quote">Tasks</span>”</span> which contains the
available tasks (information on tasks is read from
<code class="filename">debian-tasks.desc</code> in the
package <code class="systemitem">tasksel</code>). The rule
following <code class="literal">task</code> will create its
categories as siblings of Tasks.
</p></dd><dt><span class="term"><pre class="synopsis">versions</pre></span></dt><dd><p>
This is a terminal rule.
</p><p>
Creates standard package items which can be expanded
to reveal the versions of the package.
</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="secSortingPolicy"></a>Customizing how packages are sorted</h4></div></div></div><p>
By default, packages in the package list or in the output
of <code class="literal"><a class="link" href="rn01re01.html#cmdlineSearch">aptitude
search</a></code> are sorted by name. However, it
is often useful to sort them according to different
criteria (for instance, package size), and <span class="command"><strong>aptitude</strong></span>
allows you to do just that by modifying the
<em class="firstterm">sorting policy</em>.
</p><p>
Like the grouping policy described in <a class="link" href="ch02s05s01.html#secGroupingPolicy" title="Customizing the package hierarchy">the previous section</a>,
the sorting policy is a comma-separated list. Each item
in the list is the name of a sorting rule; if packages are
<span class="quote">“<span class="quote">equal</span>”</span> according to the first rule, the second rule is
used to sort them, and so on. Placing a tilde character
(<code class="literal">~</code>) in front of a rule reverses the
usual meaning of that rule. For instance,
<code class="literal">priority,~name</code> will sort packages by
priority, but packages with the same priority will be
placed in reverse order according to name.
</p><p>
To change the sorting policy for an active package list,
press <span class="keycap"><strong>S</strong></span>. To change the default sorting
for all package lists, set the configuration option
<code class="literal"><a class="link" href="ch02s05s05.html#configDefault-Sorting">Aptitude::UI::Default-Sorting</a></code>.
To change the sorting policy for <code class="literal"><a class="link" href="rn01re01.html#cmdlineSearch">aptitude search</a></code>,
use the <code class="literal"><a class="link" href="rn01re01.html#cmdlineOptionSort">--sort</a></code>
command-line option.
</p><p>
The available rules are:
</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">installsize</code></span></dt><dd><p>
Sorts packages by the estimated amount of size they
require when installed.
</p></dd><dt><span class="term"><code class="literal">installsizechange</code></span></dt><dd><p>
Sorts packages by the change in the installed size (estimated
amount of size required when installed), comparing the current
version (if installed) and the candidate version to be
installed, upgraded or removed.
</p></dd><dt><span class="term"><code class="literal">debsize</code></span></dt><dd><p>
Sorts packages by the size of the package.
</p></dd><dt><span class="term"><code class="literal">name</code></span></dt><dd><p>
Sorts packages by name.
</p></dd><dt><span class="term"><code class="literal">priority</code></span></dt><dd><p>
Sorts packages by priority.
</p></dd><dt><span class="term"><code class="literal">version</code></span></dt><dd><p>
Sorts packages according to their version number.
</p></dd></dl></div></div><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm4608" class="footnote"><p><a href="#idm4608" class="para"><sup class="para">[19] </sup></a>Currently tagging is not supported;
this escape is for future use.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html"><img src="images/prev.gif" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s05.html"><img src="images/up.gif" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05s02.html"><img src="images/next.gif" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Customizing <span class="command"><strong>aptitude</strong></span> </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.gif" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Customizing keybindings</td></tr></table></div></body></html>
|