### Context
Feel free to skip this context, and go straight to my question.
My team has written some software that uses librpm to retrieve the version and
release for every RPM package installed on a system (we use `RPMTAG_VERSION`
and `RPMTAG_RELEASE` respectively to retrieve this data). The so
I am trying to find an RPM version agnostic way to find details on installed
software on any Linux distro that uses RPM packages.
A co-worker found for one version of RPM that the magic byte array/slice
`[]byte{0, 1, 0x43, 0}` works for extracting each installed package from the
RPM DB using re
How can the RPM version be detected programmatically (in a language like Go or
C) using either a file or a system call, without running a subprocess `rpm
--version`?
For context, I am writing an application that needs to be highly performant,
and I want to avoid running child process if at all
I found that, starting with RPM 4.16, RPM uses an SQLite database
([reference](https://fedoraproject.org/wiki/Changes/RPM-4.16#Detailed_Description)).
>From querying my local table, I see there are the following tables:
```
sqlite> .tables
Basenames Name Sigmd5
I have the following C code:
```c
// Compile with:
// gcc -Wall -Wextra -Werror -Og -g -lrpm -lrpmio mre.c -o e
#include
#include
#include
#include
#include
#include
const char* getString(Header h, rpmTag tag, struct rpmtd_s* td) {
if (headerGet(h, tag, td, HEADERGET_DEFAULT)) {
An alternative to linking against librpm and using cgo is to use
https://github.com/knqyf263/go-rpmdb. Do this at your own risk - it is possible
that at any time, this third-party library could be incompatible with the RPM
DB.
--
Reply to this email directly or view it on GitHub:
https://githu
@jerome-diver, are you referring to
https://github.com/knqyf263/go-rpmdb/issues/54, or are you referring to some
other SQLite problem with https://github.com/knqyf263/go-rpmdb?
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2211#