[Rpm-maint] [rpm-software-management/rpm] Is it possible for an RPM package to have no version? (Discussion #2896)

2024-02-11 Thread Shane Bishop
### 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

[Rpm-maint] [rpm-software-management/rpm] How can I find details on the binary representation of the RPM DB? (Discussion #2211)

2022-09-29 Thread Shane Bishop
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

[Rpm-maint] [rpm-software-management/rpm] How to detect RPM version without running rpm --version? (Discussion #2213)

2022-09-30 Thread Shane Bishop
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

Re: [Rpm-maint] [rpm-software-management/rpm] How can I find details on the binary representation of the RPM DB? (Discussion #2211)

2022-09-30 Thread Shane Bishop
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

[Rpm-maint] [rpm-software-management/rpm] If I reuse the same rpmtd for multiple headerGet() or rpmtdGetString() calls, would this cause a memory leak? (Discussion #2492)

2023-04-19 Thread Shane Bishop
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)) {

Re: [Rpm-maint] [rpm-software-management/rpm] How can I find details on the binary representation of the RPM DB? (Discussion #2211)

2024-09-17 Thread Shane Bishop
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

Re: [Rpm-maint] [rpm-software-management/rpm] How can I find details on the binary representation of the RPM DB? (Discussion #2211)

2024-09-18 Thread Shane Bishop
@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#