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.9,
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>The variable
‘<samp>tarlz_compression_options
</samp>’ can be used to change the
803 default compression options in tarlz(
1), default sets to
‘<samp>-
9 --solid
</samp>’.
804 For example if the variable is declared as:
806 <div class=
"example">
807 <pre class=
"example">tarlz_compression_options=
"-
0 --bsolid
"
810 <p>It will change the granularity of tarlz(
1) by using the
‘<samp>--bsolid
</samp>’
811 option
<a name=
"DOCF3" href=
"#FOOT3"><sup>3</sup></a>,
812 as well as increasing the compression speed by lowering the compression
813 level with
‘<samp>-
0</samp>’.
815 <p>This is only recommended for recipes where testing, or faster processing is
816 desired to create the packaged file more quickly. It is not recommended for
817 production or general distribution of binary packages.
819 <p>A typical recipe contains the following variables:
822 <li> ‘<samp>program
</samp>’: Software name.
824 <p>It matches the source name. It is also used to compose the name of the
825 package if
‘<samp>${pkgname}
</samp>’ is not specified.
827 </li><li> ‘<samp>version
</samp>’: Software version.
829 <p>It matches the source name. It is also used to compose the version of the
830 package if
‘<samp>${pkgversion}
</samp>’ is not specified.
832 </li><li> ‘<samp>arch
</samp>’: Software architecture.
834 <p>It is used to compose the architecture of the package in which it is
837 </li><li> ‘<samp>release
</samp>’: Release number.
839 <p>This is used to reflect the release number of the package. It is
840 recommended to increase this number after any significant change in
841 the recipe or post-install script.
843 </li><li> ‘<samp>pkgcategory
</samp>’: Package category.
845 <p>Optional but recommended variable to categorize the package name when it is
849 <p>Obtaining sources over the network must be declared in the recipe using
850 the
‘<samp>fetch
</samp>’ variable.
852 <p>The variables
‘<samp>netget
</samp>’ and
‘<samp>rsync
</samp>’ can be defined in
<samp>qirc
</samp>
853 to establish a network downloader in order to get the sources. If they
854 are not defined, qi uses default values:
856 <p>‘<samp>netget
</samp>’ is the general network downloader tool, defaults sets to
857 ‘<samp>wget2 -c -w1 -t3 --no-check-certificate
</samp>’.
859 <p>‘<samp>rsync
</samp>’ is the network tool for sources containing the prefix for
860 the RSYNC protocol, default sets to
861 ‘<samp>rsync -v -a -L -z -i --progress
</samp>’.
863 <p>The variable
‘<samp>description
</samp>’ is used to print the package description
864 when a package is installed.
866 <p>A description has two parts: a brief description, and a long description.
867 By convention, the syntax of
‘<samp>description
</samp>’ is:
869 <div class=
"example">
870 <pre class=
"example">description=
"
877 <p>The first line of the value represented is a brief description of the
878 software (called
"blurb
"). A blank line separates the
<em>brief
879 description
</em> from the
<em>long description
</em>, which should contain a more
880 descriptive description of the software.
882 <p>An example looks like:
884 <div class=
"example">
885 <pre class=
"example">description=
"
886 The GNU core utilities.
888 The GNU core utilities are the basic file, shell and text manipulation
889 utilities of the GNU operating system. These are the core utilities
890 which are expected to exist on every operating system.
894 <p>Please consider a length limit of
78 characters as maximum, because the same
895 one would be used on the meta file creation. See
896 <a href=
"#Recipes">The meta file
</a> section.
898 <p>The
‘<samp>homepage
</samp>’ variable is used to declare the main site or home page:
900 <div class=
"example">
901 <pre class=
"example">homepage=https://www.gnu.org/software/gcc
904 <p>The variable
‘<samp>license
</samp>’ is used for license information
<a name=
"DOCF4" href=
"#FOOT4"><sup>4</sup></a>.
905 Some code in the program can be covered by license A, license B, or
906 license C. For
"separate licensing
" or
"heterogeneous licensing
", we
907 suggest using
<strong>|
</strong> for a disjunction,
<strong>&</strong> for a conjunction
908 (if that ever happens in a significant way), and comma for heterogeneous
909 licensing. Comma would have lower precedence, plus added special terms.
911 <div class=
"example">
912 <pre class=
"example">license=
"LGPL, GPL | Artistic - added permission
"
915 <a name=
"Writing-recipes"></a>
916 <h3 class=
"section">5.3 Writing recipes
</h3>
917 <a name=
"index-writing-recipes"></a>
919 <p>Originally, Qi was designed for the series of Dragora GNU/Linux-Libre
3;
920 this doesn
’t mean you can
’t use it in another distribution, just that if
921 you do, you
’ll have to try it out for yourself. To help with this, here
922 are some references to well-written recipes:
925 <li> <a href=
"https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes
</a>
926 </li><li> <a href=
"https://notabug.org/dragora/dragora/src/master/recipes">https://notabug.org/dragora/dragora/src/master/recipes
</a>
927 </li><li> <a href=
"https://notabug.org/dragora/dragora-extras/src/master/recipes">https://notabug.org/dragora/dragora-extras/src/master/recipes
</a>
928 </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>
931 <a name=
"Building-packages"></a>
932 <h3 class=
"section">5.4 Building packages
</h3>
933 <a name=
"index-package-build"></a>
935 <p>A recipe is any valid regular file. Qi sets priorities for reading a
936 recipe, the order in which qi looks for a recipe is:
939 <li> Current working directory.
941 </li><li> If the specified path name does not contain
"recipe
" as the last
942 component. Qi will complete it by adding
"recipe
" to the path name.
944 </li><li> If the recipe is not in the current working directory, it will be
945 searched under
‘<samp>${worktree}/recipes
</samp>’. The last component will be
946 completed adding
"recipe
" to the specified path name.
949 <p>To build a single package, type:
951 <div class=
"example">
952 <pre class=
"example">qi build x-apps/xterm
955 <p>Multiple jobs can be passed to the compiler to speed up the build process:
957 <div class=
"example">
958 <pre class=
"example">qi build --jobs
3 x-apps/xterm
961 <p>Update or install the produced package (if not already installed) when the
964 <div class=
"example">
965 <pre class=
"example">qi build -j3 --upgrade x-apps/xterm
968 <p>Only process a recipe but do not create the binary package:
970 <div class=
"example">
971 <pre class=
"example">qi build --no-package dict/aspell
974 <p>The options
–install or
–upgrade have no effect when
–no-package
977 <p>This is useful to inspect the build process of the above recipe:
979 <p>qi build
–keep
–no-package dict/aspell
2>&1 | tee aspell-log.txt
981 <p>The
–keep option could preserve the source directory and the destination
982 directory for later inspection. A log file of the build process will be
983 created redirecting both, standard error and standard output to tee(
1).
985 <a name=
"Variables-from-the-environment"></a>
986 <h3 class=
"section">5.5 Variables from the environment
</h3>
987 <a name=
"index-environment-variables"></a>
989 <p>Qi has environment variables which can be used at build time:
991 <p>The variable
<code>TMPDIR
</code> sets the temporary directory for sources, which is
992 used for package extractions (see
<a href=
"#Examining-packages">Examining packages
</a>) and is
993 prepended to the value of
‘<samp>${srcdir}
</samp>’ and
‘<samp>${destdir}
</samp>’ in
994 build command. By convention its default value is equal to
995 ‘<samp>/usr/src/qi/build
</samp>’.
997 <p>The variables
<code>QICFLAGS
</code>,
<code>QICXXFLAGS
</code>,
<code>QILDFLAGS
</code>, and
998 <code>QICPPFLAGS
</code> have no effect by default. The environment variables
999 such as
<code>CFLAGS
</code>,
<code>CXXFLAGS
</code>,
<code>LDFLAGS
</code>, and
<code>CPPFLAGS
</code>
1000 are unset at compile time:
1002 <p>Recommended practice is to set variables in the command line of
1003 ‘<samp>configure
</samp>’ or
<em>make(
1)
</em> instead of exporting to the
1004 environment. As follows:
1006 <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>
1008 <p>It is not wise for makefiles to depend for their functioning on environment
1009 variables set up outside their control, since this would cause different
1010 users to get different results from the same makefile. This is against the
1011 whole purpose of most makefiles.
1014 <p>Setting environment variables for configure is deprecated because running
1015 configure in varying environments can be dangerous.
1017 <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>
1019 <p>Variables not defined in a site shell script can be set in the environment
1020 passed to configure. However, some packages may run configure again
1021 during the build, and the customized values of these variables may be
1022 lost. In order to avoid this problem, you should set them in the
1023 configure command line, using
‘<samp>VAR=value
</samp>’. For example:
1025 <p><code>./configure CC=/usr/local2/bin/gcc
</code>
1028 <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>
1030 <p>If for instance the user runs
‘<samp>CC=bizarre-cc ./configure
</samp>’, then the cache,
1031 config.h, and many other output files depend upon bizarre-cc being the C
1032 compiler. If for some reason the user runs ./configure again, or if it is
1033 run via
‘<samp>./config.status --recheck
</samp>’, (See Automatic Remaking, and see
1034 config.status Invocation), then the configuration can be inconsistent,
1035 composed of results depending upon two different compilers.
1037 Indeed, while configure can notice the definition of CC in
‘<samp>./configure
1038 CC=bizarre-cc
</samp>’, it is impossible to notice it in
‘<samp>CC=bizarre-cc
1039 ./configure
</samp>’, which, unfortunately, is what most users do.
1041 configure: error: changes in the environment can compromise the build.
1044 <p>If the
<code>SOURCE_DATE_EPOCH
</code> environment variable is set to a UNIX timestamp
1045 (defined as the number of seconds, excluding leap seconds, since
01 Jan
1970
1046 00:
00:
00 UTC.); then the given timestamp will be used to overwrite any newer
1047 timestamps on the package contents (when it is created). More information
1048 about this can be found at
1049 <a href=
"https://reproducible-builds.org/specs/source-date-epoch/">https://reproducible-builds.org/specs/source-date-epoch/
</a>.
1051 <a name=
"The-meta-file"></a>
1052 <h3 class=
"section">5.6 The meta file
</h3>
1053 <a name=
"index-the-meta-file"></a>
1055 <p>The
"meta file
" is a regular file created during the build process, it
1056 contains information about the package such as package name, package
1057 version, architecture, release, fetch address, description, and other
1058 minor data extracted from processed recipes. The name of the file is
1059 generated as
‘<samp>${full_pkgname}.tlz.txt
</samp>’, and its purpose is to
1060 reflect essential information to the user without having to look inside
1061 the package content. The file format is also intended to be used by
1062 other scripts or by common Unix tools.
1064 <p>The content of a meta file looks like:
1066 <div class=
"example">
1067 <pre class=
"example">#
1068 # Pattern scanning and processing language.
1070 # The awk utility interprets a special-purpose programming language
1071 # that makes it possible to handle simple data-reformatting jobs
1072 # with just a few lines of code. It is a free version of 'awk'.
1074 # GNU awk implements the AWK utility which is part of
1075 # IEEE Std
1003.1 Shell and Utilities (XCU).
1078 QICFLAGS=
"-O2
"
1079 QICXXFLAGS=
"-O2
"
1080 QILDFLAGS=
""
1081 QICPPFLAGS=
""
1086 pkgcategory=
"tools
"
1087 full_pkgname=gawk_5.0
.1_amd64-
1@tools
1088 blurb=
"Pattern scanning and processing language.
"
1089 homepage=
"https://www.gnu.org/software/gawk
"
1090 license=
"GPLv3+
"
1091 fetch=
"https://ftp.gnu.org/gnu/gawk/gawk-
5.0.1.tar.lz
"
1092 replace=
""
1095 <p>A package descriptions is extracted from the variable
‘<samp>description
</samp>’
1096 where each line is interpreted literally and pre-formatted to fit in
1097 (exactly)
<strong>80 columns
</strong>, plus the character
‘<samp>#
</samp>’ and a blank
1098 space is prefixed to every line (shell comments).
1100 <p>In addition to the Special variables, there are implicit variables such as
1101 ‘<samp>blurb
</samp>’:
1103 <p>The
‘<samp>blurb
</samp>’ variable is related to the special variable
1104 ‘<samp>description
</samp>’. Its value is made from the first (substantial)
1105 line of
‘<samp>description
</samp>’, mentioned as the
"brief description
".
1107 <p>The build flags such as
‘<samp>QICFLAGS
</samp>’,
‘<samp>QICXXFLAGS
</samp>’,
1108 ‘<samp>QILDFLAGS
</samp>’, and
‘<samp>QICPPFLAGS
</samp>’ are only added to the meta file
1109 if the declared variable
‘<samp>arch
</samp>’ is not equal to the
"noarch
" value.
1112 <a name=
"Order-files"></a>
1113 <div class=
"header">
1115 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>
1117 <a name=
"Order-files-1"></a>
1118 <h2 class=
"chapter">6 Order files
</h2>
1119 <a name=
"index-handling-build-order"></a>
1121 <p>The order command has the purpose of resolving the build order through
1122 .order files. An order file contains a list of recipe names, by default
1123 does not perform any action other than to print a resolved list in
1124 descending order. For example, if
<strong>a
</strong> depends on
<strong>b
</strong> and
1125 <strong>c
</strong>, and
<strong>c
</strong> depends on
<strong>b
</strong> as well, the file might
1128 <div class=
"example">
1129 <pre class=
"example">a: c b
1134 <p>Each letter represents a recipe name, complete dependencies for
1135 the first recipe name are listed in descending order, which is
1136 printed from right to left, and removed from left to right:
1138 <p><small>OUTPUT
</small>
1140 <div class=
"example">
1141 <pre class=
"example">b
1146 <p>Blank lines, colons and parentheses are simply ignored. Comment lines
1147 beginning with
‘<samp>#
</samp>’ are allowed.
1149 <p>An order file could be used to build a series of packages, for example,
1152 <div class=
"example">
1153 <pre class=
"example"># Image handling libraries
1155 libs/libjpeg-turbo: devel/nasm
1156 x-libs/jasper: libs/libjpeg-turbo
1157 libs/tiff: libs/libjpeg-turbo
1160 <p>To proceed with each recipe, we can type:
1162 <div class=
"example">
1163 <pre class=
"example">qi order imglibs.order | qi build --install -
1166 <p>The output of
‘<samp>qi order imglibs.order
</samp>’ tells to qi in which order it
1167 should build the recipes:
1169 <div class=
"example">
1170 <pre class=
"example">devel/nasm
1178 <a name=
"Creating-packages"></a>
1179 <div class=
"header">
1181 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>
1183 <a name=
"Creating-packages-1"></a>
1184 <h2 class=
"chapter">7 Creating packages
</h2>
1185 <a name=
"index-package-creation"></a>
1187 <p>The creation command is an internal function of qi to make new Qi
1188 compatible packages. A package is produced using the contents of
1189 the Current Working Directory and the package file is written out.
1191 <div class=
"example">
1192 <pre class=
"example">Usage: qi create [
<var>Output/PackageName.tlz
</var>]...
1195 <p>The argument for the file name to be written must contain a fully
1196 qualified named directory as the output directory where the package
1197 produced will be written. The file name should be composed using the
1198 full name: name-version-architecture-release[@pkgcategory].tlz
1200 <p><small>EXAMPLE
</small>
1202 <div class=
"example">
1203 <pre class=
"example">cd /usr/pkg
1204 cd claws-mail_3.17
.1_amd64-
1@x-apps
1205 qi create /var/cache/qi/packages/claws-mail_3.17
.1_amd64-
1@x-apps
1208 <p>In this case, the package
"claws-mail_3.17
.1_amd64-
1@x-apps
" will be
1209 written into
‘<samp>/var/cache/qi/packages/
</samp>’.
1211 <p>All packages produced are complemented by a checksum file (.sha256).
1215 <a name=
"Examining-packages"></a>
1216 <div class=
"header">
1218 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>
1220 <a name=
"Examining-packages-1"></a>
1221 <h2 class=
"chapter">8 Examining packages
</h2>
1222 <a name=
"index-package-examination"></a>
1224 <p>The extraction command serves to examine binary packages for debugging
1225 purposes. It decompresses a package into a single directory, verifying
1226 its integrity and preserving all of its properties (owner and permissions).
1228 <div class=
"example">
1229 <pre class=
"example">Usage: qi extract [
<var>packagename.tlz
</var>]...
1232 <p><small>EXAMPLE
</small>
1234 <div class=
"example">
1235 <pre class=
"example">qi extract mksh_R56c_amd64-
1@shells.tlz
1238 <p>This action will put the content of
"mksh_R56c_amd64-
1@shells.tlz
" into a
1239 single directory, this is a private directory for the user who requested
1240 the action, creation operation will be equal to
<strong>u=rwx,g=,o= (
0700)
</strong>.
1241 The package content will reside on this location, default mask to deploy
1242 the content will be equal to
<strong>u=rwx,g=rwx,o=rwx (
0000)
</strong>.
1244 <p>Note: the creation of the custom directory is influenced by the value
1245 of the
<code>TMPDIR
</code> variable.
1249 <a name=
"Qi-exit-status"></a>
1250 <div class=
"header">
1252 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>
1254 <a name=
"Qi-exit-status-1"></a>
1255 <h2 class=
"chapter">9 Qi exit status
</h2>
1256 <a name=
"index-exit-codes"></a>
1258 <p>All the exit codes are described in this chapter.
1260 <dl compact=
"compact">
1261 <dt>‘<samp>0</samp>’</dt>
1262 <dd><p>Successful completion (no errors).
1265 <dt>‘<samp>1</samp>’</dt>
1266 <dd><p>Minor common errors:
1269 <li> Help usage on invalid options or required arguments.
1271 </li><li> Program needed by qi (prerequisite) is not available.
1275 <dt>‘<samp>2</samp>’</dt>
1276 <dd><p>Command execution error:
1278 <p>This code is used to return the evaluation of an external command or shell
1279 arguments in case of failure.
1282 <dt>‘<samp>3</samp>’</dt>
1283 <dd><p>Integrity check error for compressed files.
1285 <p>Compressed files means:
1288 <li> A tarball file from tar(
1), typically handled by the GNU tar implementation.
1289 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1290 .tar.xz, .txz, .tar.zst, .tzst
1292 </li><li> A tarball file from tarlz(
1).
1293 Supported extensions: .tar.lz, .tlz
1295 </li><li> Zip files from unzip(
1).
1296 Supported extensions: .zip, .ZIP
1298 </li><li> Gzip files from gzip(
1).
1299 Supported extensions: .gz, .Z
1301 </li><li> Bzip2 files from bzip2(
1).
1302 Supported extension: .bz2
1304 </li><li> Lzip files from lzip(
1).
1305 Supported extension: .lz
1307 </li><li> Xz files from xz(
1).
1308 Supported extension: .xz
1310 </li><li> Zstd files from zstd(
1).
1311 Supported extension: .zst
1315 <dt>‘<samp>4</samp>’</dt>
1316 <dd><p>File empty, not regular, or expected.
1318 <p>It
’s commonly expected:
1321 <li> An argument for giving commands.
1323 </li><li> A regular file or readable directory.
1325 </li><li> An expected extension: .tlz, .sha256, .order.
1327 </li><li> A protocol supported by the network downloader tool.
1331 <dt>‘<samp>5</samp>’</dt>
1332 <dd><p>Empty or not defined variable:
1334 <p>This code is used to report empty or undefined variables (usually
1335 variables coming from a recipe or assigned arrays that are tested).
1338 <dt>‘<samp>6</samp>’</dt>
1339 <dd><p>Package already installed:
1341 <p>The package directory for an incoming .tlz package already exists.
1344 <dt>‘<samp>10</samp>’</dt>
1345 <dd><p>Network manager error:
1347 <p>This code is used if the network downloader tool fails for some reason.
1353 <a name=
"Index"></a>
1354 <div class=
"header">
1356 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>
1358 <a name=
"Index-1"></a>
1359 <h2 class=
"unnumbered">Index
</h2>
1361 <table><tr><th valign=
"top">Jump to:
</th><td><a class=
"summary-letter" href=
"#Index_cp_letter-C"><b>C
</b></a>
1363 <a class=
"summary-letter" href=
"#Index_cp_letter-E"><b>E
</b></a>
1365 <a class=
"summary-letter" href=
"#Index_cp_letter-H"><b>H
</b></a>
1367 <a class=
"summary-letter" href=
"#Index_cp_letter-I"><b>I
</b></a>
1369 <a class=
"summary-letter" href=
"#Index_cp_letter-M"><b>M
</b></a>
1371 <a class=
"summary-letter" href=
"#Index_cp_letter-P"><b>P
</b></a>
1373 <a class=
"summary-letter" href=
"#Index_cp_letter-R"><b>R
</b></a>
1375 <a class=
"summary-letter" href=
"#Index_cp_letter-S"><b>S
</b></a>
1377 <a class=
"summary-letter" href=
"#Index_cp_letter-T"><b>T
</b></a>
1379 <a class=
"summary-letter" href=
"#Index_cp_letter-V"><b>V
</b></a>
1381 <a class=
"summary-letter" href=
"#Index_cp_letter-W"><b>W
</b></a>
1384 <table class=
"index-cp" border=
"0">
1385 <tr><td></td><th align=
"left">Index Entry
</th><td> </td><th align=
"left"> Section
</th></tr>
1386 <tr><td colspan=
"4"> <hr></td></tr>
1387 <tr><th><a name=
"Index_cp_letter-C">C
</a></th><td></td><td></td></tr>
1388 <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>
1389 <tr><td colspan=
"4"> <hr></td></tr>
1390 <tr><th><a name=
"Index_cp_letter-E">E
</a></th><td></td><td></td></tr>
1391 <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>
1392 <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>
1393 <tr><td colspan=
"4"> <hr></td></tr>
1394 <tr><th><a name=
"Index_cp_letter-H">H
</a></th><td></td><td></td></tr>
1395 <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>
1396 <tr><td colspan=
"4"> <hr></td></tr>
1397 <tr><th><a name=
"Index_cp_letter-I">I
</a></th><td></td><td></td></tr>
1398 <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>
1399 <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>
1400 <tr><td colspan=
"4"> <hr></td></tr>
1401 <tr><th><a name=
"Index_cp_letter-M">M
</a></th><td></td><td></td></tr>
1402 <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>
1403 <tr><td colspan=
"4"> <hr></td></tr>
1404 <tr><th><a name=
"Index_cp_letter-P">P
</a></th><td></td><td></td></tr>
1405 <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>
1406 <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>
1407 <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>
1408 <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>
1409 <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>
1410 <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>
1411 <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>
1412 <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>
1413 <tr><td colspan=
"4"> <hr></td></tr>
1414 <tr><th><a name=
"Index_cp_letter-R">R
</a></th><td></td><td></td></tr>
1415 <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>
1416 <tr><td colspan=
"4"> <hr></td></tr>
1417 <tr><th><a name=
"Index_cp_letter-S">S
</a></th><td></td><td></td></tr>
1418 <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>
1419 <tr><td colspan=
"4"> <hr></td></tr>
1420 <tr><th><a name=
"Index_cp_letter-T">T
</a></th><td></td><td></td></tr>
1421 <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>
1422 <tr><td colspan=
"4"> <hr></td></tr>
1423 <tr><th><a name=
"Index_cp_letter-V">V
</a></th><td></td><td></td></tr>
1424 <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>
1425 <tr><td colspan=
"4"> <hr></td></tr>
1426 <tr><th><a name=
"Index_cp_letter-W">W
</a></th><td></td><td></td></tr>
1427 <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>
1428 <tr><td colspan=
"4"> <hr></td></tr>
1430 <table><tr><th valign=
"top">Jump to:
</th><td><a class=
"summary-letter" href=
"#Index_cp_letter-C"><b>C
</b></a>
1432 <a class=
"summary-letter" href=
"#Index_cp_letter-E"><b>E
</b></a>
1434 <a class=
"summary-letter" href=
"#Index_cp_letter-H"><b>H
</b></a>
1436 <a class=
"summary-letter" href=
"#Index_cp_letter-I"><b>I
</b></a>
1438 <a class=
"summary-letter" href=
"#Index_cp_letter-M"><b>M
</b></a>
1440 <a class=
"summary-letter" href=
"#Index_cp_letter-P"><b>P
</b></a>
1442 <a class=
"summary-letter" href=
"#Index_cp_letter-R"><b>R
</b></a>
1444 <a class=
"summary-letter" href=
"#Index_cp_letter-S"><b>S
</b></a>
1446 <a class=
"summary-letter" href=
"#Index_cp_letter-T"><b>T
</b></a>
1448 <a class=
"summary-letter" href=
"#Index_cp_letter-V"><b>V
</b></a>
1450 <a class=
"summary-letter" href=
"#Index_cp_letter-W"><b>W
</b></a>
1454 <div class=
"footnote">
1456 <h4 class=
"footnotes-heading">Footnotes
</h4>
1458 <h3><a name=
"FOOT1" href=
"#DOCF1">(
1)
</a></h3>
1459 <p>For more details about tarlz and the
1460 lzip format, visit
<a href=
"https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html
</a>.
</p>
1461 <h3><a name=
"FOOT2" href=
"#DOCF2">(
2)
</a></h3>
1462 <p>The official guide for Graft can be found at
1463 <a href=
"https://peters.gormand.com.au/Home/tools/graft/graft.html">https://peters.gormand.com.au/Home/tools/graft/graft.html
</a>.
</p>
1464 <h3><a name=
"FOOT3" href=
"#DOCF3">(
3)
</a></h3>
1465 <p>About the
‘<samp>--bsolid
</samp>’ granularity option of tarlz(
1),
1466 <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>
1467 <h3><a name=
"FOOT4" href=
"#DOCF4">(
4)
</a></h3>
1468 <p>The proposal for
‘<samp>license
</samp>’ was made by Richard M. Stallman at
1469 <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>