1 \input texinfo @c -*-texinfo-*-
3 @comment %**start of header
5 @settitle Qi user guide
6 @documentencoding ISO-8859-1
8 @comment %**end of header
11 @set UPDATED 24 Apr 2020
14 This user guide is for Qi (version @value{VERSION},
15 @value{UPDATED}), which is a simple but well-integrated package manager.
17 Copyright @copyright{} 2019-2020 Matias Andres Fonzo, Santiago del Estero,
21 Permission is granted to copy, distribute and/or modify this document
22 under the terms of the GNU Free Documentation License, Version 1.3 or
23 any later version published by the Free Software Foundation; with no
24 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
25 Texts. A copy of the license is included in the section entitled
26 ``GNU Free Documentation License''.
30 @dircategory Package management
32 * Qi: (qi). A user-friendly package manager.
38 @subtitle for version @value{VERSION}, @value{UPDATED}
39 @author Matias Fonzo (@email{selk@@dragora.org})
42 @vskip 0pt plus 1filll
52 This user guide is for Qi (version @value{VERSION},
57 * Introduction:: Description and features of qi
58 * Invoking qi:: Command-line options
59 * The qirc file:: Configuration file
60 * Packages:: Managing packages
61 * Recipes:: Building packages
62 * Order files:: Handling build order
63 * Creating packages:: Making Qi packages
64 * Examining packages:: Debugging purposes
65 * Exit status:: Exit codes
70 Copyright (C) 2019-2020 Matias Fonzo.
72 Qi's home page can be found at @uref{https://www.dragora.org}.
73 @w{Send bug reports or suggestions to @email{dragora-users@@nongnu.org}.}
79 Qi is a simple but well-integrated package manager. It can create,
80 install, remove, and upgrade software packages. Qi produces binary
81 packages using recipes, which are files containing specific instructions
82 to build each package from source. Qi can manage multiple packages
83 under a single directory hierarchy. This method allows to maintain a set
84 of packages and multiple versions of them. This means that Qi could be
85 used as the main package manager or complement the existing one.
87 Qi offers a friendly command line interface, a global configuration
88 file, a simple recipe layout to deploy software packages; also works
89 with binary packages in parallel, speeding up installations and packages
90 in production. The format used for packages is a simplified but safe
91 POSIX pax archive compressed with lzip.
93 Qi is a modern (POSIX-compliant) shell script released under the
94 terms of the GNU General Public License. There are only two major
95 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
96 to be found in any Unix-like system.
102 This chapter describes the synopsis and command line options for
106 Usage: qi [@var{OPTION}]... [@var{FILE}]...
110 One mandatory option specifies the operation that @samp{qi} should
111 perform, other options are meant to detail how this operation should be
115 qi supports the following options to operate:
119 Build package using recipe names.
122 Create .tlz package from directory.
131 Resolve build order through .order files.
134 Upgrade packages (implies -i, -d and -p options).
137 Warn about files that will be linked.
140 Extract a package for debugging purposes.
144 There are common options between modes:
148 Do not read the configuration file.
150 This will ignore any value in the qirc file.
153 Package directory for installations.
155 This option sets @samp{$@{packagedir@}}.
157 Only valid for -i, -d, or -u options.
162 This option can force the build of a recipe, or force the upgrade of a
163 pre-existing package.
165 Only valid for -b, -u options.
168 Target directory for symbolic links.
170 This option sets @samp{$@{targetdir@}}.
172 Only valid for -i, -d, or -u options.
175 Keep (don't delete) @samp{$@{srcdir@}} or @samp{$@{destdir@}} in build
176 mode, keep (don't delete) package directory in delete mode.
178 Only valid for -b, -d or -u options.
181 Prune conflicts on package installations.
183 This option may proceed with the package installation if one or more
187 Use the fully qualified named directory as the root directory for all qi
188 operations. The target directory and package directory will be relative
189 to the specified directory, including Graft's log file.
192 Be verbose (a 2nd -v gives more).
196 Options for build mode (-b):
200 Where the packages produced are written.
202 This option sets @samp{$@{outdir@}}.
205 Where archives, patches, and recipes are expected.
207 This option sets @samp{$@{worktree@}}.
210 Where (compressed) sources will be found.
212 This option sets @samp{$@{tardir@}}.
217 Default value is obtained via uname(1) as @samp{uname -m}.
220 Parallel jobs for the compiler.
222 If not specified, default sets to 1.
225 Increment release number (@samp{$@{release@}} + 1).
227 It will be omitted if the -n option is being used.
230 Don't create a .tlz package.
233 Selects the option to skip completed recipes.
235 This means, in interactive mode, when the dialog to
236 summarize recipes is shown.
244 Print default directory locations.
246 This will print the target directory, package directory, working tree,
247 the directory for tarballs, and the output directory for the packages
251 Display the help describing the options and then exit.
254 Print the version number and license information.
255 The version number should be included in all bug reports.
259 Expected non-option arguments are package directories and regular files:
260 recipes or files ending in .tlz, .order.
262 When FILE is -, qi can read from the standard input. See examples at
267 @chapter The qirc file
268 @cindex configuration file
270 The global @file{qirc} file offers a way to define variables and tools
271 (such as a download manager) for default use. This file is used by qi
272 at runtime, e.g., to build, install, remove or upgrade packages.
274 Variables and their possible values must be declared as any other
275 variable in the shell.
278 The command line options related to the package directory and target
279 directory and some of the command line options used for the build mode,
280 have the power to override the values declared on @file{qirc}.
281 See @ref{Invoking qi}.
284 The order in which qi looks for this file is:
288 @env{$@{HOME@}/.qirc}
292 @samp{$@{sysconfdir@}/qirc}
296 If you intend to run qi as effective user, the file
297 @samp{$@{sysconfdir@}/qirc} could be copied to @env{$@{HOME@}/.qirc}
298 setting the paths for @samp{$@{packagedir@}} and @samp{$@{targetdir@}}
299 according to the @env{$HOME}.
304 @cindex managing packages
306 A package is a suite of programs usually distributed in binary form
307 which may also contain manual pages, documentation, or any other file
308 associated to a specific software.
310 The package format used by qi is a simplified POSIX pax archive
311 compressed with lzip@footnote{For more details about the lzip format, visit
312 @url{https://www.nongnu.org/lzip/}.}. The file extension for packages ends
316 Both package installation and package de-installation are managed using
317 two important (internal) variables: @samp{$@{packagedir@}} and
318 @samp{$@{targetdir@}}, these values can be changed in the
319 configuration file or via options.
321 @samp{$@{packagedir@}} is a common directory tree where the package
322 contents will be decompressed (will reside).
324 @samp{$@{targetdir@}} is a target directory where the links will be
325 made by graft(1) taking @samp{$@{packagedir@}/package_name} into account.
328 Packages are installed in self-contained directory trees and symbolic
329 links from a common area are made to the package files. This allows
330 multiple versions of the same package to coexist on the same system.
332 @section Package conflicts
333 @cindex package conflicts
335 All the links to install or remove a package are handled by graft(1).
336 Since multiple packages can be installed or removed at the same time,
337 certain conflicts may arise between the packages.
340 graft@footnote{The official guide for Graft can be found at
341 @url{http://peters.gormand.com.au/Home/tools/graft/graft.html}.}
342 defines a CONFLICT as one of the following conditions:
346 If the package object is a directory and the target object exists but is
350 If the package object is not a directory and the target object exists
351 and is not a symbolic link.
354 If the package object is not a directory and the target object exists
355 and is a symbolic link to something other than the package object.
359 The default behavior of qi for an incoming package is to ABORT if a
360 conflict arises. When a package is going to be deleted, qi tells to
361 graft(1) to remove those parts that are not in conflict, leaving the
362 links to the belonging package. This behavior can be forced if the
365 @section Installing packages
366 @cindex package installation
368 To install a single package, simply type:
371 qi -i coreutils-8.30-i586+1.tlz
375 To install multiple packages at once, type:
378 qi -i gcc-8.3.0-i586+1.tlz rafaela-2.2-i586+1.tlz ...
382 Warn about the files that will be linked:
385 qi -w bash-5.0-i586+1.tlz
388 This is to verify the content of a package before installing it.
391 See the process of an installation (very verbose):
394 qi -i -v mariana-3.0-i586+1.tlz
397 A second -v gives more.
400 Installing package in a different location:
403 qi -r /media/floppy -i lzip-1.21-i586+1.tlz
406 Important: the -r option assumes @samp{$@{targetdir@}} and
407 @samp{$@{packagedir@}}. See the following example.
410 qi -r /home/selk -i lzip-1.21-i586+1.tlz
413 In this case the content of "lzip-1.21-i586+1.tlz" will be decompressed
414 into @samp{/home/selk/pkgs/lzip-1.21-i586+1}. Assuming that the main
415 binary for lzip is under @samp{/home/selk/pkgs/lzip-1.21-i586+1/usr/bin/}
416 the target for "usr/bin" will be created at @samp{/home/selk}. Considering
417 that you have exported the @env{PATH} as @samp{$@{HOME@}/usr/bin}, now the
418 system is able to see the recent lzip.
421 Installing from a list of packages using standard input:
424 qi -i - < PACKAGELIST.txt
427 Or in combination with another tool:
429 sort -u PACKAGELIST.txt | qi -i -
432 The list of packages must contain full path names to be passed in the
435 /var/cache/qi/packages/tcl-8.6.9-x86_64+1.tlz
436 /var/cache/qi/packages/tk-8.6.9.1-x86_64+1.tlz
437 /var/cache/qi/packages/vala-0.42.3-x86_64+1.tlz
440 @section Removing packages
441 @cindex package de-installation
443 To remove a package, simply type:
446 qi -d xz-5.2.4-i586+1.tlz
450 Delete mode will match the package name using @samp{$@{packagedir@}} as
451 prefix. For example, if the value of @samp{$@{packagedir@}} is set to
452 /usr/pkg, this will be equal to:
455 qi -d /usr/pkg/xz-5.2.4-i586+1
459 Detailed output (very verbose):
462 qi -d -v /usr/pkg/xz-5.2.4-i586+1
465 A second -v gives more.
468 By default the delete mode does not preserve a package directory after
469 removing its links from @samp{$@{targetdir@}}, but this behavior can be
470 changed if the -k option is passed:
473 qi -d -k /usr/pkg/lzip-1.21-i586+1
476 This means that the links to the package can be reactivated, later:
479 cd /usr/pkg && graft -i lzip-1.21-i586+1
483 Removing package from a different location:
486 qi -r /home/cthulhu -d xz-5.2.4-i586+1
490 Removing a package using standard input:
493 echo "vala-0.42.3-x86_64+1" | qi -d -
496 This will match with the package directory.
498 @section Upgrading packages
499 @cindex package upgrade
501 The upgrade mode inherits the properties of the installation and removal
502 process. To make sure that a package is updated, the package is installed
503 in a temporary directory taking @samp{$@{packagedir@}} into account. Once
504 the incoming package is pre-installed, qi can proceed to search and delete
505 packages that have the same name (considered as previous ones). Finally,
506 the package is re-installed at its final location and the temporary
507 directory is removed.
510 To upgrade a package, just type:
513 qi -u gcc-9.0.1-i586+1.tlz
516 This will proceed to upgrade "gcc-9.0.1-i586+1" removing any other version
520 If you want to keep the package directories of versions found during the
521 upgrade process, just pass:
524 qi -u -k gcc-9.0.1-i586+1.tlz
528 To see the upgrade process (very verbose):
531 qi -u -v gcc-9.0.1-i586+1.tlz
534 A second -v gives more.
537 To force the upgrade of an existing package:
540 qi -u -f gcc-9.0.1-i586+1.tlz
543 @subsection Package blacklist
544 @cindex package blacklist
546 To implement general package facilities, either to install, remove or
547 maintain the hierarchy of packages in a clean manner, qi makes use of the
548 pruning operation via graft(1) by default:
550 There is a risk if those are crucial packages for the proper functioning
551 of the system, because it implies the deactivation of symbolic from the
552 target directory, @emph{especially} when transitioning an incoming package
553 into its final location during upgrade.
556 A blacklist of package names has been devised for the case where
557 a user decides to upgrade all packages in the system, or
558 just the crucial ones, such as the C library.
560 The blacklist is related to the upgrade mode only, consists in installing
561 a package instead of updating it or removing previous versions of it;
562 the content of the package will be updated over the existing content at
563 @samp{$@{packagedir@}}, while the existing links from
564 @samp{$@{targetdir@}} will be preserved. A pruning of links will be
565 carried out in order to re-link possible differences with the recent
566 content, this helps to avoid leaving dead links in the target directory.
569 The package names for the blacklist to be declared must be set from
570 the configuration file.
577 A recipe is a file telling qi what to do. Most often, the recipe tells
578 qi how to build a binary package from a source tarball.
580 A recipe has two parts: a list of variable definitions and a list of
581 sections. By convention, the syntax of a section is:
590 The section name is followed by parentheses, one newline and an opening
591 brace. The line finishing the section contains just a closing brace.
592 The section names or the function names currently recognized are
595 The @samp{build} section is an augmented shell script. This is the main
596 section (or @strong{shell function}) which contains the instructions to
597 build and produce a package.
602 A "variable" is a @strong{shell variable} defined either in @file{qirc}
603 or in a recipe to represent a string of text, called the variable's
604 "value". These values are substituted by explicit request in the
605 definitions of other variables or in calls to external commands.
607 Variables can represent lists of file names, options to pass to
608 compilers, programs to run, directories to look in for source files,
609 directories to write output to, or anything else you can imagine.
611 Definitions of variables in qi have four levels of precedence.
612 Options which define variables from the command-line override those
613 specified in the @file{qirc} file, while variables defined in the recipe
614 override those specified in @file{qirc}, taking priority over those
615 variables set by command-line options. Finally, the variables have
616 default values if they are not defined anywhere.
618 Options that set variables through the command-line can only reference
619 variables defined in @file{qirc} and variables with default values.
621 Definitions of variables in @file{qirc} can only reference variables
622 previously defined in @file{qirc} and variables with default values.
624 Definitions of variables in the recipe can only reference variables
625 set by the command-line, variables previously defined in the recipe,
626 variables defined in @file{qirc}, and variables with default values.
628 @section Special variables
629 @cindex special variables
631 There are variables which can only be set using the command line options or
632 via @file{qirc}, there are other special variables which can be defined or
633 redefined in a recipe. See the following definitions:
635 @samp{outdir} is the directory where the packages produced are written.
636 This variable can be redefined per-recipe. Default sets to
637 @samp{/var/cache/qi/packages}.
639 @samp{worktree} is the working tree where archives, patches, and recipes
640 are expected. This variable can not be redefined in the recipe. Default
641 sets to @samp{/usr/src/qi}.
643 @samp{tardir} is defined in the recipe to the directory where the tarball
644 containing the source can be found. The full name of the tarball is
645 composed as @samp{$@{tardir@}/$tarname}. Its value is available in the
646 recipe as @samp{$@{tardir@}}; a value of . for @samp{tardir} sets it to
647 the value of CWD (Current Working Directory), this is where the recipe
650 @samp{arch} is the architecture to compose the package name. Its value is
651 available in the recipe as @samp{$@{arch@}}. Default value is the output
654 @samp{jobs} is the number of parallel jobs to pass to the compiler. Its
655 value is available in the recipe as @samp{$@{jobs@}}. The default value
658 The two variables @samp{$@{srcdir@}} and @samp{$@{destdir@}} can be
659 set in the recipe, as any other variable, but if they are not, qi uses
660 default values for them when building a package.
662 @samp{srcdir} contains the source code to be compiled, and defaults to
663 @samp{$@{program@}-$@{version@}}. @samp{destdir} is the place where the
664 built package will be installed, and defaults to
665 @samp{$@{TMPDIR@}/package-$@{program@}}.
667 If @samp{pkgname} is left undefined, the special variable @samp{program}
668 is assigned by default. If @samp{pkgversion} is left undefined, the
669 special variable @samp{version} is assigned by default.
671 @samp{pkgname} and @samp{pkgversion} along with: @samp{version}, @samp{arch},
672 @samp{release}, and (optionally) @samp{pkgcategory} are used to produce the
673 package name in the form:
674 @samp{$@{pkgname@}-$@{pkgversion@}-$@{arch@}+$@{release@}[@@$@{pkgcategory@}].tlz}
676 @samp{pkgcategory} is an optional special variable that can be defined on the
677 recipe to categorize the package name. If it is defined, then the
678 package output will be composed as
679 @samp{$@{pkgname@}-$@{pkgversion@}-$@{arch@}+$@{release@}@@$@{pkgcategory@}.tlz}.
680 Automatically, the value of @samp{pkgcategory} will be prefixed using the
683 A special variable called @samp{replace} can be used to declare package names
684 that will be replaced at installation time.
687 A typical recipe contains the following variables:
690 @item @samp{program}: Software name.
692 It matches the source name. It is also used to compose the name of the
693 package if @samp{$@{pkgname@}} is not specified.
695 @item @samp{version}: Software version.
697 It matches the source name. It is also used to compose the version of the
698 package if @samp{$@{pkgversion@}} is not specified.
700 @item @samp{arch}: Software architecture.
702 It is used to compose the architecture of the package in which it is
705 @item @samp{release}: Release number.
707 This is used to reflect the release number of the package. It is
708 recommended to increase this number after any significant change in
709 the recipe or post-install script.
711 @item @samp{pkgcategory}: Package category.
713 Optional but recommended variable to categorize the package name when it is
718 Obtaining sources over the network must be declared in the recipe using
719 the @samp{fetch} variable.
721 The variables @samp{netget} and @samp{rsync} can be defined in @file{qirc}
722 to establish a network downloader in order to get the sources. If they
723 are not defined, qi uses default values:
725 @samp{netget} is the general network downloader tool, defaults sets to
726 @samp{wget -c -w1 -t3 --no-check-certificate}.
728 @samp{rsync} is the network tool for sources containing the prefix for
729 the RSYNC protocol, default sets to
730 @samp{rsync -v -a -L -z -i --progress}.
732 The variable @samp{description} is used to print the package description
733 when a package is installed.
735 A description has two parts: a brief description, and a long description.
736 By convention, the syntax of @samp{description} is:
746 The first line of the value represented is a brief description of the
747 software (called "blurb"). A blank line separates the @emph{brief
748 description} from the @emph{long description}, which should contain a more
749 descriptive description of the software.
752 An example looks like:
756 The GNU core utilities.
758 The GNU core utilities are the basic file, shell and text manipulation
759 utilities of the GNU operating system. These are the core utilities
760 which are expected to exist on every operating system.
764 Please consider a length limit of 78 characters as maximum, because the same
765 one would be used on the meta file creation. See
766 @ref{Recipes, The meta file} section.
768 The @samp{homepage} variable is used to declare the main site or home page:
771 homepage=http://www.gnu.org/software/gcc
774 The variable @samp{license} is used for license information@footnote{
775 The proposal for @samp{license} was made by Richard M. Stallman at
776 @url{http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html}.}.
777 Some code in the program can be covered by license A, license B, or
778 license C. For "separate licensing" or "heterogeneous licensing", we
779 suggest using @strong{|} for a disjunction, @strong{&} for a conjunction
780 (if that ever happens in a significant way), and comma for heterogeneous
781 licensing. Comma would have lower precedence, plus added special terms.
784 license="LGPL, GPL | Artistic + added permission"
787 @section Writing recipes
788 @cindex writing recipes
790 Originally, Qi was designed for the version 3 of Dragora GNU/Linux; this
791 doesn't mean you can't use it in another distribution, just that if you do,
792 you'll have to try it out for yourself. To help with this, here are some
793 references to well-written recipes:
796 @item @url{http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes}
797 @item @url{http://notabug.org/dragora/dragora/src/master/recipes}
800 @section Building packages
801 @cindex package build
803 A recipe is any valid regular file. Qi sets priorities for reading a
804 recipe, the order in which qi looks for a recipe is:
808 Current working directory.
811 If the specified path name does not contain "recipe" as the last
812 component. Qi will complete it by adding "recipe" to the path name.
815 If the recipe is not in the current working directory, it will be
816 searched under @samp{$@{worktree@}/recipes}. The last component will be
817 completed adding "recipe" to the specified path name.
821 To build a single package, type:
828 Multiple jobs can be passed to the compiler to speed up the build process:
831 qi -b -j3 x-apps/xterm
835 Update or install the package produced (if it is not already installed)
839 qi -b -j3 -u x-apps/xterm
843 Only process a recipe but do not create the binary package:
849 The options -i or -u have no effect when -n is given.
852 This can be useful to inspect the build process of recipe:
854 qi -b -k -n dict/aspell 2>&1 | tee aspell-buildlog.txt
856 The -k option could preserve the source directory and the destination
857 directory for later inspection. A log file of the build process will be
858 created redirecting both, standard error and standard output to tee(1).
860 @section Variables from the environment
861 @cindex environment variables
863 Qi has environment variables which can be used at build time:
865 The variable @env{TMPDIR} sets the temporary directory for sources, which is
866 used for package extractions (see @ref{Examining packages}) and is
867 prepended to the value of @samp{$@{srcdir@}} and @samp{$@{destdir@}} in
868 build mode. By convention its default value is equal to
869 @samp{/usr/src/qi/build}.
871 The variables @env{QICFLAGS}, @env{QICXXFLAGS}, and @env{QILDFLAGS} have
872 no effect by default. The environment variables such as @env{CFLAGS},
873 @env{CXXFLAGS}, and @env{LDFLAGS} are unset at compile time:
876 Recommended practice is to set variables in the command line of
877 @samp{configure} or @emph{make(1)} instead of exporting to the
878 environment. As follows:
880 @url{http://www.gnu.org/software/make/manual/html_node/Environment.html}
882 It is not wise for makefiles to depend for their functioning on environment
883 variables set up outside their control, since this would cause different
884 users to get different results from the same makefile. This is against the
885 whole purpose of most makefiles.
888 Setting environment variables for configure is deprecated because running
889 configure in varying environments can be dangerous.
891 @url{http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html}
893 Variables not defined in a site shell script can be set in the environment
894 passed to configure. However, some packages may run configure again
895 during the build, and the customized values of these variables may be
896 lost. In order to avoid this problem, you should set them in the
897 configure command line, using @samp{VAR=value}. For example:
899 @code{./configure CC=/usr/local2/bin/gcc}
902 @url{http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html}
904 If for instance the user runs @samp{CC=bizarre-cc ./configure}, then the cache,
905 config.h, and many other output files depend upon bizarre-cc being the C
906 compiler. If for some reason the user runs ./configure again, or if it is
907 run via @samp{./config.status --recheck}, (See Automatic Remaking, and see
908 config.status Invocation), then the configuration can be inconsistent,
909 composed of results depending upon two different compilers.
911 Indeed, while configure can notice the definition of CC in @samp{./configure
912 CC=bizarre-cc}, it is impossible to notice it in @samp{CC=bizarre-cc
913 ./configure}, which, unfortunately, is what most users do.
915 configure: error: changes in the environment can compromise the build.
918 @section The meta file
919 @cindex the meta file
921 The "meta file" is a regular file created during the build mode, it
922 contains information about the package such as package name, package
923 version, architecture, release, fetch address, description, and other
924 minor data extracted from processed recipes. The name of the file is
925 generated as @samp{$@{full_pkgname@}.tlz.txt}, and its purpose is to
926 reflect essential information to the user without having to look inside
927 the package content. The file format is also intended to be used by
928 other scripts or by common Unix tools.
930 The content of a meta file looks like:
934 # Pattern scanning and processing language.
936 # The awk utility interprets a special-purpose programming language
937 # that makes it possible to handle simple data-reformatting jobs
938 # with just a few lines of code. It is a free version of 'awk'.
940 # GNU awk implements the AWK utility which is part of
941 # IEEE Std 1003.1 Shell and Utilities (XCU).
952 full_pkgname=gawk-5.0.1-x86_64+1@@tools
953 blurb="Pattern scanning and processing language."
954 homepage="http://www.gnu.org/software/gawk"
956 fetch="http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz"
960 Package descriptions are extracted from the variable @samp{description}
961 where each line is interpreted literally and pre-formatted to fit in
962 (exactly) @strong{80 columns}, plus the character @samp{#} and a blank
963 space is prefixed to every line (shell comments).
966 In addition to the Special variables, there are implicit variables such as
969 The @samp{blurb} variable is related to the special variable
970 @samp{description}. Its value is made from the first (substantial)
971 line of @samp{description}, mentioned as the "brief description".
976 @cindex handling build order
978 The order mode has the purpose of resolving the build order through
979 .order files. An order file contains a list of recipe names, by default
980 does not perform any action other than to print a resolved list in
981 descending order. For example, if @strong{a} depends on @strong{b} and
982 @strong{c}, and @strong{c} depends on @strong{b} as well, the file might
991 Each letter represents a recipe name, complete dependencies for
992 the first recipe name are listed in descending order, which is
993 printed from right to left, and removed from left to right:
1003 Blank lines, colons and parentheses are simply ignored. Comment lines
1004 beginning with @samp{#} are allowed.
1007 An order file could be used to build a series of packages, for example,
1011 # Image handling libraries
1013 libs/libjpeg-turbo: devel/nasm
1014 x-libs/jasper: libs/libjpeg-turbo
1015 libs/tiff: libs/libjpeg-turbo
1018 To proceed with each recipe, we can type:
1021 qi -o imglibs.order | qi -b -i -
1024 The output of @samp{qi -o imglibs.order} tells to qi in which order it
1025 should build the recipes:
1035 @node Creating packages
1036 @chapter Creating packages
1037 @cindex package creation
1039 The "creation mode" is an internal function of qi to make new Qi compatible
1040 compatible packages, the creation mode is selected by the -c option.
1041 A package is produced using the contents of the Current Directory, and
1042 the package file is written out.
1045 Usage: qi -c [@var{Output/PackageName.tlz}]...
1048 The argument for the file name to be written must contain a fully
1049 qualified named directory as the output directory where the package
1050 produced will be written. The file name should be composed using the
1051 full name: name-version-architecture+release.tlz
1057 cd claws-mail-3.17.1-x86_64+1
1058 qi -c /var/cache/qi/packages/claws-mail-3.17.1-x86_64+1.tlz
1061 In this case, the package "claws-mail-3.17.1-x86_64+1.tlz" will be written
1062 into @samp{/var/cache/qi/packages/}.
1065 All packages produced are complemented by a checksum file (.sha256).
1068 @node Examining packages
1069 @chapter Examining packages
1070 @cindex package examination
1072 The "extraction mode" serves to examine binary packages for debugging
1073 purposes. The extraction mode is selected by the -x option. It
1074 decompresses a package into a single directory, verifying its integrity
1075 and preserving its properties.
1078 Usage: qi -x [@var{packagename.tlz}]...
1084 qi -x mksh-R56c-x86_64+1.tlz
1087 This action will put the content of "mksh-R56c-x86_64+1.tlz" into a
1088 single directory, this will be a private directory for the user who
1090 requested the action, creation mode will be equal to @strong{u=rwx,g=,o=
1091 (0700)}. The package content will reside on this location, default
1092 mask to deploy the content will be equal to
1093 @strong{u=rwx,g=rwx,o=rwx (0000)}.
1096 The creation of the custom directory is influenced by the value of the
1097 @env{TMPDIR} variable.
1101 @chapter Exit status
1104 All the exit codes are described in this chapter.
1108 Successful completion (no errors).
1111 Minor common errors:
1114 @item Help usage on illegal options or required arguments.
1116 @item Program needed by qi (prerequisite) is not available.
1120 Command execution error:
1122 This code is used to return the evaluation of external commands and shell
1123 arguments in case of error.
1126 Integrity check error for compressed files.
1128 Compressed files means:
1131 @item Tarball files from tar(1).
1132 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1135 @item Tarball files from tarlz(1).
1136 Supported extensions: .tar.lz, .tlz
1138 @item Zip files from unzip(1).
1139 Supported extensions: .zip, .ZIP
1141 @item Gzip files from gzip(1).
1142 Supported extensions: .gz, .Z
1144 @item Bzip2 files from bzip2(1).
1145 Supported extension: .bz2
1147 @item Lzip files from lzip(1).
1148 Supported extension: .lz
1150 @item Xz files from xz(1).
1151 Supported extension: .xz
1155 File empty, not regular, or expected.
1157 Commonly, it is expected:
1160 @item An argument for the mode of operation.
1162 @item A readable file or directory.
1164 @item A binary package (.tlz).
1166 @item A valid recipe.
1168 @item An order file (.order).
1170 @item A protocol supported by the network downloader tool.
1172 @item A checksum file (.sha256).
1176 Empty or not defined variable:
1178 This code is used to report empty or undefined variables; usually,
1179 variables coming from a recipe or assigned arrays that are tested.
1182 Package already installed:
1184 The package directory for an incoming .tlz package already exists.
1187 Network manager error:
1189 This code is used if the network downloader tool fails for some reason.