From 1247cd59e950621b58c83572d196ae3d0f1d1a17 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Sep 30 2022 08:51:01 +0000 Subject: Use 'rpm --query' where possible in GNU Hello tutorial The original rationale for using 'dnf repoquery' was to minimize the amount of different tools. 'dnf repoquery' can cover both actual repo queries and local rpm files. But it is clumsy in many ways: * if -C parameter is forgotten (and sometimes even if it is not), dnf downloads a large set of repodata that is not needed for anything. * Tab completion is quirky and slow. * The subcommand is called "repoquery", but it does not actually query any repo in this case. Because of such reasons, using 'rpm --query' is better. Long forms of all parameters are used, because this is a tutorial, so being explicit is good. Packagers can learn about the short options somewhere else. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index b5f98cc..724934c 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -433,6 +433,7 @@ Having a working specfile and rpms built from it, the result can be checked. Before checking the result by installing the package, let us do some simple checks. +The RPM Package Manager `rpm` can be used for this. === Files @@ -440,7 +441,7 @@ List the files contained in the package: [subs="attributes+"] ---- -$ dnf -C repoquery --list ./results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm +$ rpm --query --package --list results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm /usr/bin/hello /usr/lib/.build-id /usr/lib/.build-id/39 @@ -474,7 +475,7 @@ List the package's runtime dependencies with the following command: [subs="attributes+"] ---- -$ dnf -C repoquery --requires ./results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm +$ rpm --query --package --requires results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) @@ -490,7 +491,8 @@ rpmlib(PayloadIsZstd) <= 5.4.18-1 rtld(GNU_HASH) ---- -You can check what packages provide these dependencies as follows: +To check which packages in Fedora repositories provide these dependencies, +you can use `dnf repoquery`: [subs="attributes+"] ---- @@ -512,7 +514,7 @@ Conversely, to check what capabilities the package provides, you can do: [subs="attributes+"] ---- -$ dnf -C repoquery --provides ./results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm +$ rpm --query --package --provides results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.x86_64.rpm hello = 2.10-1.fc{MAJOROSVER} hello(x86-64) = 2.10-1.fc{MAJOROSVER} ----