1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1">
6 <title>Qi user guide
</title>
8 <meta name=
"description" content=
"Qi user guide">
9 <meta name=
"keywords" content=
"Qi user guide">
10 <meta name=
"resource-type" content=
"document">
11 <meta name=
"distribution" content=
"global">
12 <meta name=
"Generator" content=
"makeinfo">
13 <link href=
"#Top" rel=
"start" title=
"Top">
14 <link href=
"#Index" rel=
"index" title=
"Index">
15 <link href=
"dir.html#Top" rel=
"up" title=
"(dir)">
16 <style type=
"text/css">
18 a
.summary-letter
{text-decoration: none
}
19 blockquote
.indentedblock
{margin-right: 0em}
20 blockquote
.smallindentedblock
{margin-right: 0em; font-size: smaller
}
21 blockquote
.smallquotation
{font-size: smaller
}
22 div
.display
{margin-left: 3.2em}
23 div
.example
{margin-left: 3.2em}
24 div
.lisp
{margin-left: 3.2em}
25 div
.smalldisplay
{margin-left: 3.2em}
26 div
.smallexample
{margin-left: 3.2em}
27 div
.smalllisp
{margin-left: 3.2em}
28 kbd
{font-style: oblique
}
29 pre
.display
{font-family: inherit
}
30 pre
.format
{font-family: inherit
}
31 pre
.menu-comment
{font-family: serif
}
32 pre
.menu-preformatted
{font-family: serif
}
33 pre
.smalldisplay
{font-family: inherit
; font-size: smaller
}
34 pre
.smallexample
{font-size: smaller
}
35 pre
.smallformat
{font-family: inherit
; font-size: smaller
}
36 pre
.smalllisp
{font-size: smaller
}
37 span
.nolinebreak
{white-space: nowrap
}
38 span
.roman
{font-family: initial
; font-weight: normal
}
39 span
.sansserif
{font-family: sans-serif
; font-weight: normal
}
40 ul
.no-bullet
{list-style: none
}
48 <h1 class=
"settitle" align=
"center">Qi user guide
</h1>
57 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>
59 <a name=
"SEC_Top"></a>
61 <p>This user guide is for Qi (version
2.8,
64 <table class=
"menu" border=
"0" cellspacing=
"0">
65 <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
67 <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
69 <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
71 <tr><td align=
"left" valign=
"top">• <a href=
"#Packages" accesskey=
"4">Packages
</a>:
</td><td> </td><td align=
"left" valign=
"top">Managing packages
73 <tr><td align=
"left" valign=
"top">• <a href=
"#Recipes" accesskey=
"5">Recipes
</a>:
</td><td> </td><td align=
"left" valign=
"top">Building packages
75 <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
77 <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
79 <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
81 <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
83 <tr><td align=
"left" valign=
"top">• <a href=
"#Index">Index
</a>:
</td><td> </td><td align=
"left" valign=
"top">
88 <p>Copyright
© 2019-
2022 Matias Andres Fonzo, Santiago del Estero,
91 <p>Permission is granted to copy, distribute and/or modify this document
92 under the terms of the GNU Free Documentation License, Version
1.3 or
93 any later version published by the Free Software Foundation; with no
94 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
98 <a name=
"Introduction-to-Qi"></a>
101 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>
103 <a name=
"Introduction-to-Qi-1"></a>
104 <h2 class=
"chapter">1 Introduction to Qi
</h2>
105 <a name=
"index-introduction-to-qi"></a>
107 <p>Qi is a simple but well-integrated package manager. It can create,
108 install, remove, and upgrade software packages. Qi produces binary
109 packages using recipes, which are files containing specific instructions
110 to build each package from source. Qi can manage multiple packages
111 under a single directory hierarchy. This method allows to maintain a set
112 of packages and multiple versions of them. This means that Qi could be
113 used as the main package manager or complement the existing one.
115 <p>Qi offers a friendly command line interface, a global configuration
116 file, a simple recipe layout to deploy software packages; also works
117 with binary packages in parallel, speeding up installations and packages
118 in production. The format used for packages is a simplified and safer
119 variant of POSIX pax archive compressed in lzip format.
121 <p>Qi is a modern (POSIX-compliant) shell script released under the
122 terms of the GNU General Public License. There are only two major
123 dependencies for the magic: graft(
1) and tarlz(
1), the rest is expected
124 to be found in any Unix-like system.
127 <a name=
"Invoking-qi"></a>
130 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>
132 <a name=
"Invoking-qi-1"></a>
133 <h2 class=
"chapter">2 Invoking qi
</h2>
134 <a name=
"index-invocation"></a>
136 <p>This chapter describes the synopsis for invoking Qi.
138 <div class=
"example">
139 <pre class=
"example">Usage: qi COMMAND [
<var>OPTION
</var>...] [
<var>FILE
</var>]...
142 <p>One mandatory command specifies the operation that
‘<samp>qi
</samp>’ should
143 perform, options are meant to detail how this operation should be
144 performed during or after the process.
146 <p>Qi supports the following commands:
148 <dl compact=
"compact">
149 <dt><code>warn
</code></dt>
150 <dd><p>Warn about files that will be installed.
153 <dt><code>install
</code></dt>
154 <dd><p>Install packages.
157 <dt><code>remove
</code></dt>
158 <dd><p>Remove packages.
161 <dt><code>upgrade
</code></dt>
162 <dd><p>Upgrade packages.
165 <dt><code>extract
</code></dt>
166 <dd><p>Extract packages for debugging purposes.
169 <dt><code>create
</code></dt>
170 <dd><p>Create a .tlz package from directory.
173 <dt><code>build
</code></dt>
174 <dd><p>Build packages using recipe names.
177 <dt><code>order
</code></dt>
178 <dd><p>Resolve build order through .order files
182 <p>Options when installing, removing, or upgrading software packages:
184 <dl compact=
"compact">
185 <dt><code>-f
</code></dt>
186 <dt><code>--force
</code></dt>
187 <dd><p>Force upgrade of pre-existing packages.
190 <dt><code>-k
</code></dt>
191 <dt><code>--keep
</code></dt>
192 <dd><p>Keep directories when build/remove/upgrade.
194 <p>Keep (don
’t delete) the package directory when using remove/upgrade command.
196 <p>This will also try to preserve the directories
‘<samp>${srcdir}
</samp>’ and
197 ‘<samp>${destdir}
</samp>’ when using build command. Its effect is available in
198 recipes as
‘<samp>${keep_srcdir}
</samp>’ and
‘<samp>${keep_destdir}
</samp>’. See
199 <a href=
"#Recipes">Special variables
</a> for details.
202 <dt><code>-p
</code></dt>
203 <dt><code>--prune
</code></dt>
204 <dd><p>Prune conflicts.
207 <dt><code>-P
</code></dt>
208 <dt><code>--packagedir=
<dir
></code></dt>
209 <dd><p>Set directory for package installations.
212 <dt><code>-t
</code></dt>
213 <dt><code>--targetdir=
<dir
></code></dt>
214 <dd><p>Set target directory for symbolic links.
217 <dt><code>-r
</code></dt>
218 <dt><code>--rootdir=
<dir
></code></dt>
219 <dd><p>Use the fully qualified named directory as the root directory for all qi
222 <p>Note: the target directory and the package directory will be
223 relative to the specified directory, excepting the graft log file.
227 <p>Options when building software packages using recipes:
229 <dl compact=
"compact">
230 <dt><code>-a
</code></dt>
231 <dt><code>--architecture
</code></dt>
232 <dd><p>Set architecture name for the package.
235 <dt><code>-j
</code></dt>
236 <dt><code>--jobs
</code></dt>
237 <dd><p>Parallel jobs for the compiler.
239 <p>This option sets the variable
‘<samp>${jobs}
</samp>’. If not specified, default
243 <dt><code>-S
</code></dt>
244 <dt><code>--skip-questions
</code></dt>
245 <dd><p>Skip questions on completed recipes.
248 <dt><code>-
1</code></dt>
249 <dt><code>--increment
</code></dt>
250 <dd><p>Increment release number (
‘<samp>${release}
</samp>’ +
1).
252 <p>The effect of this option will be omitted if
–no-package is being used.
255 <dt><code>-n
</code></dt>
256 <dt><code>--no-package
</code></dt>
257 <dd><p>Do not create a .tlz package.
260 <dt><code>-i
</code></dt>
261 <dt><code>--install
</code></dt>
262 <dd><p>Install package after the build.
265 <dt><code>-u
</code></dt>
266 <dt><code>--upgrade
</code></dt>
267 <dd><p>Upgrade package after the build.
270 <dt><code>-o
</code></dt>
271 <dt><code>--outdir=
<dir
></code></dt>
272 <dd><p>Where the packages produced will be written.
274 <p>This option sets the variable
‘<samp>${outdir}
</samp>’.
277 <dt><code>-w
</code></dt>
278 <dt><code>--worktree=
<dir
></code></dt>
279 <dd><p>Where archives, patches, recipes are expected.
281 <p>This option sets the variable
‘<samp>${worktree}
</samp>’.
284 <dt><code>-s
</code></dt>
285 <dt><code>--sourcedir=
<dir
></code></dt>
286 <dd><p>Where compressed sources will be found.
288 <p>This option sets the variable
‘<samp>${tardir}
</samp>’.
294 <dl compact=
"compact">
295 <dt><code>-v
</code></dt>
296 <dt><code>--verbose
</code></dt>
297 <dd><p>Be verbose (an extra -v gives more).
299 <p>It sets the verbosity level, default sets to
0.
301 <p>The value
1 is used for more verbosity while the value
2 is too detailed.
302 Although at the moment it is limited to graft(
1) verbosity.
305 <dt><code>-N
</code></dt>
306 <dt><code>--no-rc
</code></dt>
307 <dd><p>Do not read the configuration file.
309 <p>This will ignore reading the qirc file.
312 <dt><code>-L
</code></dt>
313 <dt><code>--show-location
</code></dt>
314 <dd><p>Print default directory locations and exit.
316 <p>This will print the target directory, package directory, working tree,
317 the directory for sources, and the output directory for the packages
321 <dt><code>-h
</code></dt>
322 <dt><code>--help
</code></dt>
323 <dd><p>Display the usage and exit.
326 <dt><code>-V
</code></dt>
327 <dt><code>--version
</code></dt>
329 <p>This will print the (short) version information and then exit.
331 <p>The same can be achieved if Qi is invoked as
‘<samp>qi version
</samp>’.
335 <p>When FILE is -, qi can read from the standard input. See examples from
336 the
<a href=
"#Packages">Packages
</a> section.
338 <p>Exit status:
0 for a normal exit,
1 for minor common errors (help usage,
339 support not available, etc),
2 to indicate a command execution error;
340 3 for integrity check error on compressed files,
4 for empty, not
341 regular, or expected files,
5 for empty or not defined variables,
342 6 when a package already exist,
10 for network manager errors.
343 For more details, see the
<a href=
"#Qi-exit-status">Qi exit status
</a> section.
347 <a name=
"The-qirc-file"></a>
350 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>
352 <a name=
"The-qirc-file-1"></a>
353 <h2 class=
"chapter">3 The qirc file
</h2>
354 <a name=
"index-configuration-file"></a>
356 <p>The global
<samp>qirc
</samp> file offers a way to define variables and tools
357 (such as a download manager) for default use. This file is used by qi
358 at runtime, e.g., to build, install, remove or upgrade packages.
360 <p>Variables and their possible values must be declared as any other
361 variable in the shell.
363 <p>The command line options related to the package directory and target
364 directory and some of the command line options used for the build command,
365 have the power to override the values declared on
<samp>qirc
</samp>.
366 See
<a href=
"#Invoking-qi">Invoking qi
</a>.
368 <p>The order in which qi looks for this file is:
371 <li> <code>${HOME}/.qirc
</code>
374 </li><li> ‘<samp>${sysconfdir}/qirc
</samp>’
378 <p>If you intend to run qi as effective user, the file
379 ‘<samp>${sysconfdir}/qirc
</samp>’ could be copied to
<code>${HOME}/.qirc
</code>
380 setting the paths for
‘<samp>${packagedir}
</samp>’ and
‘<samp>${targetdir}
</samp>’
381 according to the
<code>$HOME
</code>.
385 <a name=
"Packages"></a>
388 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>
390 <a name=
"Packages-1"></a>
391 <h2 class=
"chapter">4 Packages
</h2>
392 <a name=
"index-managing-packages"></a>
394 <p>A package is a suite of programs usually distributed in binary form
395 which may also contain manual pages, documentation, or any other file
396 associated to a specific software.
398 <p>The package format used by qi is a simplified POSIX pax archive
399 compressed using lzip
<a name=
"DOCF1" href=
"#FOOT1"><sup>1</sup></a>. The
400 file extension for packages ends in
‘<samp>.tlz
</samp>’.
402 <p>Both package installation and package de-installation are managed using
403 two important (internal) variables:
‘<samp>${packagedir}
</samp>’ and
404 ‘<samp>${targetdir}
</samp>’, these values can be changed in the
405 configuration file or via options.
407 <p>‘<samp>${packagedir}
</samp>’ is a common directory tree where the package
408 contents will be decompressed (will reside).
410 <p>‘<samp>${targetdir}
</samp>’ is a target directory where the links will be
411 made by graft(
1) taking
‘<samp>${packagedir}/package_name
</samp>’ into account.
413 <p>Packages are installed in self-contained directory trees and symbolic
414 links from a common area are made to the package files. This allows
415 multiple versions of the same package to coexist on the same system.
417 <a name=
"Package-conflicts"></a>
418 <h3 class=
"section">4.1 Package conflicts
</h3>
419 <a name=
"index-package-conflicts"></a>
421 <p>All the links to install or remove a package are handled by graft(
1).
422 Since multiple packages can be installed or removed at the same time,
423 certain conflicts may arise between the packages.
425 <p>graft
<a name=
"DOCF2" href=
"#FOOT2"><sup>2</sup></a>
426 defines a CONFLICT as one of the following conditions:
429 <li> If the package object is a directory and the target object exists but is
432 </li><li> If the package object is not a directory and the target object exists
433 and is not a symbolic link.
435 </li><li> If the package object is not a directory and the target object exists
436 and is a symbolic link to something other than the package object.
439 <p>The default behavior of qi for an incoming package is to ABORT if a
440 conflict arises. When a package is going to be deleted, qi tells to
441 graft(
1) to remove those parts that are not in conflict, leaving the
442 links to the belonging package. This behavior can be forced if the
443 –prune option is given.
445 <a name=
"Installing-packages"></a>
446 <h3 class=
"section">4.2 Installing packages
</h3>
447 <a name=
"index-package-installation"></a>
449 <p>To install a single package, simply type:
451 <div class=
"example">
452 <pre class=
"example">qi install coreutils_8.30_i586-
1@tools.tlz
455 <p>To install multiple packages at once, type:
457 <div class=
"example">
458 <pre class=
"example">qi install gcc_8.3
.0_i586-
1@devel.tlz rafaela_2.2_i586-
1@legacy.tlz ...
461 <p>Warn about the files that will be linked:
463 <div class=
"example">
464 <pre class=
"example">qi warn bash_5.0_i586-
1@shells.tlz
467 <p>This is to verify the content of a package before installing it.
469 <p>See the process of an installation:
471 <div class=
"example">
472 <pre class=
"example">qi install --verbose mariana_3.0_i586-
1@woman.tlz
475 <p>A second
–verbose or -v option gives more (very verbose).
477 <p>Installing package in a different location:
479 <div class=
"example">
480 <pre class=
"example">qi install --rootdir=/media/floppy lzip_1.21_i586-
1@compressors.tlz
483 <p>Important: the
–rootdir option assumes
‘<samp>${targetdir}
</samp>’ and
484 ‘<samp>${packagedir}
</samp>’. See the following example:
486 <div class=
"example">
487 <pre class=
"example">qi install --rootdir=/home/selk lzip_1.21_i586-
1@compressors.tlz
490 <p>The content of
"lzip_1.21_i586-
1@compressors.tlz
" will be decompressed
491 into
‘<samp>/home/selk/pkgs/lzip_1.21_i586-
1@compressors
</samp>’.
492 Assuming that the main binary for lzip is under
493 ‘<samp>/home/selk/pkgs/lzip_1.21_i586-
1@compressors/usr/bin/
</samp>’
494 the target for
"usr/bin
" will be created at
‘<samp>/home/selk
</samp>’. Considering
495 that you have exported the
<code>PATH
</code> as
‘<samp>${HOME}/usr/bin
</samp>’, now the
496 system is able to see the recent lzip command.
498 <p>Installing from a list of packages using standard input:
500 <div class=
"example">
501 <pre class=
"example">qi install -
< PACKAGELIST.txt
504 <p>Or in combination with another tool:
505 </p><div class=
"example">
506 <pre class=
"example">sort -u PACKAGELIST.txt | qi install -
509 <p>The sort command will read and sorts the list of declared packages,
510 while trying to have unique entries for each statement. The output
511 produced is captured by Qi to install each package.
513 <p>An example of a list containing package names is:
514 </p><div class=
"example">
515 <pre class=
"example">/var/cache/qi/packages/amd64/tcl_8.6
.9_amd64-
1@devel.tlz
516 /var/cache/qi/packages/amd64/tk_8.6
.9.1_amd64-
1@devel.tlz
517 /var/cache/qi/packages/amd64/vala_0.42
.3_amd64-
1@devel.tlz
520 <a name=
"Removing-packages"></a>
521 <h3 class=
"section">4.3 Removing packages
</h3>
522 <a name=
"index-package-de_002dinstallation"></a>
524 <p>To remove a package, simply type:
526 <div class=
"example">
527 <pre class=
"example">qi remove xz_5.2
.4_i586-
1@compressors.tlz
530 <p>Remove command will match the package name using
‘<samp>${packagedir}
</samp>’ as
531 prefix. For example, if the value of
‘<samp>${packagedir}
</samp>’ has been
532 set to /usr/pkg, this will be equal to:
534 <div class=
"example">
535 <pre class=
"example">qi remove /usr/pkg/xz_5.2
.4_i586-
1@compressors
540 <div class=
"example">
541 <pre class=
"example">qi remove --verbose /usr/pkg/xz_5.2
.4_i586-
1@compressors
544 <p>A second
–verbose or -v option gives more (very verbose).
546 <p>By default the remove command does not preserve a package directory after
547 removing its links from
‘<samp>${targetdir}
</samp>’, but this behavior can be
548 changed if the
–keep option is passed:
550 <div class=
"example">
551 <pre class=
"example">qi remove --keep /usr/pkg/lzip_1.21_i586-
1@compressors
554 <p>This means that the links to the package can be reactivated, later:
556 <div class=
"example">
557 <pre class=
"example">cd /usr/pkg
&& graft -i lzip_1.21_i586-
1@compressors
560 <p>Removing package from a different location:
562 <div class=
"example">
563 <pre class=
"example">qi remove --rootdir=/home/cthulhu xz_5.2
.4_i586-
1@compressors
566 <p>Removing a package using standard input:
568 <div class=
"example">
569 <pre class=
"example">echo vala_0.42
.3_amd64-
1@devel | qi remove -
572 <p>This will match with the package directory.
574 <a name=
"Upgrading-packages"></a>
575 <h3 class=
"section">4.4 Upgrading packages
</h3>
576 <a name=
"index-package-upgrade"></a>
578 <p>The upgrade command inherits the properties of the installation and removal
579 process. To make sure that a package is updated, the package is installed
580 in a temporary directory taking
‘<samp>${packagedir}
</samp>’ into account. Once
581 the incoming package is pre-installed, qi can proceed to search and delete
582 packages that have the same name (considered as previous ones). Finally,
583 the package is re-installed at its final location and the temporary
584 directory is removed.
586 <p>Since updating a package can be crucial and so to perform a successful
587 upgrade, from start to finish, you will want to ignore some important
588 system signals during the upgrade process, those signals are SIGHUP,
589 SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
591 <p>To upgrade a package, just type:
593 <div class=
"example">
594 <pre class=
"example">qi upgrade gcc_9.0
.1_i586-
1@devel.tlz
597 <p>This will proceed to upgrade
"gcc_9.0
.1_i586-
1@devel
" removing any other
598 version of
"gcc
" (if any).
600 <p>If you want to keep the package directories of versions found during the
601 upgrade process, just pass:
603 <div class=
"example">
604 <pre class=
"example">qi upgrade --keep gcc_9.0
.1_i586-
1@devel.tlz
607 <p>To see the upgrade process:
609 <div class=
"example">
610 <pre class=
"example">qi upgrade --verbose gcc_9.0
.1_i586-
1@devel.tlz
613 <p>A second
–verbose or -v option gives more (very verbose).
615 <p>To force the upgrade of an existing package:
617 <div class=
"example">
618 <pre class=
"example">qi upgrade --force gcc_9.0
.1_i586-
1@devel.tlz
621 <a name=
"Package-blacklist"></a>
622 <h4 class=
"subsection">4.4.1 Package blacklist
</h4>
623 <a name=
"index-package-blacklist"></a>
625 <p>To implement general package facilities, either to install, remove or
626 maintain the hierarchy of packages in a clean manner, qi makes use of the
627 pruning operation via graft(
1) by default:
629 <p>There is a risk if those are crucial packages for the proper functioning
630 of the system, because it implies the deactivation of symbolic from the
631 target directory,
<em>especially
</em> when transitioning an incoming package
632 into its final location during an upgrade.
634 <p>A blacklist of package names has been devised for the case where
635 a user decides to upgrade all the packages in the system, or
636 just the crucial ones, such as the C library.
638 <p>The blacklist is related to the upgrade command only, consists in installing
639 a package instead of updating it or removing previous versions of it;
640 the content of the package will be updated over the existing content at
641 ‘<samp>${packagedir}
</samp>’, while the existing links from
642 ‘<samp>${targetdir}
</samp>’ will be preserved. A pruning of links will be
643 carried out in order to re-link possible differences with the recent
644 content, this helps to avoid leaving dead links in the target directory.
646 <p>Package names for the blacklist to be declared must be set from the
647 configuration file. By default, it is declared using the package name,
648 which is more than enough for critical system packages, but if you want to
649 be more specific, you can declare a package using:
650 ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}
</samp>’ where
651 the package category is avoided for common matching. See
652 <a href=
"#Recipes">Special variables
</a> for a description of these variables.
655 <a name=
"Recipes"></a>
658 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>
660 <a name=
"Recipes-1"></a>
661 <h2 class=
"chapter">5 Recipes
</h2>
662 <a name=
"index-recipes"></a>
664 <p>A recipe is a file telling qi what to do. Most often, the recipe tells
665 qi how to build a binary package from a source tarball.
667 <p>A recipe has two parts: a list of variable definitions and a list of
668 sections. By convention, the syntax of a section is:
670 <div class=
"example">
671 <pre class=
"example">section_name()
677 <p>The section name is followed by parentheses, one newline and an opening
678 brace. The line finishing the section contains just a closing brace.
679 The section names or the function names currently recognized are
680 ‘<samp>build
</samp>’.
682 <p>The
‘<samp>build
</samp>’ section (or
<strong>shell function
</strong>) is an augmented
683 shell script that contains the main instructions to build software
686 <p>If there are other functions defined by the packager, Qi detects them
689 <a name=
"Variables"></a>
690 <h3 class=
"section">5.1 Variables
</h3>
691 <a name=
"index-variables"></a>
693 <p>A
"variable
" is a
<strong>shell variable
</strong> defined either in
<samp>qirc
</samp>
694 or in a recipe to represent a string of text, called the variable
’s
695 "value
". These values are substituted by explicit request in the
696 definitions of other variables or in calls to external commands.
698 <p>Variables can represent lists of file names, options to pass to
699 compilers, programs to run, directories to look in for source files,
700 directories to write output to, or anything else you can imagine.
702 <p>Definitions of variables in qi have four levels of precedence.
703 Options which define variables from the command-line override those
704 specified in the
<samp>qirc
</samp> file, while variables defined in the recipe
705 override those specified in
<samp>qirc
</samp>, taking priority over those
706 variables set by command-line options. Finally, the variables have
707 default values if they are not defined anywhere.
709 <p>Options that set variables through the command-line can only reference
710 variables defined in
<samp>qirc
</samp> and variables with default values.
712 <p>Definitions of variables in
<samp>qirc
</samp> can only reference variables
713 previously defined in
<samp>qirc
</samp> and variables with default values.
715 <p>Definitions of variables in the recipe can only reference variables
716 set by the command-line, variables previously defined in the recipe,
717 variables defined in
<samp>qirc
</samp>, and variables with default values.
719 <a name=
"Special-variables"></a>
720 <h3 class=
"section">5.2 Special variables
</h3>
721 <a name=
"index-special-variables"></a>
723 <p>There are variables which can only be set using the command line options or
724 via
<samp>qirc
</samp>, there are other special variables which can be defined or
725 redefined in a recipe. See the following definitions:
727 <p>‘<samp>outdir
</samp>’ is the directory where the packages produced are written.
728 This variable can be redefined per-recipe. Default sets to
729 ‘<samp>/var/cache/qi/packages
</samp>’.
731 <p>‘<samp>worktree
</samp>’ is the working tree where archives, patches, and recipes
732 are expected. This variable can not be redefined in the recipe. Default
733 sets to
‘<samp>/usr/src/qi
</samp>’.
735 <p>‘<samp>tardir
</samp>’ is defined in the recipe to the directory where the tarball
736 containing the source can be found. The full name of the tarball is
737 composed as
‘<samp>${tardir}/$tarname
</samp>’. Its value is available in the
738 recipe as
‘<samp>${tardir}
</samp>’; a value of . for
‘<samp>tardir
</samp>’ sets it to
739 the value of CWD (Current Working Directory), this is where the recipe
742 <p>‘<samp>arch
</samp>’ is the architecture to compose the package name. Its value is
743 available in the recipe as
‘<samp>${arch}
</samp>’. Default value is the one
744 that was set in the Qi configuration.
746 <p>‘<samp>jobs
</samp>’ is the number of parallel jobs to pass to the compiler. Its
747 value is available in the recipe as
‘<samp>${jobs}
</samp>’. The default value
750 <p>The two variables
‘<samp>${srcdir}
</samp>’ and
‘<samp>${destdir}
</samp>’ can be
751 set in the recipe, as any other variable, but if they are not, qi uses
752 default values for them when building a package.
754 <p>‘<samp>srcdir
</samp>’ contains the source code to be compiled, and defaults to
755 ‘<samp>${program}-${version}
</samp>’.
‘<samp>destdir
</samp>’ is the place where the
756 built package will be installed, and defaults to
757 ‘<samp>${TMPDIR}/package-${program}
</samp>’.
759 <p>If
‘<samp>pkgname
</samp>’ is left undefined, the special variable
‘<samp>program
</samp>’
760 is assigned by default. If
‘<samp>pkgversion
</samp>’ is left undefined, the
761 special variable
‘<samp>version
</samp>’ is assigned by default.
763 <p>‘<samp>pkgname
</samp>’ and
‘<samp>pkgversion
</samp>’ along with:
‘<samp>version
</samp>’,
‘<samp>arch
</samp>’,
764 ‘<samp>release
</samp>’, and (optionally)
‘<samp>pkgcategory
</samp>’ are used to produce the
765 package name in the form:
766 ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz
</samp>’
768 <p>‘<samp>pkgcategory
</samp>’ is an optional special variable that can be defined on the
769 recipe to categorize the package name. If it is defined, then the
770 package output will be composed as
771 ‘<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz
</samp>’.
772 Automatically, the value of
‘<samp>pkgcategory
</samp>’ will be prefixed using the
773 ‘<samp>@
</samp>’ (at) symbol which will be added to the last part of the package name.
775 <p>A special variable called
‘<samp>replace
</samp>’ can be used to declare package names
776 that will be replaced at installation time.
778 <p>The special variables
‘<samp>keep_srcdir
</samp>’ and
‘<samp>keep_destdir
</samp>’ are provided
779 in order to preserve the directories
‘<samp>${srcdir}
</samp>’ or
‘<samp>${destdir}
</samp>’,
780 if those exists as such. Note: The declaration of these variables are subject
781 to manual deactivation; its purpose in recipes is to preserve the directories
782 that relate to the package
’s build (source) and destination directory, that is
783 so that another recipe can get a new package (or meta package) from there. For
784 example, the declarations can be done as:
786 <div class=
"example">
787 <pre class=
"example">keep_srcdir=keep_srcdir
788 keep_destdir=keep_destdir
791 <p>Then from another recipe you would proceed to copy the necessary files that
792 will compose the meta package, from the main function you must deactivate
793 the variables at the end:
795 <div class=
"example">
796 <pre class=
"example">unset -v keep_srcdir keep_destdir
799 <p>This will leave the
’keep_srcdir
’ and
’keep_destdir
’ variables blank to
800 continue with the rest of the recipes.
802 <p>A typical recipe contains the following variables:
805 <li> ‘<samp>program
</samp>’: Software name.
807 <p>It matches the source name. It is also used to compose the name of the
808 package if
‘<samp>${pkgname}
</samp>’ is not specified.
810 </li><li> ‘<samp>version
</samp>’: Software version.
812 <p>It matches the source name. It is also used to compose the version of the
813 package if
‘<samp>${pkgversion}
</samp>’ is not specified.
815 </li><li> ‘<samp>arch
</samp>’: Software architecture.
817 <p>It is used to compose the architecture of the package in which it is
820 </li><li> ‘<samp>release
</samp>’: Release number.
822 <p>This is used to reflect the release number of the package. It is
823 recommended to increase this number after any significant change in
824 the recipe or post-install script.
826 </li><li> ‘<samp>pkgcategory
</samp>’: Package category.
828 <p>Optional but recommended variable to categorize the package name when it is
832 <p>Obtaining sources over the network must be declared in the recipe using
833 the
‘<samp>fetch
</samp>’ variable.
835 <p>The variables
‘<samp>netget
</samp>’ and
‘<samp>rsync
</samp>’ can be defined in
<samp>qirc
</samp>
836 to establish a network downloader in order to get the sources. If they
837 are not defined, qi uses default values:
839 <p>‘<samp>netget
</samp>’ is the general network downloader tool, defaults sets to
840 ‘<samp>wget2 -c -w1 -t3 --no-check-certificate
</samp>’.
842 <p>‘<samp>rsync
</samp>’ is the network tool for sources containing the prefix for
843 the RSYNC protocol, default sets to
844 ‘<samp>rsync -v -a -L -z -i --progress
</samp>’.
846 <p>The variable
‘<samp>description
</samp>’ is used to print the package description
847 when a package is installed.
849 <p>A description has two parts: a brief description, and a long description.
850 By convention, the syntax of
‘<samp>description
</samp>’ is:
852 <div class=
"example">
853 <pre class=
"example">description=
"
860 <p>The first line of the value represented is a brief description of the
861 software (called
"blurb
"). A blank line separates the
<em>brief
862 description
</em> from the
<em>long description
</em>, which should contain a more
863 descriptive description of the software.
865 <p>An example looks like:
867 <div class=
"example">
868 <pre class=
"example">description=
"
869 The GNU core utilities.
871 The GNU core utilities are the basic file, shell and text manipulation
872 utilities of the GNU operating system. These are the core utilities
873 which are expected to exist on every operating system.
877 <p>Please consider a length limit of
78 characters as maximum, because the same
878 one would be used on the meta file creation. See
879 <a href=
"#Recipes">The meta file
</a> section.
881 <p>The
‘<samp>homepage
</samp>’ variable is used to declare the main site or home page:
883 <div class=
"example">
884 <pre class=
"example">homepage=https://www.gnu.org/software/gcc
887 <p>The variable
‘<samp>license
</samp>’ is used for license information
<a name=
"DOCF3" href=
"#FOOT3"><sup>3</sup></a>.
888 Some code in the program can be covered by license A, license B, or
889 license C. For
"separate licensing
" or
"heterogeneous licensing
", we
890 suggest using
<strong>|
</strong> for a disjunction,
<strong>&</strong> for a conjunction
891 (if that ever happens in a significant way), and comma for heterogeneous
892 licensing. Comma would have lower precedence, plus added special terms.
894 <div class=
"example">
895 <pre class=
"example">license=
"LGPL, GPL | Artistic - added permission
"
898 <a name=
"Writing-recipes"></a>
899 <h3 class=
"section">5.3 Writing recipes
</h3>
900 <a name=
"index-writing-recipes"></a>
902 <p>Originally, Qi was designed for the series of Dragora GNU/Linux-Libre
3;
903 this doesn
’t mean you can
’t use it in another distribution, just that if
904 you do, you
’ll have to try it out for yourself. To help with this, here
905 are some references to well-written recipes:
908 <li> <a href=
"https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes
</a>
909 </li><li> <a href=
"https://notabug.org/dragora/dragora/src/master/recipes">https://notabug.org/dragora/dragora/src/master/recipes
</a>
910 </li><li> <a href=
"https://notabug.org/dragora/dragora-extras/src/master/recipes">https://notabug.org/dragora/dragora-extras/src/master/recipes
</a>
911 </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>
914 <a name=
"Building-packages"></a>
915 <h3 class=
"section">5.4 Building packages
</h3>
916 <a name=
"index-package-build"></a>
918 <p>A recipe is any valid regular file. Qi sets priorities for reading a
919 recipe, the order in which qi looks for a recipe is:
922 <li> Current working directory.
924 </li><li> If the specified path name does not contain
"recipe
" as the last
925 component. Qi will complete it by adding
"recipe
" to the path name.
927 </li><li> If the recipe is not in the current working directory, it will be
928 searched under
‘<samp>${worktree}/recipes
</samp>’. The last component will be
929 completed adding
"recipe
" to the specified path name.
932 <p>To build a single package, type:
934 <div class=
"example">
935 <pre class=
"example">qi build x-apps/xterm
938 <p>Multiple jobs can be passed to the compiler to speed up the build process:
940 <div class=
"example">
941 <pre class=
"example">qi build --jobs
3 x-apps/xterm
944 <p>Update or install the produced package (if not already installed) when the
947 <div class=
"example">
948 <pre class=
"example">qi build -j3 --upgrade x-apps/xterm
951 <p>Only process a recipe but do not create the binary package:
953 <div class=
"example">
954 <pre class=
"example">qi build --no-package dict/aspell
957 <p>The options
–install or
–upgrade have no effect when
–no-package
960 <p>This is useful to inspect the build process of the above recipe:
962 <p>qi build
–keep
–no-package dict/aspell
2>&1 | tee aspell-log.txt
964 <p>The
–keep option could preserve the source directory and the destination
965 directory for later inspection. A log file of the build process will be
966 created redirecting both, standard error and standard output to tee(
1).
968 <a name=
"Variables-from-the-environment"></a>
969 <h3 class=
"section">5.5 Variables from the environment
</h3>
970 <a name=
"index-environment-variables"></a>
972 <p>Qi has environment variables which can be used at build time:
974 <p>The variable
<code>TMPDIR
</code> sets the temporary directory for sources, which is
975 used for package extractions (see
<a href=
"#Examining-packages">Examining packages
</a>) and is
976 prepended to the value of
‘<samp>${srcdir}
</samp>’ and
‘<samp>${destdir}
</samp>’ in
977 build command. By convention its default value is equal to
978 ‘<samp>/usr/src/qi/build
</samp>’.
980 <p>The variables
<code>QICFLAGS
</code>,
<code>QICXXFLAGS
</code>,
<code>QILDFLAGS
</code>, and
981 <code>QICPPFLAGS
</code> have no effect by default. The environment variables
982 such as
<code>CFLAGS
</code>,
<code>CXXFLAGS
</code>,
<code>LDFLAGS
</code>, and
<code>CPPFLAGS
</code>
983 are unset at compile time:
985 <p>Recommended practice is to set variables in the command line of
986 ‘<samp>configure
</samp>’ or
<em>make(
1)
</em> instead of exporting to the
987 environment. As follows:
989 <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>
991 <p>It is not wise for makefiles to depend for their functioning on environment
992 variables set up outside their control, since this would cause different
993 users to get different results from the same makefile. This is against the
994 whole purpose of most makefiles.
997 <p>Setting environment variables for configure is deprecated because running
998 configure in varying environments can be dangerous.
1000 <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>
1002 <p>Variables not defined in a site shell script can be set in the environment
1003 passed to configure. However, some packages may run configure again
1004 during the build, and the customized values of these variables may be
1005 lost. In order to avoid this problem, you should set them in the
1006 configure command line, using
‘<samp>VAR=value
</samp>’. For example:
1008 <p><code>./configure CC=/usr/local2/bin/gcc
</code>
1011 <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>
1013 <p>If for instance the user runs
‘<samp>CC=bizarre-cc ./configure
</samp>’, then the cache,
1014 config.h, and many other output files depend upon bizarre-cc being the C
1015 compiler. If for some reason the user runs ./configure again, or if it is
1016 run via
‘<samp>./config.status --recheck
</samp>’, (See Automatic Remaking, and see
1017 config.status Invocation), then the configuration can be inconsistent,
1018 composed of results depending upon two different compilers.
1020 Indeed, while configure can notice the definition of CC in
‘<samp>./configure
1021 CC=bizarre-cc
</samp>’, it is impossible to notice it in
‘<samp>CC=bizarre-cc
1022 ./configure
</samp>’, which, unfortunately, is what most users do.
1024 configure: error: changes in the environment can compromise the build.
1027 <p>If the
<code>SOURCE_DATE_EPOCH
</code> environment variable is set to a UNIX timestamp
1028 (defined as the number of seconds, excluding leap seconds, since
01 Jan
1970
1029 00:
00:
00 UTC.); then the given timestamp will be used to overwrite any newer
1030 timestamps on the package contents (when it is created). More information
1031 about this can be found at
1032 <a href=
"https://reproducible-builds.org/specs/source-date-epoch/">https://reproducible-builds.org/specs/source-date-epoch/
</a>.
1034 <a name=
"The-meta-file"></a>
1035 <h3 class=
"section">5.6 The meta file
</h3>
1036 <a name=
"index-the-meta-file"></a>
1038 <p>The
"meta file
" is a regular file created during the build process, it
1039 contains information about the package such as package name, package
1040 version, architecture, release, fetch address, description, and other
1041 minor data extracted from processed recipes. The name of the file is
1042 generated as
‘<samp>${full_pkgname}.tlz.txt
</samp>’, and its purpose is to
1043 reflect essential information to the user without having to look inside
1044 the package content. The file format is also intended to be used by
1045 other scripts or by common Unix tools.
1047 <p>The content of a meta file looks like:
1049 <div class=
"example">
1050 <pre class=
"example">#
1051 # Pattern scanning and processing language.
1053 # The awk utility interprets a special-purpose programming language
1054 # that makes it possible to handle simple data-reformatting jobs
1055 # with just a few lines of code. It is a free version of 'awk'.
1057 # GNU awk implements the AWK utility which is part of
1058 # IEEE Std
1003.1 Shell and Utilities (XCU).
1061 QICFLAGS=
"-O2
"
1062 QICXXFLAGS=
"-O2
"
1063 QILDFLAGS=
""
1064 QICPPFLAGS=
""
1069 pkgcategory=
"tools
"
1070 full_pkgname=gawk_5.0
.1_amd64-
1@tools
1071 blurb=
"Pattern scanning and processing language.
"
1072 homepage=
"https://www.gnu.org/software/gawk
"
1073 license=
"GPLv3+
"
1074 fetch=
"https://ftp.gnu.org/gnu/gawk/gawk-
5.0.1.tar.lz
"
1075 replace=
""
1078 <p>A package descriptions is extracted from the variable
‘<samp>description
</samp>’
1079 where each line is interpreted literally and pre-formatted to fit in
1080 (exactly)
<strong>80 columns
</strong>, plus the character
‘<samp>#
</samp>’ and a blank
1081 space is prefixed to every line (shell comments).
1083 <p>In addition to the Special variables, there are implicit variables such as
1084 ‘<samp>blurb
</samp>’:
1086 <p>The
‘<samp>blurb
</samp>’ variable is related to the special variable
1087 ‘<samp>description
</samp>’. Its value is made from the first (substantial)
1088 line of
‘<samp>description
</samp>’, mentioned as the
"brief description
".
1090 <p>The build flags such as
‘<samp>QICFLAGS
</samp>’,
‘<samp>QICXXFLAGS
</samp>’,
1091 ‘<samp>QILDFLAGS
</samp>’, and
‘<samp>QICPPFLAGS
</samp>’ are only added to the meta file
1092 if the declared variable
‘<samp>arch
</samp>’ is not equal to the
"noarch
" value.
1095 <a name=
"Order-files"></a>
1096 <div class=
"header">
1098 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>
1100 <a name=
"Order-files-1"></a>
1101 <h2 class=
"chapter">6 Order files
</h2>
1102 <a name=
"index-handling-build-order"></a>
1104 <p>The order command has the purpose of resolving the build order through
1105 .order files. An order file contains a list of recipe names, by default
1106 does not perform any action other than to print a resolved list in
1107 descending order. For example, if
<strong>a
</strong> depends on
<strong>b
</strong> and
1108 <strong>c
</strong>, and
<strong>c
</strong> depends on
<strong>b
</strong> as well, the file might
1111 <div class=
"example">
1112 <pre class=
"example">a: c b
1117 <p>Each letter represents a recipe name, complete dependencies for
1118 the first recipe name are listed in descending order, which is
1119 printed from right to left, and removed from left to right:
1121 <p><small>OUTPUT
</small>
1123 <div class=
"example">
1124 <pre class=
"example">b
1129 <p>Blank lines, colons and parentheses are simply ignored. Comment lines
1130 beginning with
‘<samp>#
</samp>’ are allowed.
1132 <p>An order file could be used to build a series of packages, for example,
1135 <div class=
"example">
1136 <pre class=
"example"># Image handling libraries
1138 libs/libjpeg-turbo: devel/nasm
1139 x-libs/jasper: libs/libjpeg-turbo
1140 libs/tiff: libs/libjpeg-turbo
1143 <p>To proceed with each recipe, we can type:
1145 <div class=
"example">
1146 <pre class=
"example">qi order imglibs.order | qi build --install -
1149 <p>The output of
‘<samp>qi order imglibs.order
</samp>’ tells to qi in which order it
1150 should build the recipes:
1152 <div class=
"example">
1153 <pre class=
"example">devel/nasm
1161 <a name=
"Creating-packages"></a>
1162 <div class=
"header">
1164 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>
1166 <a name=
"Creating-packages-1"></a>
1167 <h2 class=
"chapter">7 Creating packages
</h2>
1168 <a name=
"index-package-creation"></a>
1170 <p>The creation command is an internal function of qi to make new Qi
1171 compatible packages. A package is produced using the contents of
1172 the Current Working Directory and the package file is written out.
1174 <div class=
"example">
1175 <pre class=
"example">Usage: qi create [
<var>Output/PackageName.tlz
</var>]...
1178 <p>The argument for the file name to be written must contain a fully
1179 qualified named directory as the output directory where the package
1180 produced will be written. The file name should be composed using the
1181 full name: name-version-architecture-release[@pkgcategory].tlz
1183 <p><small>EXAMPLE
</small>
1185 <div class=
"example">
1186 <pre class=
"example">cd /usr/pkg
1187 cd claws-mail_3.17
.1_amd64-
1@x-apps
1188 qi create /var/cache/qi/packages/claws-mail_3.17
.1_amd64-
1@x-apps
1191 <p>In this case, the package
"claws-mail_3.17
.1_amd64-
1@x-apps
" will be
1192 written into
‘<samp>/var/cache/qi/packages/
</samp>’.
1194 <p>All packages produced are complemented by a checksum file (.sha256).
1198 <a name=
"Examining-packages"></a>
1199 <div class=
"header">
1201 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>
1203 <a name=
"Examining-packages-1"></a>
1204 <h2 class=
"chapter">8 Examining packages
</h2>
1205 <a name=
"index-package-examination"></a>
1207 <p>The extraction command serves to examine binary packages for debugging
1208 purposes. It decompresses a package into a single directory, verifying
1209 its integrity and preserving all of its properties (owner and permissions).
1211 <div class=
"example">
1212 <pre class=
"example">Usage: qi extract [
<var>packagename.tlz
</var>]...
1215 <p><small>EXAMPLE
</small>
1217 <div class=
"example">
1218 <pre class=
"example">qi extract mksh_R56c_amd64-
1@shells.tlz
1221 <p>This action will put the content of
"mksh_R56c_amd64-
1@shells.tlz
" into a
1222 single directory, this is a private directory for the user who requested
1223 the action, creation operation will be equal to
<strong>u=rwx,g=,o= (
0700)
</strong>.
1224 The package content will reside on this location, default mask to deploy
1225 the content will be equal to
<strong>u=rwx,g=rwx,o=rwx (
0000)
</strong>.
1227 <p>Note: the creation of the custom directory is influenced by the value
1228 of the
<code>TMPDIR
</code> variable.
1232 <a name=
"Qi-exit-status"></a>
1233 <div class=
"header">
1235 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>
1237 <a name=
"Qi-exit-status-1"></a>
1238 <h2 class=
"chapter">9 Qi exit status
</h2>
1239 <a name=
"index-exit-codes"></a>
1241 <p>All the exit codes are described in this chapter.
1243 <dl compact=
"compact">
1244 <dt>‘<samp>0</samp>’</dt>
1245 <dd><p>Successful completion (no errors).
1248 <dt>‘<samp>1</samp>’</dt>
1249 <dd><p>Minor common errors:
1252 <li> Help usage on invalid options or required arguments.
1254 </li><li> Program needed by qi (prerequisite) is not available.
1258 <dt>‘<samp>2</samp>’</dt>
1259 <dd><p>Command execution error:
1261 <p>This code is used to return the evaluation of an external command or shell
1262 arguments in case of failure.
1265 <dt>‘<samp>3</samp>’</dt>
1266 <dd><p>Integrity check error for compressed files.
1268 <p>Compressed files means:
1271 <li> A tarball file from tar(
1).
1272 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1275 </li><li> A tarball file from tarlz(
1).
1276 Supported extensions: .tar.lz, .tlz
1278 </li><li> Zip files from unzip(
1).
1279 Supported extensions: .zip, .ZIP
1281 </li><li> Gzip files from gzip(
1).
1282 Supported extensions: .gz, .Z
1284 </li><li> Bzip2 files from bzip2(
1).
1285 Supported extension: .bz2
1287 </li><li> Lzip files from lzip(
1).
1288 Supported extension: .lz
1290 </li><li> Xz files from xz(
1).
1291 Supported extension: .xz
1295 <dt>‘<samp>4</samp>’</dt>
1296 <dd><p>File empty, not regular, or expected.
1298 <p>It
’s commonly expected:
1301 <li> An argument for giving commands.
1303 </li><li> A regular file or readable directory.
1305 </li><li> An expected extension: .tlz, .sha256, .order.
1307 </li><li> A protocol supported by the network downloader tool.
1311 <dt>‘<samp>5</samp>’</dt>
1312 <dd><p>Empty or not defined variable:
1314 <p>This code is used to report empty or undefined variables (usually
1315 variables coming from a recipe or assigned arrays that are tested).
1318 <dt>‘<samp>6</samp>’</dt>
1319 <dd><p>Package already installed:
1321 <p>The package directory for an incoming .tlz package already exists.
1324 <dt>‘<samp>10</samp>’</dt>
1325 <dd><p>Network manager error:
1327 <p>This code is used if the network downloader tool fails for some reason.
1333 <a name=
"Index"></a>
1334 <div class=
"header">
1336 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>
1338 <a name=
"Index-1"></a>
1339 <h2 class=
"unnumbered">Index
</h2>
1341 <table><tr><th valign=
"top">Jump to:
</th><td><a class=
"summary-letter" href=
"#Index_cp_letter-C"><b>C
</b></a>
1343 <a class=
"summary-letter" href=
"#Index_cp_letter-E"><b>E
</b></a>
1345 <a class=
"summary-letter" href=
"#Index_cp_letter-H"><b>H
</b></a>
1347 <a class=
"summary-letter" href=
"#Index_cp_letter-I"><b>I
</b></a>
1349 <a class=
"summary-letter" href=
"#Index_cp_letter-M"><b>M
</b></a>
1351 <a class=
"summary-letter" href=
"#Index_cp_letter-P"><b>P
</b></a>
1353 <a class=
"summary-letter" href=
"#Index_cp_letter-R"><b>R
</b></a>
1355 <a class=
"summary-letter" href=
"#Index_cp_letter-S"><b>S
</b></a>
1357 <a class=
"summary-letter" href=
"#Index_cp_letter-T"><b>T
</b></a>
1359 <a class=
"summary-letter" href=
"#Index_cp_letter-V"><b>V
</b></a>
1361 <a class=
"summary-letter" href=
"#Index_cp_letter-W"><b>W
</b></a>
1364 <table class=
"index-cp" border=
"0">
1365 <tr><td></td><th align=
"left">Index Entry
</th><td> </td><th align=
"left"> Section
</th></tr>
1366 <tr><td colspan=
"4"> <hr></td></tr>
1367 <tr><th><a name=
"Index_cp_letter-C">C
</a></th><td></td><td></td></tr>
1368 <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>
1369 <tr><td colspan=
"4"> <hr></td></tr>
1370 <tr><th><a name=
"Index_cp_letter-E">E
</a></th><td></td><td></td></tr>
1371 <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>
1372 <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>
1373 <tr><td colspan=
"4"> <hr></td></tr>
1374 <tr><th><a name=
"Index_cp_letter-H">H
</a></th><td></td><td></td></tr>
1375 <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>
1376 <tr><td colspan=
"4"> <hr></td></tr>
1377 <tr><th><a name=
"Index_cp_letter-I">I
</a></th><td></td><td></td></tr>
1378 <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>
1379 <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>
1380 <tr><td colspan=
"4"> <hr></td></tr>
1381 <tr><th><a name=
"Index_cp_letter-M">M
</a></th><td></td><td></td></tr>
1382 <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>
1383 <tr><td colspan=
"4"> <hr></td></tr>
1384 <tr><th><a name=
"Index_cp_letter-P">P
</a></th><td></td><td></td></tr>
1385 <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>
1386 <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>
1387 <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>
1388 <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>
1389 <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>
1390 <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>
1391 <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>
1392 <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>
1393 <tr><td colspan=
"4"> <hr></td></tr>
1394 <tr><th><a name=
"Index_cp_letter-R">R
</a></th><td></td><td></td></tr>
1395 <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>
1396 <tr><td colspan=
"4"> <hr></td></tr>
1397 <tr><th><a name=
"Index_cp_letter-S">S
</a></th><td></td><td></td></tr>
1398 <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>
1399 <tr><td colspan=
"4"> <hr></td></tr>
1400 <tr><th><a name=
"Index_cp_letter-T">T
</a></th><td></td><td></td></tr>
1401 <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>
1402 <tr><td colspan=
"4"> <hr></td></tr>
1403 <tr><th><a name=
"Index_cp_letter-V">V
</a></th><td></td><td></td></tr>
1404 <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>
1405 <tr><td colspan=
"4"> <hr></td></tr>
1406 <tr><th><a name=
"Index_cp_letter-W">W
</a></th><td></td><td></td></tr>
1407 <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>
1408 <tr><td colspan=
"4"> <hr></td></tr>
1410 <table><tr><th valign=
"top">Jump to:
</th><td><a class=
"summary-letter" href=
"#Index_cp_letter-C"><b>C
</b></a>
1412 <a class=
"summary-letter" href=
"#Index_cp_letter-E"><b>E
</b></a>
1414 <a class=
"summary-letter" href=
"#Index_cp_letter-H"><b>H
</b></a>
1416 <a class=
"summary-letter" href=
"#Index_cp_letter-I"><b>I
</b></a>
1418 <a class=
"summary-letter" href=
"#Index_cp_letter-M"><b>M
</b></a>
1420 <a class=
"summary-letter" href=
"#Index_cp_letter-P"><b>P
</b></a>
1422 <a class=
"summary-letter" href=
"#Index_cp_letter-R"><b>R
</b></a>
1424 <a class=
"summary-letter" href=
"#Index_cp_letter-S"><b>S
</b></a>
1426 <a class=
"summary-letter" href=
"#Index_cp_letter-T"><b>T
</b></a>
1428 <a class=
"summary-letter" href=
"#Index_cp_letter-V"><b>V
</b></a>
1430 <a class=
"summary-letter" href=
"#Index_cp_letter-W"><b>W
</b></a>
1434 <div class=
"footnote">
1436 <h4 class=
"footnotes-heading">Footnotes
</h4>
1438 <h3><a name=
"FOOT1" href=
"#DOCF1">(
1)
</a></h3>
1439 <p>For more details about tarlz and the
1440 lzip format, visit
<a href=
"https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html
</a>.
</p>
1441 <h3><a name=
"FOOT2" href=
"#DOCF2">(
2)
</a></h3>
1442 <p>The official guide for Graft can be found at
1443 <a href=
"https://peters.gormand.com.au/Home/tools/graft/graft.html">https://peters.gormand.com.au/Home/tools/graft/graft.html
</a>.
</p>
1444 <h3><a name=
"FOOT3" href=
"#DOCF3">(
3)
</a></h3>
1445 <p>The proposal for
‘<samp>license
</samp>’ was made by Richard M. Stallman at
1446 <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>