q applets/fr

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Q applets and the translation is 45% complete.

Other languages:
English • ‎français • ‎português do Brasil • ‎русский • ‎日本語 • ‎한국어

Resources

Les q applets sont une collection de petits outils de requête (query) rapide de Portage écrits en C. Elles sont conçues pour offrir une alternative plus rapide, mais plus limité à leurs homologues de app-portage/gentoolkit.

Les lecteurs noteront que les q applets n'ont pas été crées pour remplacer gentoolkit; elles peuvent simplement être plus efficaces que les utilitaires équivalents de gentoolkit et peuvent être plus adaptées à l'utilisation au sein de scripts qui doivent appeler Portage de manière répétée. Ils "n'offrent" pas les mêmes fonctionnalités. Les q applets ne prennent pas en compte les eclasses et ne fournissent pas d'outils tels que revdep-rebuild ou glsa-check.

Installation

USE flags

USE flags for app-portage/portage-utils Small and fast Portage helper tools written in C

libressl Use dev-libs/libressl instead of dev-libs/openssl when applicable (see also the ssl useflag)
nls Add Native Language Support (using gettextGNU locale utilities)
openmp Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp"
qmanifest Build qmanifest applet, this adds additional dependencies for GPG, OpenSSL and BLAKE2B hashing
qtegrity Build qtegrity applet, this adds additional dependencies for OpenSSL
static !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically

Emerge

Install the q applets:

root #emerge --ask app-portage/portage-utils

Usage

Invocation

The complete list of applications that are provided by app-portage/portage-utils can be listed by typing man q or q --help. Please read the man page for each utility described, as this guide is only meant to be a short reference for the most useful functions and does not include all the information about each application.

To see the available applets with a short description of their function, use q --help:

user $q --help
usage: q <applet> <args>  : invoke a portage utility applet
 
currently defined applets:
        q <applet> <args> : virtual applet
    qatom <pkg>           : split atom strings
   qcheck <pkgname>       : verify integrity of installed packages
 qdepends <pkgname>       : show dependency info
    qfile <filename>      : list all pkgs owning files
    qgrep <expr> [pkg ...]: grep in ebuilds
 qkeyword <action> <args> : list packages based on keywords
    qlist <pkgname>       : list files owned by pkgname
     qlop <pkgname>       : emerge log analyzer
 qmanifest <misc args>     : verify or generate thick Manifest files
   qmerge <pkgnames>      : fetch and merge binary package
     qpkg <misc args>     : create or manipulate Gentoo binpkgs
  qsearch <regex>         : search pkgname/desc
    qsize <pkgname>       : calculate size usage
    qtbz2 <misc args>     : manipulate tbz2 packages
 qtegrity <misc args>     : verify files with IMA
     quse <useflag>       : find pkgs using useflags
    qxpak <misc args>     : manipulate xpak archives
 
options: -[ioemvqChV]
  -i, --install    * Install symlinks for applets
  -o, --overlays   * Print available overlays (read from repos.conf)
  -e, --envvar     * Print used variables and their found values
  -m, --masks      * Print (package.)masks for the current profile
      --root <arg> * Set the ROOT env var
  -v, --verbose    * Report full package versions, emit more elaborate output
  -q, --quiet      * Tighter output; suppress warnings
  -C, --nocolor    * Don't output color
  -h, --help       * Print this help and exit
  -V, --version    * Print version and exit
}}

=== How to find a package to which a file belongs (qfile) ===

The {{c|qfile}} command finds the package to which a file belongs: 

{{Cmd|qfile /etc/fonts/fonts.conf|output=<pre>
media-libs/fontconfig (/etc/fonts/fonts.conf)
user $qfile /usr/share/keymaps/atari/atari-uk-falcon.map.gz
sys-apps/kbd (/usr/share/keymaps/atari/atari-uk-falcon.map.gz)

Verifying package integrity (qcheck)

Pour vérifier les sommes de contrôle MD5 ou les horaires de modification des fichiers installés par un paquet, utilisez le programme qcheck :

user $qcheck portage-utils
Checking app-portage/portage-utils-0.1.13 ...
  * 36 out of 36 files are good

Tous les fichiers qui ont été changés après l'installation seront reportés ici. Les fichiers de configuration qui ont été édités manuellement après l'installation seront également reportés. La plupart des paquets ne nécessitent pas les permissions root. Cependant, si un paquet a des fichiers qui ne sont accessibles qu'à root, qcheck devrait être lancé en tant que root.

Pour vérifier l'intégrité de tous les paquets installés, entrez :

root #qcheck

Lister les dépendances d'un paquet (qdepends)

qdepends peut lister les dépendances d'un paquet dans chaque direction. Sans options pour lister les dépendances installées DEPEND (-d), RDEPEND (-r), PDEPEND (-p) ou BDEPEND (-b), toutes les dépendances requises par un paquet sont affichées fusionnées dans une seule liste. Utilisez -v afin d'obtenir une liste de dépendances formatée compatible au shell en sortie, comme trouvé dans les ebuilds.

user $qdepends mutt
mail-client/mutt-1.13.1: >=app-portage/elt-patches-20170815 >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= dev-db/lmdb:0/0.9.24= virtual/libintl www-client/w3m !<sys-devel/gettext-0.18.1.1-r3 dev-libs/libxslt dev-libs/libxml2 >=sys-devel/automake-1.16.1:1.16 >=sys-devel/libtool-2.4 >=sys-devel/autoconf-2.69 net-dns/libidn2 virtual/libiconv >=app-crypt/gpgme-0.9.0:1/11= www-client/elinks app-misc/mime-types app-text/docbook-xsl-stylesheets >=dev-libs/cyrus-sasl-2 www-client/lynx net-mail/mailbase >=sys-libs/ncurses-5.2:0/6=

Utilisez -v pour obtenir une liste de dépendances formatée compatible au shell en sortie, comme trouvé dans les ebuilds.

user $qdepends -rv mutt
mail-client/mutt-1.13.1:
RDEPEND="
    app-misc/mime-types
    virtual/libiconv
    dev-db/lmdb:0/0.9.24=
    dev-libs/libressl:0/47=
    virtual/libintl
    >=dev-libs/cyrus-sasl-2
    net-dns/libidn2
    >=app-crypt/gpgme-0.9.0:1/11=
    >=sys-libs/ncurses-5.2:0/6=
"

Pour lister les paquets qui dépendent sur un paquet, utilisez l'option -Q.

user $qdepends -Q mime-types
mail-client/mutt-1.13.1: >=app-portage/elt-patches-20170815 >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= dev-db/lmdb:0/0.9.24= virtual/libintl www-client/w3m !<sys-devel/gettext-0.18.1.1-r3 dev-libs/libxslt dev-libs/libxml2 >=sys-devel/automake-1.16.1:1.16 >=sys-devel/libtool-2.4 >=sys-devel/autoconf-2.69 net-dns/libidn2 virtual/libiconv >=app-crypt/gpgme-0.9.0:1/11= app-misc/mime-types www-client/elinks app-text/docbook-xsl-stylesheets >=dev-libs/cyrus-sasl-2 www-client/lynx net-mail/mailbase >=sys-libs/ncurses-5.2:0/6=
dev-lang/python-2.7.16: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 virtual/libffi >=sys-devel/automake-1.16.1:1.16 >=dev-libs/expat-2.1 >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types >=sys-devel/autoconf-2.65 !!<sys-apps/portage-2.1.9 app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6=
dev-lang/python-3.7.2: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 virtual/libffi:0/7= dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= app-arch/xz-utils:0/0= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 >=sys-devel/automake-1.16.1:1.16 !!<sys-apps/sandbox-2.6-r1 >=dev-libs/expat-2.1:0/0= >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6=
dev-lang/python-3.6.8: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 virtual/libffi:0/7= dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= app-arch/xz-utils:0/0= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 >=sys-devel/automake-1.16.1:1.16 !!<sys-apps/sandbox-2.6-r1 >=dev-libs/expat-2.1:0/0= >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6=

Recherche d'ebuilds ou d'eclasses pour un schéma (qgrep)

qgrep peut être utilisé pour trouver les ebuilds qui mentionnent le nom d'un ebuild ("libechonest" est utilisé en exemple plus bas) en listant tous les paquets (installés ou non) qui dépendent sur un certain paquet:

user $qgrep -l libechonest
media-libs/libechonest/libechonest-2.0.2.ebuild
media-libs/libechonest/libechonest-2.2.0-r1.ebuild
media-libs/libechonest/libechonest-2.3.0.ebuild
media-libs/libechonest/libechonest-2.3.1.ebuild
media-libs/libechonest/libechonest-2.3.1-r1.ebuild
media-libs/libechonest/libechonest-9999.ebuild
media-sound/clementine/clementine-1.2.3.ebuild
media-sound/clementine/clementine-1.2.3-r1.ebuild
media-sound/clementine/clementine-1.3.1-r1.ebuild
media-sound/tomahawk/tomahawk-0.8.4-r3.ebuild
media-sound/tomahawk/tomahawk-9999.ebuild

L'option -J limitera la recherche aux paquets installés. -N affichera l'atom au lieu du nom de fichier.

user $qgrep -NJ net-print/cups
app-office/libreoffice-6.1.5.2: cups? ( net-print/cups )
dev-qt/qtprintsupport-5.11.3:   cups? ( >=net-print/cups-1.4 )
net-print/hplip-3.18.6: net-print/cups
net-print/hplip-3.18.6: hpijs? ( net-print/cups-filters[foomatic] )
net-print/cups-2.2.7:PDEPEND=">=net-print/cups-filters-1.0.43"
net-print/cups-filters-1.21.6:  >=net-print/cups-1.7.3
net-print/cups-filters-1.21.6:  !<=net-print/cups-1.5.9999
dev-java/icedtea-bin-3.10.0-r1: cups? ( >=net-print/cups-2.0% )
net-wireless/bluez-5.50-r2:     cups? ( net-print/cups:= )
app-text/ghostscript-gpl-9.26:  cups? ( >=net-print/cups-1.3.8 )
x11-libs/gtk+-2.24.32-r1:       cups? ( >=net-print/cups-1.7.1-r2:=[${MULTILIB_USEDEP}] )
x11-libs/gtk+-3.24.4-r1:        cups? ( >=net-print/cups-1.2[${MULTILIB_USEDEP}] )

Listing files that belong to an ebuild (qlist)

The qlist command gives a list of all files that belong to an ebuild.

user $qlist vim
/usr/bin/gvim
/usr/bin/gvimdiff
/usr/bin/evim
/usr/bin/eview
/usr/bin/gview
/usr/bin/rgvim
[...]

Looking for packages that use some USE flag (quse)

Les options de variable USE se listent avec quese. Dans ca forme la plus simple, cela liste les ebuilds qui utilisent une option de variable USE donnée.

user $quse firefox
app-misc/tracker/tracker-0.12.10-r1.ebuild applet doc eds elibc_glibc exif firefox-bookmarks flac flickr gif
[...]

Pour afficher la description d'une option de variable USE, l'option -D peut être utilisée. Elle peut être combinée avec l'option -p, qui prend un atom en argument, afin de lister les options de variable USE de l'atom donné.

user $quse -Dvp autogen
sys-devel/autogen-5.18.16-r1
  libopts       install the libopts tarball (a few packages want this for developing)
  static-libs   Build static versions of dynamic libraries as well

Finding package sizes (qsize)

To show the size of a package, use the qsize application:

user $qsize vim-core
app-editors/vim-core: 1846 files, 175 non-files, 28.5M 
[...]

Searching the Portage tree (qsearch)

One of the most powerful tools of app-portage/portage-utils is qsearch. This tool allows to search the Portage tree much faster than using the emerge -s command.

Here are some examples of its usage:

user $qsearch terminus
media-fonts/terminus-font: A clean fixed font for the console and X11

The homepage of packages can be queried using the -H option:

user $qsearch -H terminus
media-fonts/terminus-font: http://terminus-font.sourceforge.net/

In another example, let's look for a jabber client:

user $qsearch -S "jabber client"
app-emacs/emacs-jabber: A Jabber client for Emacs
net-im/coccinella: Jabber Client With a Built-in Whiteboard and VoIP (jingle)
net-im/gajim: Jabber client written in PyGTK
net-im/tkabber: A jabber client written in Tcl/Tk
net-im/vacuum: Qt Crossplatform Jabber client

Extracting information from emerge logs (qlop)

qlop allows to extract useful information from the emerge.log file. It can be useful when package compilation times need to be estimated or to compare build times with other systems. It also allows to check what is compiling at the moment and how long it will probably take - which is handy when working in the console and don't have any other means to check it.

Estimate how long a dev-lang/perl build takes:

user $qlop -a perl
dev-lang/perl: 7′12″ average for 3 merges

See what is emerging at the moment and how long the process has been running already:

user $qlop -rt
2019-12-31T03:07:16 >>> net-fs/samba: 6′19″... (82 of 85) ETA: 23s

See also


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Łukasz Damentko, , and Marcelo Góes
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.