1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Qi user guide</title>
- <meta name="description" content="Qi user guide">
- <meta name="keywords" content="Qi user guide">
- <meta name="resource-type" content="document">
- <meta name="distribution" content="global">
- <meta name="Generator" content="makeinfo">
- <link href="#Top" rel="start" title="Top">
- <link href="#Index" rel="index" title="Index">
- <link href="dir.html#Top" rel="up" title="(dir)">
- <style type="text/css">
- <!--
- a.summary-letter {text-decoration: none}
- blockquote.indentedblock {margin-right: 0em}
- blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
- blockquote.smallquotation {font-size: smaller}
- div.display {margin-left: 3.2em}
- div.example {margin-left: 3.2em}
- div.lisp {margin-left: 3.2em}
- div.smalldisplay {margin-left: 3.2em}
- div.smallexample {margin-left: 3.2em}
- div.smalllisp {margin-left: 3.2em}
- kbd {font-style: oblique}
- pre.display {font-family: inherit}
- pre.format {font-family: inherit}
- pre.menu-comment {font-family: serif}
- pre.menu-preformatted {font-family: serif}
- pre.smalldisplay {font-family: inherit; font-size: smaller}
- pre.smallexample {font-size: smaller}
- pre.smallformat {font-family: inherit; font-size: smaller}
- pre.smalllisp {font-size: smaller}
- span.nolinebreak {white-space: nowrap}
- span.roman {font-family: initial; font-weight: normal}
- span.sansserif {font-family: sans-serif; font-weight: normal}
- ul.no-bullet {list-style: none}
- -->
- </style>
- </head>
- <body lang="en">
- <h1 class="settitle" align="center">Qi user guide</h1>
- <a name="Top"></a>
- <div class="header">
- <p>
- Next: <a href="#Introduction-to-Qi" accesskey="n" rel="next">Introduction to Qi</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="SEC_Top"></a>
- <p>This user guide is for Qi (version 2.9,
- 22 Jun 2022).
- </p>
- <table class="menu" border="0" cellspacing="0">
- <tr><td align="left" valign="top">• <a href="#Introduction-to-Qi" accesskey="1">Introduction to Qi</a>:</td><td> </td><td align="left" valign="top">Description and features of qi
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Invoking-qi" accesskey="2">Invoking qi</a>:</td><td> </td><td align="left" valign="top">Command-line options
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#The-qirc-file" accesskey="3">The qirc file</a>:</td><td> </td><td align="left" valign="top">Configuration file
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Packages" accesskey="4">Packages</a>:</td><td> </td><td align="left" valign="top">Managing packages
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Recipes" accesskey="5">Recipes</a>:</td><td> </td><td align="left" valign="top">Building packages
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Order-files" accesskey="6">Order files</a>:</td><td> </td><td align="left" valign="top">Handling build order
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Creating-packages" accesskey="7">Creating packages</a>:</td><td> </td><td align="left" valign="top">Making Qi packages
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Examining-packages" accesskey="8">Examining packages</a>:</td><td> </td><td align="left" valign="top">Debugging purposes
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Qi-exit-status" accesskey="9">Qi exit status</a>:</td><td> </td><td align="left" valign="top">Exit codes
- </td></tr>
- <tr><td align="left" valign="top">• <a href="#Index">Index</a>:</td><td> </td><td align="left" valign="top">
- </td></tr>
- </table>
- <br>
- <p>Copyright © 2019-2022 Matias Andres Fonzo, Santiago del Estero,
- Argentina.
- </p>
- <p>Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3 or
- any later version published by the Free Software Foundation; with no
- Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- </p>
- <hr>
- <a name="Introduction-to-Qi"></a>
- <div class="header">
- <p>
- Next: <a href="#Invoking-qi" accesskey="n" rel="next">Invoking qi</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Introduction-to-Qi-1"></a>
- <h2 class="chapter">1 Introduction to Qi</h2>
- <a name="index-introduction-to-qi"></a>
- <p>Qi is a simple but well-integrated package manager. It can create,
- install, remove, and upgrade software packages. Qi produces binary
- packages using recipes, which are files containing specific instructions
- to build each package from source. Qi can manage multiple packages
- under a single directory hierarchy. This method allows to maintain a set
- of packages and multiple versions of them. This means that Qi could be
- used as the main package manager or complement the existing one.
- </p>
- <p>Qi offers a friendly command line interface, a global configuration
- file, a simple recipe layout to deploy software packages; also works
- with binary packages in parallel, speeding up installations and packages
- in production. The format used for packages is a simplified and safer
- variant of POSIX pax archive compressed in lzip format.
- </p>
- <p>Qi is a modern (POSIX-compliant) shell script released under the
- terms of the GNU General Public License. There are only two major
- dependencies for the magic: graft(1) and tarlz(1), the rest is expected
- to be found in any Unix-like system.
- </p>
- <hr>
- <a name="Invoking-qi"></a>
- <div class="header">
- <p>
- Next: <a href="#The-qirc-file" accesskey="n" rel="next">The qirc file</a>, Previous: <a href="#Introduction-to-Qi" accesskey="p" rel="prev">Introduction to Qi</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Invoking-qi-1"></a>
- <h2 class="chapter">2 Invoking qi</h2>
- <a name="index-invocation"></a>
- <p>This chapter describes the synopsis for invoking Qi.
- </p>
- <div class="example">
- <pre class="example">Usage: qi COMMAND [<var>OPTION</var>...] [<var>FILE</var>]...
- </pre></div>
- <p>One mandatory command specifies the operation that ‘<samp>qi</samp>’ should
- perform, options are meant to detail how this operation should be
- performed during or after the process.
- </p>
- <p>Qi supports the following commands:
- </p>
- <dl compact="compact">
- <dt><code>warn</code></dt>
- <dd><p>Warn about files that will be installed.
- </p>
- </dd>
- <dt><code>install</code></dt>
- <dd><p>Install packages.
- </p>
- </dd>
- <dt><code>remove</code></dt>
- <dd><p>Remove packages.
- </p>
- </dd>
- <dt><code>upgrade</code></dt>
- <dd><p>Upgrade packages.
- </p>
- </dd>
- <dt><code>extract</code></dt>
- <dd><p>Extract packages for debugging purposes.
- </p>
- </dd>
- <dt><code>create</code></dt>
- <dd><p>Create a .tlz package from directory.
- </p>
- </dd>
- <dt><code>build</code></dt>
- <dd><p>Build packages using recipe names.
- </p>
- </dd>
- <dt><code>order</code></dt>
- <dd><p>Resolve build order through .order files
- </p></dd>
- </dl>
- <p>Options when installing, removing, or upgrading software packages:
- </p>
- <dl compact="compact">
- <dt><code>-f</code></dt>
- <dt><code>--force</code></dt>
- <dd><p>Force upgrade of pre-existing packages.
- </p>
- </dd>
- <dt><code>-k</code></dt>
- <dt><code>--keep</code></dt>
- <dd><p>Keep directories when build/remove/upgrade.
- </p>
- <p>Keep (don’t delete) the package directory when using remove/upgrade command.
- </p>
- <p>This will also try to preserve the directories ‘<samp>${srcdir}</samp>’ and
- ‘<samp>${destdir}</samp>’ when using build command. Its effect is available in
- recipes as ‘<samp>${keep_srcdir}</samp>’ and ‘<samp>${keep_destdir}</samp>’. See
- <a href="#Recipes">Special variables</a> for details.
- </p>
- </dd>
- <dt><code>-p</code></dt>
- <dt><code>--prune</code></dt>
- <dd><p>Prune conflicts.
- </p>
- </dd>
- <dt><code>-P</code></dt>
- <dt><code>--packagedir=<dir></code></dt>
- <dd><p>Set directory for package installations.
- </p>
- </dd>
- <dt><code>-t</code></dt>
- <dt><code>--targetdir=<dir></code></dt>
- <dd><p>Set target directory for symbolic links.
- </p>
- </dd>
- <dt><code>-r</code></dt>
- <dt><code>--rootdir=<dir></code></dt>
- <dd><p>Use the fully qualified named directory as the root directory for all qi
- operations.
- </p>
- <p>Note: the target directory and the package directory will be
- relative to the specified directory, excepting the graft log file.
- </p></dd>
- </dl>
- <p>Options when building software packages using recipes:
- </p>
- <dl compact="compact">
- <dt><code>-a</code></dt>
- <dt><code>--architecture</code></dt>
- <dd><p>Set architecture name for the package.
- </p>
- </dd>
- <dt><code>-j</code></dt>
- <dt><code>--jobs</code></dt>
- <dd><p>Parallel jobs for the compiler.
- </p>
- <p>This option sets the variable ‘<samp>${jobs}</samp>’. If not specified, default
- sets to 1.
- </p>
- </dd>
- <dt><code>-S</code></dt>
- <dt><code>--skip-questions</code></dt>
- <dd><p>Skip questions on completed recipes.
- </p>
- </dd>
- <dt><code>-1</code></dt>
- <dt><code>--increment</code></dt>
- <dd><p>Increment release number (‘<samp>${release}</samp>’ + 1).
- </p>
- <p>The effect of this option will be omitted if –no-package is being used.
- </p>
- </dd>
- <dt><code>-n</code></dt>
- <dt><code>--no-package</code></dt>
- <dd><p>Do not create a .tlz package.
- </p>
- </dd>
- <dt><code>-i</code></dt>
- <dt><code>--install</code></dt>
- <dd><p>Install package after the build.
- </p>
- </dd>
- <dt><code>-u</code></dt>
- <dt><code>--upgrade</code></dt>
- <dd><p>Upgrade package after the build.
- </p>
- </dd>
- <dt><code>-o</code></dt>
- <dt><code>--outdir=<dir></code></dt>
- <dd><p>Where the packages produced will be written.
- </p>
- <p>This option sets the variable ‘<samp>${outdir}</samp>’.
- </p>
- </dd>
- <dt><code>-w</code></dt>
- <dt><code>--worktree=<dir></code></dt>
- <dd><p>Where archives, patches, recipes are expected.
- </p>
- <p>This option sets the variable ‘<samp>${worktree}</samp>’.
- </p>
- </dd>
- <dt><code>-s</code></dt>
- <dt><code>--sourcedir=<dir></code></dt>
- <dd><p>Where compressed sources will be found.
- </p>
- <p>This option sets the variable ‘<samp>${tardir}</samp>’.
- </p></dd>
- </dl>
- <p>Other options:
- </p>
- <dl compact="compact">
- <dt><code>-v</code></dt>
- <dt><code>--verbose</code></dt>
- <dd><p>Be verbose (an extra -v gives more).
- </p>
- <p>It sets the verbosity level, default sets to 0.
- </p>
- <p>The value 1 is used for more verbosity while the value 2 is too detailed.
- Although at the moment it is limited to graft(1) verbosity.
- </p>
- </dd>
- <dt><code>-N</code></dt>
- <dt><code>--no-rc</code></dt>
- <dd><p>Do not read the configuration file.
- </p>
- <p>This will ignore reading the qirc file.
- </p>
- </dd>
- <dt><code>-L</code></dt>
- <dt><code>--show-location</code></dt>
- <dd><p>Print default directory locations and exit.
- </p>
- <p>This will print the target directory, package directory, working tree,
- the directory for sources, and the output directory for the packages
- produced.
- </p>
- </dd>
- <dt><code>-h</code></dt>
- <dt><code>--help</code></dt>
- <dd><p>Display the usage and exit.
- </p>
- </dd>
- <dt><code>-V</code></dt>
- <dt><code>--version</code></dt>
- <dd>
- <p>This will print the (short) version information and then exit.
- </p>
- <p>The same can be achieved if Qi is invoked as ‘<samp>qi version</samp>’.
- </p></dd>
- </dl>
- <p>When FILE is -, qi can read from the standard input. See examples from
- the <a href="#Packages">Packages</a> section.
- </p>
- <p>Exit status: 0 for a normal exit, 1 for minor common errors (help usage,
- support not available, etc), 2 to indicate a command execution error;
- 3 for integrity check error on compressed files, 4 for empty, not
- regular, or expected files, 5 for empty or not defined variables,
- 6 when a package already exist, 10 for network manager errors.
- For more details, see the <a href="#Qi-exit-status">Qi exit status</a> section.
- </p>
- <hr>
- <a name="The-qirc-file"></a>
- <div class="header">
- <p>
- Next: <a href="#Packages" accesskey="n" rel="next">Packages</a>, Previous: <a href="#Invoking-qi" accesskey="p" rel="prev">Invoking qi</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="The-qirc-file-1"></a>
- <h2 class="chapter">3 The qirc file</h2>
- <a name="index-configuration-file"></a>
- <p>The global <samp>qirc</samp> file offers a way to define variables and tools
- (such as a download manager) for default use. This file is used by qi
- at runtime, e.g., to build, install, remove or upgrade packages.
- </p>
- <p>Variables and their possible values must be declared as any other
- variable in the shell.
- </p>
- <p>The command line options related to the package directory and target
- directory and some of the command line options used for the build command,
- have the power to override the values declared on <samp>qirc</samp>.
- See <a href="#Invoking-qi">Invoking qi</a>.
- </p>
- <p>The order in which qi looks for this file is:
- </p>
- <ol>
- <li> <code>${HOME}/.qirc</code>
- Effective user.
- </li><li> ‘<samp>${sysconfdir}/qirc</samp>’
- System-wide.
- </li></ol>
- <p>If you intend to run qi as effective user, the file
- ‘<samp>${sysconfdir}/qirc</samp>’ could be copied to <code>${HOME}/.qirc</code>
- setting the paths for ‘<samp>${packagedir}</samp>’ and ‘<samp>${targetdir}</samp>’
- according to the <code>$HOME</code>.
- </p>
- <hr>
- <a name="Packages"></a>
- <div class="header">
- <p>
- Next: <a href="#Recipes" accesskey="n" rel="next">Recipes</a>, Previous: <a href="#The-qirc-file" accesskey="p" rel="prev">The qirc file</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Packages-1"></a>
- <h2 class="chapter">4 Packages</h2>
- <a name="index-managing-packages"></a>
- <p>A package is a suite of programs usually distributed in binary form
- which may also contain manual pages, documentation, or any other file
- associated to a specific software.
- </p>
- <p>The package format used by qi is a simplified POSIX pax archive
- compressed using lzip<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>. The
- file extension for packages ends in ‘<samp>.tlz</samp>’.
- </p>
- <p>Both package installation and package de-installation are managed using
- two important (internal) variables: ‘<samp>${packagedir}</samp>’ and
- ‘<samp>${targetdir}</samp>’, these values can be changed in the
- configuration file or via options.
- </p>
- <p>‘<samp>${packagedir}</samp>’ is a common directory tree where the package
- contents will be decompressed (will reside).
- </p>
- <p>‘<samp>${targetdir}</samp>’ is a target directory where the links will be
- made by graft(1) taking ‘<samp>${packagedir}/package_name</samp>’ into account.
- </p>
- <p>Packages are installed in self-contained directory trees and symbolic
- links from a common area are made to the package files. This allows
- multiple versions of the same package to coexist on the same system.
- </p>
- <a name="Package-conflicts"></a>
- <h3 class="section">4.1 Package conflicts</h3>
- <a name="index-package-conflicts"></a>
- <p>All the links to install or remove a package are handled by graft(1).
- Since multiple packages can be installed or removed at the same time,
- certain conflicts may arise between the packages.
- </p>
- <p>graft<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>
- defines a CONFLICT as one of the following conditions:
- </p>
- <ul>
- <li> If the package object is a directory and the target object exists but is
- not a directory.
- </li><li> If the package object is not a directory and the target object exists
- and is not a symbolic link.
- </li><li> If the package object is not a directory and the target object exists
- and is a symbolic link to something other than the package object.
- </li></ul>
- <p>The default behavior of qi for an incoming package is to ABORT if a
- conflict arises. When a package is going to be deleted, qi tells to
- graft(1) to remove those parts that are not in conflict, leaving the
- links to the belonging package. This behavior can be forced if the
- –prune option is given.
- </p>
- <a name="Installing-packages"></a>
- <h3 class="section">4.2 Installing packages</h3>
- <a name="index-package-installation"></a>
- <p>To install a single package, simply type:
- </p>
- <div class="example">
- <pre class="example">qi install coreutils_8.30_i586-1@tools.tlz
- </pre></div>
- <p>To install multiple packages at once, type:
- </p>
- <div class="example">
- <pre class="example">qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
- </pre></div>
- <p>Warn about the files that will be linked:
- </p>
- <div class="example">
- <pre class="example">qi warn bash_5.0_i586-1@shells.tlz
- </pre></div>
- <p>This is to verify the content of a package before installing it.
- </p>
- <p>See the process of an installation:
- </p>
- <div class="example">
- <pre class="example">qi install --verbose mariana_3.0_i586-1@woman.tlz
- </pre></div>
- <p>A second –verbose or -v option gives more (very verbose).
- </p>
- <p>Installing package in a different location:
- </p>
- <div class="example">
- <pre class="example">qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
- </pre></div>
- <p>Important: the –rootdir option assumes ‘<samp>${targetdir}</samp>’ and
- ‘<samp>${packagedir}</samp>’. See the following example:
- </p>
- <div class="example">
- <pre class="example">qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
- </pre></div>
- <p>The content of "lzip_1.21_i586-1@compressors.tlz" will be decompressed
- into ‘<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors</samp>’.
- Assuming that the main binary for lzip is under
- ‘<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/</samp>’
- the target for "usr/bin" will be created at ‘<samp>/home/selk</samp>’. Considering
- that you have exported the <code>PATH</code> as ‘<samp>${HOME}/usr/bin</samp>’, now the
- system is able to see the recent lzip command.
- </p>
- <p>Installing from a list of packages using standard input:
- </p>
- <div class="example">
- <pre class="example">qi install - < PACKAGELIST.txt
- </pre></div>
- <p>Or in combination with another tool:
- </p><div class="example">
- <pre class="example">sort -u PACKAGELIST.txt | qi install -
- </pre></div>
- <p>The sort command will read and sorts the list of declared packages,
- while trying to have unique entries for each statement. The output
- produced is captured by Qi to install each package.
- </p>
- <p>An example of a list containing package names is:
- </p><div class="example">
- <pre class="example">/var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
- /var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
- /var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
- </pre></div>
- <a name="Removing-packages"></a>
- <h3 class="section">4.3 Removing packages</h3>
- <a name="index-package-de_002dinstallation"></a>
- <p>To remove a package, simply type:
- </p>
- <div class="example">
- <pre class="example">qi remove xz_5.2.4_i586-1@compressors.tlz
- </pre></div>
- <p>Remove command will match the package name using ‘<samp>${packagedir}</samp>’ as
- prefix. For example, if the value of ‘<samp>${packagedir}</samp>’ has been
- set to /usr/pkg, this will be equal to:
- </p>
- <div class="example">
- <pre class="example">qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
- </pre></div>
- <p>Detailed output:
- </p>
- <div class="example">
- <pre class="example">qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
- </pre></div>
- <p>A second –verbose or -v option gives more (very verbose).
- </p>
- <p>By default the remove command does not preserve a package directory after
- removing its links from ‘<samp>${targetdir}</samp>’, but this behavior can be
- changed if the –keep option is passed:
- </p>
- <div class="example">
- <pre class="example">qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
- </pre></div>
- <p>This means that the links to the package can be reactivated, later:
- </p>
- <div class="example">
- <pre class="example">cd /usr/pkg && graft -i lzip_1.21_i586-1@compressors
- </pre></div>
- <p>Removing package from a different location:
- </p>
- <div class="example">
- <pre class="example">qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
- </pre></div>
- <p>Removing a package using standard input:
- </p>
- <div class="example">
- <pre class="example">echo vala_0.42.3_amd64-1@devel | qi remove -
- </pre></div>
- <p>This will match with the package directory.
- </p>
- <a name="Upgrading-packages"></a>
- <h3 class="section">4.4 Upgrading packages</h3>
- <a name="index-package-upgrade"></a>
- <p>The upgrade command inherits the properties of the installation and removal
- process. To make sure that a package is updated, the package is installed
- in a temporary directory taking ‘<samp>${packagedir}</samp>’ into account. Once
- the incoming package is pre-installed, qi can proceed to search and delete
- packages that have the same name (considered as previous ones). Finally,
- the package is re-installed at its final location and the temporary
- directory is removed.
- </p>
- <p>Since updating a package can be crucial and so to perform a successful
- upgrade, from start to finish, you will want to ignore some important
- system signals during the upgrade process, those signals are SIGHUP,
- SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
- </p>
- <p>To upgrade a package, just type:
- </p>
- <div class="example">
- <pre class="example">qi upgrade gcc_9.0.1_i586-1@devel.tlz
- </pre></div>
- <p>This will proceed to upgrade "gcc_9.0.1_i586-1@devel" removing any other
- version of "gcc" (if any).
- </p>
- <p>If you want to keep the package directories of versions found during the
- upgrade process, just pass:
- </p>
- <div class="example">
- <pre class="example">qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
- </pre></div>
- <p>To see the upgrade process:
- </p>
- <div class="example">
- <pre class="example">qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
- </pre></div>
- <p>A second –verbose or -v option gives more (very verbose).
- </p>
- <p>To force the upgrade of an existing package:
- </p>
- <div class="example">
- <pre class="example">qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
- </pre></div>
- <a name="Package-blacklist"></a>
- <h4 class="subsection">4.4.1 Package blacklist</h4>
- <a name="index-package-blacklist"></a>
- <p>To implement general package facilities, either to install, remove or
- maintain the hierarchy of packages in a clean manner, qi makes use of the
- pruning operation via graft(1) by default:
- </p>
- <p>There is a risk if those are crucial packages for the proper functioning
- of the system, because it implies the deactivation of symbolic from the
- target directory, <em>especially</em> when transitioning an incoming package
- into its final location during an upgrade.
- </p>
- <p>A blacklist of package names has been devised for the case where
- a user decides to upgrade all the packages in the system, or
- just the crucial ones, such as the C library.
- </p>
- <p>The blacklist is related to the upgrade command only, consists in installing
- a package instead of updating it or removing previous versions of it;
- the content of the package will be updated over the existing content at
- ‘<samp>${packagedir}</samp>’, while the existing links from
- ‘<samp>${targetdir}</samp>’ will be preserved. A pruning of links will be
- carried out in order to re-link possible differences with the recent
- content, this helps to avoid leaving dead links in the target directory.
- </p>
- <p>Package names for the blacklist to be declared must be set from the
- configuration file. By default, it is declared using the package name,
- which is more than enough for critical system packages, but if you want to
- be more specific, you can declare a package using:
- ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}</samp>’ where
- the package category is avoided for common matching. See
- <a href="#Recipes">Special variables</a> for a description of these variables.
- </p>
- <hr>
- <a name="Recipes"></a>
- <div class="header">
- <p>
- Next: <a href="#Order-files" accesskey="n" rel="next">Order files</a>, Previous: <a href="#Packages" accesskey="p" rel="prev">Packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Recipes-1"></a>
- <h2 class="chapter">5 Recipes</h2>
- <a name="index-recipes"></a>
- <p>A recipe is a file telling qi what to do. Most often, the recipe tells
- qi how to build a binary package from a source tarball.
- </p>
- <p>A recipe has two parts: a list of variable definitions and a list of
- sections. By convention, the syntax of a section is:
- </p>
- <div class="example">
- <pre class="example">section_name()
- {
- section lines
- }
- </pre></div>
- <p>The section name is followed by parentheses, one newline and an opening
- brace. The line finishing the section contains just a closing brace.
- The section names or the function names currently recognized are
- ‘<samp>build</samp>’.
- </p>
- <p>The ‘<samp>build</samp>’ section (or <strong>shell function</strong>) is an augmented
- shell script that contains the main instructions to build software
- from source.
- </p>
- <p>If there are other functions defined by the packager, Qi detects them
- for later execution.
- </p>
- <a name="Variables"></a>
- <h3 class="section">5.1 Variables</h3>
- <a name="index-variables"></a>
- <p>A "variable" is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
- or in a recipe to represent a string of text, called the variable’s
- "value". These values are substituted by explicit request in the
- definitions of other variables or in calls to external commands.
- </p>
- <p>Variables can represent lists of file names, options to pass to
- compilers, programs to run, directories to look in for source files,
- directories to write output to, or anything else you can imagine.
- </p>
- <p>Definitions of variables in qi have four levels of precedence.
- Options which define variables from the command-line override those
- specified in the <samp>qirc</samp> file, while variables defined in the recipe
- override those specified in <samp>qirc</samp>, taking priority over those
- variables set by command-line options. Finally, the variables have
- default values if they are not defined anywhere.
- </p>
- <p>Options that set variables through the command-line can only reference
- variables defined in <samp>qirc</samp> and variables with default values.
- </p>
- <p>Definitions of variables in <samp>qirc</samp> can only reference variables
- previously defined in <samp>qirc</samp> and variables with default values.
- </p>
- <p>Definitions of variables in the recipe can only reference variables
- set by the command-line, variables previously defined in the recipe,
- variables defined in <samp>qirc</samp>, and variables with default values.
- </p>
- <a name="Special-variables"></a>
- <h3 class="section">5.2 Special variables</h3>
- <a name="index-special-variables"></a>
- <p>There are variables which can only be set using the command line options or
- via <samp>qirc</samp>, there are other special variables which can be defined or
- redefined in a recipe. See the following definitions:
- </p>
- <p>‘<samp>outdir</samp>’ is the directory where the packages produced are written.
- This variable can be redefined per-recipe. Default sets to
- ‘<samp>/var/cache/qi/packages</samp>’.
- </p>
- <p>‘<samp>worktree</samp>’ is the working tree where archives, patches, and recipes
- are expected. This variable can not be redefined in the recipe. Default
- sets to ‘<samp>/usr/src/qi</samp>’.
- </p>
- <p>‘<samp>tardir</samp>’ is defined in the recipe to the directory where the tarball
- containing the source can be found. The full name of the tarball is
- composed as ‘<samp>${tardir}/$tarname</samp>’. Its value is available in the
- recipe as ‘<samp>${tardir}</samp>’; a value of . for ‘<samp>tardir</samp>’ sets it to
- the value of CWD (Current Working Directory), this is where the recipe
- lives.
- </p>
- <p>‘<samp>arch</samp>’ is the architecture to compose the package name. Its value is
- available in the recipe as ‘<samp>${arch}</samp>’. Default value is the one
- that was set in the Qi configuration.
- </p>
- <p>‘<samp>jobs</samp>’ is the number of parallel jobs to pass to the compiler. Its
- value is available in the recipe as ‘<samp>${jobs}</samp>’. The default value
- is 1.
- </p>
- <p>The two variables ‘<samp>${srcdir}</samp>’ and ‘<samp>${destdir}</samp>’ can be
- set in the recipe, as any other variable, but if they are not, qi uses
- default values for them when building a package.
- </p>
- <p>‘<samp>srcdir</samp>’ contains the source code to be compiled, and defaults to
- ‘<samp>${program}-${version}</samp>’. ‘<samp>destdir</samp>’ is the place where the
- built package will be installed, and defaults to
- ‘<samp>${TMPDIR}/package-${program}</samp>’.
- </p>
- <p>If ‘<samp>pkgname</samp>’ is left undefined, the special variable ‘<samp>program</samp>’
- is assigned by default. If ‘<samp>pkgversion</samp>’ is left undefined, the
- special variable ‘<samp>version</samp>’ is assigned by default.
- </p>
- <p>‘<samp>pkgname</samp>’ and ‘<samp>pkgversion</samp>’ along with: ‘<samp>version</samp>’, ‘<samp>arch</samp>’,
- ‘<samp>release</samp>’, and (optionally) ‘<samp>pkgcategory</samp>’ are used to produce the
- package name in the form:
- ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz</samp>’
- </p>
- <p>‘<samp>pkgcategory</samp>’ is an optional special variable that can be defined on the
- recipe to categorize the package name. If it is defined, then the
- package output will be composed as
- ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz</samp>’.
- Automatically, the value of ‘<samp>pkgcategory</samp>’ will be prefixed using the
- ‘<samp>@</samp>’ (at) symbol which will be added to the last part of the package name.
- </p>
- <p>A special variable called ‘<samp>replace</samp>’ can be used to declare package names
- that will be replaced at installation time.
- </p>
- <p>The special variables ‘<samp>keep_srcdir</samp>’ and ‘<samp>keep_destdir</samp>’ are provided
- in order to preserve the directories ‘<samp>${srcdir}</samp>’ or ‘<samp>${destdir}</samp>’,
- if those exists as such. Note: The declaration of these variables are subject
- to manual deactivation; its purpose in recipes is to preserve the directories
- that relate to the package’s build (source) and destination directory, that is
- so that another recipe can get a new package (or meta package) from there. For
- example, the declarations can be done as:
- </p>
- <div class="example">
- <pre class="example">keep_srcdir=keep_srcdir
- keep_destdir=keep_destdir
- </pre></div>
- <p>Then from another recipe you would proceed to copy the necessary files that
- will compose the meta package, from the main function you must deactivate
- the variables at the end:
- </p>
- <div class="example">
- <pre class="example">unset -v keep_srcdir keep_destdir
- </pre></div>
- <p>This will leave the ’keep_srcdir’ and ’keep_destdir’ variables blank to
- continue with the rest of the recipes.
- </p>
- <p>The variable ‘<samp>tarlz_compression_options</samp>’ can be used to change the
- default compression options in tarlz(1), default sets to ‘<samp>-9 --solid</samp>’.
- For example if the variable is declared as:
- </p>
- <div class="example">
- <pre class="example">tarlz_compression_options="-0 --bsolid"
- </pre></div>
- <p>It will change the granularity of tarlz(1) by using the ‘<samp>--bsolid</samp>’
- option <a name="DOCF3" href="#FOOT3"><sup>3</sup></a>,
- as well as increasing the compression speed by lowering the compression
- level with ‘<samp>-0</samp>’.
- </p>
- <p>This is only recommended for recipes where testing, or faster processing is
- desired to create the packaged file more quickly. It is not recommended for
- production or general distribution of binary packages.
- </p>
- <p>A typical recipe contains the following variables:
- </p>
- <ul>
- <li> ‘<samp>program</samp>’: Software name.
- <p>It matches the source name. It is also used to compose the name of the
- package if ‘<samp>${pkgname}</samp>’ is not specified.
- </p>
- </li><li> ‘<samp>version</samp>’: Software version.
- <p>It matches the source name. It is also used to compose the version of the
- package if ‘<samp>${pkgversion}</samp>’ is not specified.
- </p>
- </li><li> ‘<samp>arch</samp>’: Software architecture.
- <p>It is used to compose the architecture of the package in which it is
- build.
- </p>
- </li><li> ‘<samp>release</samp>’: Release number.
- <p>This is used to reflect the release number of the package. It is
- recommended to increase this number after any significant change in
- the recipe or post-install script.
- </p>
- </li><li> ‘<samp>pkgcategory</samp>’: Package category.
- <p>Optional but recommended variable to categorize the package name when it is
- created.
- </p></li></ul>
- <p>Obtaining sources over the network must be declared in the recipe using
- the ‘<samp>fetch</samp>’ variable.
- </p>
- <p>The variables ‘<samp>netget</samp>’ and ‘<samp>rsync</samp>’ can be defined in <samp>qirc</samp>
- to establish a network downloader in order to get the sources. If they
- are not defined, qi uses default values:
- </p>
- <p>‘<samp>netget</samp>’ is the general network downloader tool, defaults sets to
- ‘<samp>wget2 -c -w1 -t3 --no-check-certificate</samp>’.
- </p>
- <p>‘<samp>rsync</samp>’ is the network tool for sources containing the prefix for
- the RSYNC protocol, default sets to
- ‘<samp>rsync -v -a -L -z -i --progress</samp>’.
- </p>
- <p>The variable ‘<samp>description</samp>’ is used to print the package description
- when a package is installed.
- </p>
- <p>A description has two parts: a brief description, and a long description.
- By convention, the syntax of ‘<samp>description</samp>’ is:
- </p>
- <div class="example">
- <pre class="example">description="
- Brief description.
- Long description.
- "
- </pre></div>
- <p>The first line of the value represented is a brief description of the
- software (called "blurb"). A blank line separates the <em>brief
- description</em> from the <em>long description</em>, which should contain a more
- descriptive description of the software.
- </p>
- <p>An example looks like:
- </p>
- <div class="example">
- <pre class="example">description="
- The GNU core utilities.
- The GNU core utilities are the basic file, shell and text manipulation
- utilities of the GNU operating system. These are the core utilities
- which are expected to exist on every operating system.
- "
- </pre></div>
- <p>Please consider a length limit of 78 characters as maximum, because the same
- one would be used on the meta file creation. See
- <a href="#Recipes">The meta file</a> section.
- </p>
- <p>The ‘<samp>homepage</samp>’ variable is used to declare the main site or home page:
- </p>
- <div class="example">
- <pre class="example">homepage=https://www.gnu.org/software/gcc
- </pre></div>
- <p>The variable ‘<samp>license</samp>’ is used for license information<a name="DOCF4" href="#FOOT4"><sup>4</sup></a>.
- Some code in the program can be covered by license A, license B, or
- license C. For "separate licensing" or "heterogeneous licensing", we
- suggest using <strong>|</strong> for a disjunction, <strong>&</strong> for a conjunction
- (if that ever happens in a significant way), and comma for heterogeneous
- licensing. Comma would have lower precedence, plus added special terms.
- </p>
- <div class="example">
- <pre class="example">license="LGPL, GPL | Artistic - added permission"
- </pre></div>
- <a name="Writing-recipes"></a>
- <h3 class="section">5.3 Writing recipes</h3>
- <a name="index-writing-recipes"></a>
- <p>Originally, Qi was designed for the series of Dragora GNU/Linux-Libre 3;
- this doesn’t mean you can’t use it in another distribution, just that if
- you do, you’ll have to try it out for yourself. To help with this, here
- are some references to well-written recipes:
- </p>
- <ul>
- <li> <a href="https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>
- </li><li> <a href="https://notabug.org/dragora/dragora/src/master/recipes">https://notabug.org/dragora/dragora/src/master/recipes</a>
- </li><li> <a href="https://notabug.org/dragora/dragora-extras/src/master/recipes">https://notabug.org/dragora/dragora-extras/src/master/recipes</a>
- </li><li> <a href="https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes</a>
- </li></ul>
- <a name="Building-packages"></a>
- <h3 class="section">5.4 Building packages</h3>
- <a name="index-package-build"></a>
- <p>A recipe is any valid regular file. Qi sets priorities for reading a
- recipe, the order in which qi looks for a recipe is:
- </p>
- <ol>
- <li> Current working directory.
- </li><li> If the specified path name does not contain "recipe" as the last
- component. Qi will complete it by adding "recipe" to the path name.
- </li><li> If the recipe is not in the current working directory, it will be
- searched under ‘<samp>${worktree}/recipes</samp>’. The last component will be
- completed adding "recipe" to the specified path name.
- </li></ol>
- <p>To build a single package, type:
- </p>
- <div class="example">
- <pre class="example">qi build x-apps/xterm
- </pre></div>
- <p>Multiple jobs can be passed to the compiler to speed up the build process:
- </p>
- <div class="example">
- <pre class="example">qi build --jobs 3 x-apps/xterm
- </pre></div>
- <p>Update or install the produced package (if not already installed) when the
- build command ends:
- </p>
- <div class="example">
- <pre class="example">qi build -j3 --upgrade x-apps/xterm
- </pre></div>
- <p>Only process a recipe but do not create the binary package:
- </p>
- <div class="example">
- <pre class="example">qi build --no-package dict/aspell
- </pre></div>
- <p>The options –install or –upgrade have no effect when –no-package
- is given.
- </p>
- <p>This is useful to inspect the build process of the above recipe:
- </p>
- <p>qi build –keep –no-package dict/aspell 2>&1 | tee aspell-log.txt
- </p>
- <p>The –keep option could preserve the source directory and the destination
- directory for later inspection. A log file of the build process will be
- created redirecting both, standard error and standard output to tee(1).
- </p>
- <a name="Variables-from-the-environment"></a>
- <h3 class="section">5.5 Variables from the environment</h3>
- <a name="index-environment-variables"></a>
- <p>Qi has environment variables which can be used at build time:
- </p>
- <p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
- used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
- prepended to the value of ‘<samp>${srcdir}</samp>’ and ‘<samp>${destdir}</samp>’ in
- build command. By convention its default value is equal to
- ‘<samp>/usr/src/qi/build</samp>’.
- </p>
- <p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, <code>QILDFLAGS</code>, and
- <code>QICPPFLAGS</code> have no effect by default. The environment variables
- such as <code>CFLAGS</code>, <code>CXXFLAGS</code>, <code>LDFLAGS</code>, and <code>CPPFLAGS</code>
- are unset at compile time:
- </p>
- <p>Recommended practice is to set variables in the command line of
- ‘<samp>configure</samp>’ or <em>make(1)</em> instead of exporting to the
- environment. As follows:
- </p>
- <p><a href="https://www.gnu.org/software/make/manual/html_node/Environment.html">https://www.gnu.org/software/make/manual/html_node/Environment.html</a>
- </p><blockquote>
- <p>It is not wise for makefiles to depend for their functioning on environment
- variables set up outside their control, since this would cause different
- users to get different results from the same makefile. This is against the
- whole purpose of most makefiles.
- </p></blockquote>
- <p>Setting environment variables for configure is deprecated because running
- configure in varying environments can be dangerous.
- </p>
- <p><a href="https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
- </p><blockquote>
- <p>Variables not defined in a site shell script can be set in the environment
- passed to configure. However, some packages may run configure again
- during the build, and the customized values of these variables may be
- lost. In order to avoid this problem, you should set them in the
- configure command line, using ‘<samp>VAR=value</samp>’. For example:
- </p>
- <p><code>./configure CC=/usr/local2/bin/gcc</code>
- </p></blockquote>
- <p><a href="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
- </p><blockquote>
- <p>If for instance the user runs ‘<samp>CC=bizarre-cc ./configure</samp>’, then the cache,
- config.h, and many other output files depend upon bizarre-cc being the C
- compiler. If for some reason the user runs ./configure again, or if it is
- run via ‘<samp>./config.status --recheck</samp>’, (See Automatic Remaking, and see
- config.status Invocation), then the configuration can be inconsistent,
- composed of results depending upon two different compilers.
- [...]
- Indeed, while configure can notice the definition of CC in ‘<samp>./configure
- CC=bizarre-cc</samp>’, it is impossible to notice it in ‘<samp>CC=bizarre-cc
- ./configure</samp>’, which, unfortunately, is what most users do.
- [...]
- configure: error: changes in the environment can compromise the build.
- </p></blockquote>
- <p>If the <code>SOURCE_DATE_EPOCH</code> environment variable is set to a UNIX timestamp
- (defined as the number of seconds, excluding leap seconds, since 01 Jan 1970
- 00:00:00 UTC.); then the given timestamp will be used to overwrite any newer
- timestamps on the package contents (when it is created). More information
- about this can be found at
- <a href="https://reproducible-builds.org/specs/source-date-epoch/">https://reproducible-builds.org/specs/source-date-epoch/</a>.
- </p>
- <a name="The-meta-file"></a>
- <h3 class="section">5.6 The meta file</h3>
- <a name="index-the-meta-file"></a>
- <p>The "meta file" is a regular file created during the build process, it
- contains information about the package such as package name, package
- version, architecture, release, fetch address, description, and other
- minor data extracted from processed recipes. The name of the file is
- generated as ‘<samp>${full_pkgname}.tlz.txt</samp>’, and its purpose is to
- reflect essential information to the user without having to look inside
- the package content. The file format is also intended to be used by
- other scripts or by common Unix tools.
- </p>
- <p>The content of a meta file looks like:
- </p>
- <div class="example">
- <pre class="example">#
- # Pattern scanning and processing language.
- #
- # The awk utility interprets a special-purpose programming language
- # that makes it possible to handle simple data-reformatting jobs
- # with just a few lines of code. It is a free version of 'awk'.
- #
- # GNU awk implements the AWK utility which is part of
- # IEEE Std 1003.1 Shell and Utilities (XCU).
- #
- QICFLAGS="-O2"
- QICXXFLAGS="-O2"
- QILDFLAGS=""
- QICPPFLAGS=""
- pkgname=gawk
- pkgversion=5.0.1
- arch=amd64
- release=1
- pkgcategory="tools"
- full_pkgname=gawk_5.0.1_amd64-1@tools
- blurb="Pattern scanning and processing language."
- homepage="https://www.gnu.org/software/gawk"
- license="GPLv3+"
- fetch="https://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz"
- replace=""
- </pre></div>
- <p>A package descriptions is extracted from the variable ‘<samp>description</samp>’
- where each line is interpreted literally and pre-formatted to fit in
- (exactly) <strong>80 columns</strong>, plus the character ‘<samp>#</samp>’ and a blank
- space is prefixed to every line (shell comments).
- </p>
- <p>In addition to the Special variables, there are implicit variables such as
- ‘<samp>blurb</samp>’:
- </p>
- <p>The ‘<samp>blurb</samp>’ variable is related to the special variable
- ‘<samp>description</samp>’. Its value is made from the first (substantial)
- line of ‘<samp>description</samp>’, mentioned as the "brief description".
- </p>
- <p>The build flags such as ‘<samp>QICFLAGS</samp>’, ‘<samp>QICXXFLAGS</samp>’,
- ‘<samp>QILDFLAGS</samp>’, and ‘<samp>QICPPFLAGS</samp>’ are only added to the meta file
- if the declared variable ‘<samp>arch</samp>’ is not equal to the "noarch" value.
- </p>
- <hr>
- <a name="Order-files"></a>
- <div class="header">
- <p>
- Next: <a href="#Creating-packages" accesskey="n" rel="next">Creating packages</a>, Previous: <a href="#Recipes" accesskey="p" rel="prev">Recipes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Order-files-1"></a>
- <h2 class="chapter">6 Order files</h2>
- <a name="index-handling-build-order"></a>
- <p>The order command has the purpose of resolving the build order through
- .order files. An order file contains a list of recipe names, by default
- does not perform any action other than to print a resolved list in
- descending order. For example, if <strong>a</strong> depends on <strong>b</strong> and
- <strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
- look like:
- </p>
- <div class="example">
- <pre class="example">a: c b
- b:
- c: b
- </pre></div>
- <p>Each letter represents a recipe name, complete dependencies for
- the first recipe name are listed in descending order, which is
- printed from right to left, and removed from left to right:
- </p>
- <p><small>OUTPUT</small>
- </p>
- <div class="example">
- <pre class="example">b
- c
- a
- </pre></div>
- <p>Blank lines, colons and parentheses are simply ignored. Comment lines
- beginning with ‘<samp>#</samp>’ are allowed.
- </p>
- <p>An order file could be used to build a series of packages, for example,
- if the content is:
- </p>
- <div class="example">
- <pre class="example"># Image handling libraries
- libs/libjpeg-turbo: devel/nasm
- x-libs/jasper: libs/libjpeg-turbo
- libs/tiff: libs/libjpeg-turbo
- </pre></div>
- <p>To proceed with each recipe, we can type:
- </p>
- <div class="example">
- <pre class="example">qi order imglibs.order | qi build --install -
- </pre></div>
- <p>The output of ‘<samp>qi order imglibs.order</samp>’ tells to qi in which order it
- should build the recipes:
- </p>
- <div class="example">
- <pre class="example">devel/nasm
- libs/libjpeg-turbo
- x-libs/jasper
- libs/tiff
- </pre></div>
- <hr>
- <a name="Creating-packages"></a>
- <div class="header">
- <p>
- Next: <a href="#Examining-packages" accesskey="n" rel="next">Examining packages</a>, Previous: <a href="#Order-files" accesskey="p" rel="prev">Order files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Creating-packages-1"></a>
- <h2 class="chapter">7 Creating packages</h2>
- <a name="index-package-creation"></a>
- <p>The creation command is an internal function of qi to make new Qi
- compatible packages. A package is produced using the contents of
- the Current Working Directory and the package file is written out.
- </p>
- <div class="example">
- <pre class="example">Usage: qi create [<var>Output/PackageName.tlz</var>]...
- </pre></div>
- <p>The argument for the file name to be written must contain a fully
- qualified named directory as the output directory where the package
- produced will be written. The file name should be composed using the
- full name: name-version-architecture-release[@pkgcategory].tlz
- </p>
- <p><small>EXAMPLE</small>
- </p>
- <div class="example">
- <pre class="example">cd /usr/pkg
- cd claws-mail_3.17.1_amd64-1@x-apps
- qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
- </pre></div>
- <p>In this case, the package "claws-mail_3.17.1_amd64-1@x-apps" will be
- written into ‘<samp>/var/cache/qi/packages/</samp>’.
- </p>
- <p>All packages produced are complemented by a checksum file (.sha256).
- </p>
- <hr>
- <a name="Examining-packages"></a>
- <div class="header">
- <p>
- Next: <a href="#Qi-exit-status" accesskey="n" rel="next">Qi exit status</a>, Previous: <a href="#Creating-packages" accesskey="p" rel="prev">Creating packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Examining-packages-1"></a>
- <h2 class="chapter">8 Examining packages</h2>
- <a name="index-package-examination"></a>
- <p>The extraction command serves to examine binary packages for debugging
- purposes. It decompresses a package into a single directory, verifying
- its integrity and preserving all of its properties (owner and permissions).
- </p>
- <div class="example">
- <pre class="example">Usage: qi extract [<var>packagename.tlz</var>]...
- </pre></div>
- <p><small>EXAMPLE</small>
- </p>
- <div class="example">
- <pre class="example">qi extract mksh_R56c_amd64-1@shells.tlz
- </pre></div>
- <p>This action will put the content of "mksh_R56c_amd64-1@shells.tlz" into a
- single directory, this is a private directory for the user who requested
- the action, creation operation will be equal to <strong>u=rwx,g=,o= (0700)</strong>.
- The package content will reside on this location, default mask to deploy
- the content will be equal to <strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
- </p>
- <p>Note: the creation of the custom directory is influenced by the value
- of the <code>TMPDIR</code> variable.
- </p>
- <hr>
- <a name="Qi-exit-status"></a>
- <div class="header">
- <p>
- Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Examining-packages" accesskey="p" rel="prev">Examining packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Qi-exit-status-1"></a>
- <h2 class="chapter">9 Qi exit status</h2>
- <a name="index-exit-codes"></a>
- <p>All the exit codes are described in this chapter.
- </p>
- <dl compact="compact">
- <dt>‘<samp>0</samp>’</dt>
- <dd><p>Successful completion (no errors).
- </p>
- </dd>
- <dt>‘<samp>1</samp>’</dt>
- <dd><p>Minor common errors:
- </p>
- <ul>
- <li> Help usage on invalid options or required arguments.
- </li><li> Program needed by qi (prerequisite) is not available.
- </li></ul>
- </dd>
- <dt>‘<samp>2</samp>’</dt>
- <dd><p>Command execution error:
- </p>
- <p>This code is used to return the evaluation of an external command or shell
- arguments in case of failure.
- </p>
- </dd>
- <dt>‘<samp>3</samp>’</dt>
- <dd><p>Integrity check error for compressed files.
- </p>
- <p>Compressed files means:
- </p>
- <ul>
- <li> A tarball file from tar(1), typically handled by the GNU tar implementation.
- Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
- .tar.xz, .txz, .tar.zst, .tzst
- </li><li> A tarball file from tarlz(1).
- Supported extensions: .tar.lz, .tlz
- </li><li> Zip files from unzip(1).
- Supported extensions: .zip, .ZIP
- </li><li> Gzip files from gzip(1).
- Supported extensions: .gz, .Z
- </li><li> Bzip2 files from bzip2(1).
- Supported extension: .bz2
- </li><li> Lzip files from lzip(1).
- Supported extension: .lz
- </li><li> Xz files from xz(1).
- Supported extension: .xz
- </li><li> Zstd files from zstd(1).
- Supported extension: .zst
- </li></ul>
- </dd>
- <dt>‘<samp>4</samp>’</dt>
- <dd><p>File empty, not regular, or expected.
- </p>
- <p>It’s commonly expected:
- </p>
- <ul>
- <li> An argument for giving commands.
- </li><li> A regular file or readable directory.
- </li><li> An expected extension: .tlz, .sha256, .order.
- </li><li> A protocol supported by the network downloader tool.
- </li></ul>
- </dd>
- <dt>‘<samp>5</samp>’</dt>
- <dd><p>Empty or not defined variable:
- </p>
- <p>This code is used to report empty or undefined variables (usually
- variables coming from a recipe or assigned arrays that are tested).
- </p>
- </dd>
- <dt>‘<samp>6</samp>’</dt>
- <dd><p>Package already installed:
- </p>
- <p>The package directory for an incoming .tlz package already exists.
- </p>
- </dd>
- <dt>‘<samp>10</samp>’</dt>
- <dd><p>Network manager error:
- </p>
- <p>This code is used if the network downloader tool fails for some reason.
- </p></dd>
- </dl>
- <hr>
- <a name="Index"></a>
- <div class="header">
- <p>
- Previous: <a href="#Qi-exit-status" accesskey="p" rel="prev">Qi exit status</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <a name="Index-1"></a>
- <h2 class="unnumbered">Index</h2>
- <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
-
- </td></tr></table>
- <table class="index-cp" border="0">
- <tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-configuration-file">configuration file</a>:</td><td> </td><td valign="top"><a href="#The-qirc-file">The qirc file</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-environment-variables">environment variables</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-exit-codes">exit codes</a>:</td><td> </td><td valign="top"><a href="#Qi-exit-status">Qi exit status</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-handling-build-order">handling build order</a>:</td><td> </td><td valign="top"><a href="#Order-files">Order files</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-introduction-to-qi">introduction to qi</a>:</td><td> </td><td valign="top"><a href="#Introduction-to-Qi">Introduction to Qi</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-invocation">invocation</a>:</td><td> </td><td valign="top"><a href="#Invoking-qi">Invoking qi</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-managing-packages">managing packages</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-blacklist">package blacklist</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-build">package build</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-conflicts">package conflicts</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-creation">package creation</a>:</td><td> </td><td valign="top"><a href="#Creating-packages">Creating packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-de_002dinstallation">package de-installation</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-examination">package examination</a>:</td><td> </td><td valign="top"><a href="#Examining-packages">Examining packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-installation">package installation</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td></td><td valign="top"><a href="#index-package-upgrade">package upgrade</a>:</td><td> </td><td valign="top"><a href="#Packages">Packages</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-recipes">recipes</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-special-variables">special variables</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-the-meta-file">the meta file</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-variables">variables</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- <tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
- <tr><td></td><td valign="top"><a href="#index-writing-recipes">writing recipes</a>:</td><td> </td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
- <tr><td colspan="4"> <hr></td></tr>
- </table>
- <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
-
- <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
-
- </td></tr></table>
- <div class="footnote">
- <hr>
- <h4 class="footnotes-heading">Footnotes</h4>
- <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
- <p>For more details about tarlz and the
- lzip format, visit <a href="https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html</a>.</p>
- <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
- <p>The official guide for Graft can be found at
- <a href="https://peters.gormand.com.au/Home/tools/graft/graft.html">https://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
- <h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
- <p>About the ‘<samp>--bsolid</samp>’ granularity option of tarlz(1),
- <a href="https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid">https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid</a>.</p>
- <h3><a name="FOOT4" href="#DOCF4">(4)</a></h3>
- <p>The proposal for ‘<samp>license</samp>’ was made by Richard M. Stallman at
- <a href="https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>
- </div>
- <hr>
- </body>
- </html>
|