Home Files
Adminer
Execute Command
PHP Eval
Symlink
File Upload
Owner :
www-data
PHP Version
5.6.40-0+deb8u12
Disk Space
40.90 GB
Server Addr
19-www4
Your IP
10.10.10.40
Edit File
File:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Explicit search targets</title><link rel="stylesheet" type="text/css" href="aptitude.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="aptitude user's manual"><link rel="up" href="ch02s04.html" title="Search patterns"><link rel="prev" href="ch02s04s03.html" title="Searches and versions"><link rel="next" href="ch02s04s05.html" title="Search term reference"><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"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Explicit search targets</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04s03.html"><img src="images/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Search patterns</th><td width="20%" align="right"> <a accesskey="n" href="ch02s04s05.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 name="secExplicitMatchers"></a>Explicit search targets</h3></div></div></div><p> Some particularly complex searches can be expressed in <span class="command"><strong>aptitude</strong></span> using <em class="firstterm">explicit targets</em>. In normal search expressions, there is no way to refer to the package or version that is currently being tested. For instance, suppose that you want to search for all packages <em class="replaceable"><code>P</code></em> that depend on a second package <em class="replaceable"><code>Q</code></em> such that <em class="replaceable"><code>Q</code></em> recommends <em class="replaceable"><code>P</code></em>. Clearly you need to start out with a <code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDep">?depends</a></code>(...)</code> term. But the term filling in the <code class="literal">...</code> needs to somehow select packages that are identical to the one being matched against <code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDep">?depends</a></code></code>. When describing the goal above, I dealt with this by giving the packages names, calling them <em class="replaceable"><code>P</code></em> and <em class="replaceable"><code>Q</code></em>; terms with explicit targets do exactly the same thing. <a href="#ftn.idp57849936" class="footnote" name="idp57849936"><sup class="footnote">[17]</sup></a> </p><p> An explicit target is introduced by the <code class="literal"><a class="link" href="ch02s04s05.html#searchFor">?for</a></code> term: </p><div class="figure"><a name="idp57854096"></a><p class="title"><b>Figure 2.13. Syntax of the <code class="literal"><a class="link" href="ch02s04s05.html#searchFor">?for</a></code> term</b></p><div class="figure-contents"><pre class="synopsis"><code class="literal">?for <em class="replaceable"><code>variable</code></em>: <em class="replaceable"><code>pattern</code></em></code></pre></div></div><br class="figure-break"><p> This behaves exactly like <em class="replaceable"><code>pattern</code></em>, but <em class="replaceable"><code>variable</code></em> can be used within <em class="replaceable"><code>pattern</code></em> to refer to the package or version that <em class="replaceable"><code>pattern</code></em> is being matched against. You can use <em class="replaceable"><code>variable</code></em> in two ways: </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> The term <code class="literal"><a class="link" href="ch02s04s05.html#searchEqual">?=</a></code> will match exactly the package or version indicated by the given variable. Specifically: if the corresponding <code class="literal"><a class="link" href="ch02s04s05.html#searchFor">?for</a></code> term is limited to a particular version, then <code class="literal"><a class="link" href="ch02s04s05.html#searchEqual">?=</a></code> will match either that version (if <code class="literal"><a class="link" href="ch02s04s05.html#searchEqual">?=</a></code> is limited) or the whole package; otherwise it will match any version of the package. </p><p> See <a class="xref" href="ch02s04s05.html#exampleSearchEqual" title="Example 2.2. Use of the ?= term.">Example 2.2, “ Use of the <code class="literal">?=</code> term. ”</a> for an example of how to use <code class="literal"><a class="link" href="ch02s04s05.html#searchEqual">?=</a></code>. </p></li><li class="listitem"><p> The term <code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchBind">?bind</a></code>(<em class="replaceable"><code>variable</code></em>, <em class="replaceable"><code>pattern</code></em>)</code> will match any package or version if the value of <em class="replaceable"><code>variable</code></em> matches against <em class="replaceable"><code>pattern</code></em>. </p><p> For <code class="literal">?</code>-style terms, a shorthand form is available. The expression <code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchBind">?bind</a></code>(<em class="replaceable"><code>variable</code></em>, ?<em class="replaceable"><code>term</code></em>[<span class="optional">(<em class="replaceable"><code>args</code></em>)</span>])</code> can be replaced by <code class="literal">?<em class="replaceable"><code>variable</code></em>:<em class="replaceable"><code>term</code></em>(<em class="replaceable"><code>args</code></em>)</code>. </p><p> See <a class="xref" href="ch02s04s05.html#exampleSearchBind" title="Example 2.3. Use of the ?bind term">Example 2.3, “Use of the <code class="literal">?bind</code> term”</a> for an example of how to use <code class="literal">?bind</code>. </p></li></ol></div><div class="footnotes"><br><hr style="width:100; text-align:left;margin-left: 0"><div id="ftn.idp57849936" class="footnote"><p><a href="#idp57849936" class="para"><sup class="para">[17] </sup></a> Astute readers will note that this is essentially a way to explicitly name the variable in the λ-terms corresponding to the term. A typical term would have the form <span class="quote">“<span class="quote">λ <em class="replaceable"><code>x</code></em> . name-equals(<em class="replaceable"><code>x</code></em>, <em class="replaceable"><code>pattern</code></em>)</span>”</span>; giving this an explicit target makes <em class="replaceable"><code>x</code></em> visible in the search language. </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04s03.html"><img src="images/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s04.html"><img src="images/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04s05.html"><img src="images/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Searches and versions </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"> Search term reference</td></tr></table></div></body></html>