/usr/share/doc/aptitude/html/cs/ch02s03s04.html is in aptitude-doc-cs 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 | <?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>Explicitní cíle</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 - příručka uživatele" /><link rel="up" href="ch02s03.html" title="Vyhledávací vzory" /><link rel="prev" href="ch02s03s03.html" title="Hledání a verze balíků" /><link rel="next" href="ch02s03s05.html" title="Přehled vyhledávacích vzorů" /><link rel="preface" href="pr01.html" title="Úvod" /><link rel="chapter" href="ch01.html" title="Kapitola 1. Začínáme" /><link rel="chapter" href="ch02.html" title="Kapitola 2. aptitude - referenční příručka" /><link rel="chapter" href="ch03.html" title="Kapitola 3. Často kladené otázky" /><link rel="chapter" href="ch04.html" title="Kapitola 4. Poděkování" /><link rel="reference" href="rn01.html" title="Přehled příkazů" /><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><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Explicitní cíle</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03s03.html"><img src="images/prev.gif" alt="Předcházející" /></a> </td><th width="60%" align="center">Vyhledávací vzory</th><td width="20%" align="right"> <a accesskey="n" href="ch02s03s05.html"><img src="images/next.gif" alt="Další" /></a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="secExplicitMatchers"></a>Explicitní cíle</h3></div></div></div><p>
Některá obzvláště komplikovaná hledání můžete v <span class="command"><strong>aptitude</strong></span> vyjádřit
pomocí <em class="firstterm">explicitních cílů</em>. Při běžných hledáních
nemáte možnost se odkazovat na verzi, kterou zrovna testujete.
Představme si situaci, kdy chcete najít všechny balíky
<em class="replaceable"><code>P</code></em>, které závisí na balíku
<em class="replaceable"><code>Q</code></em> takovém, že <em class="replaceable"><code>Q</code></em>
doporučuje <em class="replaceable"><code>P</code></em>.
Evidentně začnete s termem <code class="literal"><code class="literal"><a class="link" href="ch02s03s05.html#searchDep">?depends</a></code>(...)</code>. Ovšem
term zapsaný místo <code class="literal">...</code> potřebuje nějakým způsobem
vybrat balíky, které jsou právě porovnávány oproti
<code class="literal"><code class="literal"><a class="link" href="ch02s03s05.html#searchDep">?depends</a></code></code>. V zadání úlohy jsme to vyřešili
použitím abstraktních jmen balíků <em class="replaceable"><code>P</code></em> a
<em class="replaceable"><code>Q</code></em>; Termy s explicitními cíli pracují úplně
stejně.<a href="#ftn.idm2201" class="footnote" id="idm2201"><sup class="footnote">[14]</sup></a>
</p><p>
Explicitní cíl je uveden termem <code class="literal"><a class="link" href="ch02s03s05.html#searchFor">?for</a></code>:
</p><div class="figure"><a id="idm2211"></a><p class="title"><strong>Obrázek 2.11. Syntaxe termu <code class="literal"><a class="link" href="ch02s03s05.html#searchFor">?for</a></code></strong></p><div class="figure-contents"><pre class="synopsis"><code class="literal">?for <em class="replaceable"><code>proměnná</code></em>: <em class="replaceable"><code>vzor</code></em></code></pre></div></div><br class="figure-break" /><p>
Tato forma se chová stejně jako <em class="replaceable"><code>vzor</code></em>, ale
navíc je možné se uvnitř <em class="replaceable"><code>vzor</code></em>u pomocí
<em class="replaceable"><code>proměnné</code></em> odkazovat na balík nebo verzi
balíku, vůči které se zrovna <em class="replaceable"><code>vzor</code></em>
porovnává.
<em class="replaceable"><code>Proměnnou</code></em> můžete použít dvěma způsoby:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Term <code class="literal"><a class="link" href="ch02s03s05.html#searchEqual">?=</a></code> se shoduje s balíkem nebo verzí zadanou pomocí proměnné.
Konkrétně: pokud je odpovídající term <code class="literal"><a class="link" href="ch02s03s05.html#searchFor">?for</a></code> omezen na konkrétní
verzi, pak se bude také <code class="literal"><a class="link" href="ch02s03s05.html#searchEqual">?=</a></code> shodovat pouze s touto verzí (nebo
celým balíkem). V opačném případě se bude <code class="literal"><a class="link" href="ch02s03s05.html#searchEqual">?=</a></code> shodovat s
libovolnou verzí balíku.
</p><p>
Příklad použití termu <code class="literal"><a class="link" href="ch02s03s05.html#searchEqual">?=</a></code> naleznete v příkladu
<a class="xref" href="ch02s03s05.html#exampleSearchEqual" title="Příklad 2.1. Použití termu ?=.">2.1 – „Použití termu <code class="literal">?=</code>.“</a>.
</p></li><li class="listitem"><p>
Term <code class="literal"><code class="literal"><a class="link" href="ch02s03s05.html#searchBind">?bind</a></code>(<em class="replaceable"><code>proměnná</code></em>,
<em class="replaceable"><code>vzor</code></em>)</code> se bude shodovat s balíkem
nebo verzí, pokud se bude hodnota <em class="replaceable"><code>proměnné</code></em>
shodovat se <em class="replaceable"><code>vzor</code></em>em.
</p><p>
Pro termy zapsané pomocí počátečního otazníku existuje zkrácená forma.
Výraz <code class="literal"><code class="literal"><a class="link" href="ch02s03s05.html#searchBind">?bind</a></code>(<em class="replaceable"><code>proměnná</code></em>,
?<em class="replaceable"><code>term</code></em>[<span class="optional">(<em class="replaceable"><code>argumenty</code></em>)</span>])</code>
lze přepsat jako
<code class="literal">?<em class="replaceable"><code>proměnná</code></em>:<em class="replaceable"><code>term</code></em>(<em class="replaceable"><code>argumenty</code></em>)</code>.
</p><p>
Příklad použití termu <code class="literal">?bind</code> naleznete v příkladu
<a class="xref" href="ch02s03s05.html#exampleSearchBind" title="Příklad 2.2. Použití termu ?bind">2.2 – „Použití termu <code class="literal">?bind</code>“</a>.
</p></li></ol></div><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm2201" class="footnote"><p><a href="#idm2201" class="para"><sup class="para">[14] </sup></a>
Všímaví studenti postřehli, že toto je v podstatě způsob explicitního
pojmenování proměnné v lambda výrazu příslušného termu. Typický term
má formu
<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>vzor</code></em>)</span>“</span>.
Použitím explicitního cíle se ve vyhledávacím jazyku zviditelní
proměnná <em class="replaceable"><code>x</code></em>.
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03s03.html"><img src="images/prev.gif" alt="Předcházející" /></a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s03.html"><img src="images/up.gif" alt="Nahoru" /></a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s03s05.html"><img src="images/next.gif" alt="Další" /></a></td></tr><tr><td width="40%" align="left" valign="top">Hledání a verze balíků </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.gif" alt="Domů" /></a></td><td width="40%" align="right" valign="top"> Přehled vyhledávacích vzorů</td></tr></table></div></body></html>
|