Re: [Rpm-maint] [rpm-software-management/rpm] check for rpmlib version (Discussion #2841)

2024-01-15 Thread Oliver Kurth
I got that. It would be good if `rpmlib` had a macro that can just be tested, 
to save some work, and not having to write a hack to test for it. If you (or 
anyone) knows of any similar code that does that, it would be great if you can 
share.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2841#discussioncomment-8135815
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] check for rpmlib version (Discussion #2841)

2024-01-12 Thread Oliver Kurth
Thanks for replying.

I have this code:
```
...
} else if (strcmp(token, "nodb") == 0){
pConf->rpmTransFlags |= RPMTRANS_FLAG_NODB;
} else if (strcmp(token, "noconfigs") == 0){
pConf->rpmTransFlags |= RPMTRANS_FLAG_NOCONFIGS;
} else {
pr_err("unknown tsflag '%s'\n", token);
...
```
so for `RPMTRANS_FLAG_NODB` I want to build this conditionally, depending on 
whether `RPMTRANS_FLAG_NODB` is defined or not. As I said, I cannot use `#ifdef 
RPMTRANS_FLAG_NODB` because it's an enum value, not a macro. What do you 
recommend to do here?

FWIW, the project uses `cmake`. It's https://github.com/vmware/tdnf . Of course 
I could create some setting like `HAVE_RPMTRANS_FLAG_NODB` and set that as an 
argument to `cmake`, but I'd prefer something automatic.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2841#discussioncomment-8114545
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] check for rpmlib version (Issue #2840)

2024-01-11 Thread Oliver Kurth
Is there a way to check at compile time for the rpmlib version?

In this particular case I want to use the enum value `RPMTRANS_FLAG_NODB` of 
`enum rpmtransFlags_e` in `include/rpm/rpmts.h`, but stay compatible with older 
versions that do not have this implemented. Since it's an enum, I cannot use 
`#ifdef`. So alternatively I thought I can use a macro that lets me check the 
version of rpmlib.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2840
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] when rebuilding rpmdb database gets inconsistent when installing at the same time (#1761)

2021-08-25 Thread Oliver Kurth
Not sure why this needs to be mentioned, but obviously rebuilding the db 
continuously is a test scenario, not intended for everyday use. However, it 
does show that rebuilding the db, for example for transitioning from BDB to 
another db, may cause weird issues if an rpm operation happens at the same 
time,  like "every blue moon", and this cannot prevented easily. Nobody is 
trying to shoot themselves into the foot.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1761#issuecomment-905710089___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] when rebuilding rpmdb database gets inconsistent when installing at the same time (#1761)

2021-08-24 Thread Oliver Kurth
FWIW, I tried to fix this in `tdnf` (https://github.com/vmware/tdnf) by calling 
`rpmtxnBegin()` just after `rpmtsCreate()`, and `rpmtxnEnd()` just before 
`rpmtsFree()`, and I still see this problem.

Is see this in both Fedora 33 with sqlite and in Photon 4 with bdb. It does not 
seem related to the db backend.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1761#issuecomment-905112416___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] when rebuilding rpmdb database gets inconsistent when installing at the same time (#1761)

2021-08-21 Thread Oliver Kurth
There seems to be a race when locking the db using `rpm --rebuilddb`. If a 
package gets installed at the same time, the database gets inconsistent. To 
reproduce:

In one shell, continuously rebuild the db:
`while true; do echo "start"; rpm --rebuilddb; echo "done" ; done

In another shell, install an arbitrary package. There is no error:
```
[root@localhost ~]# rpm -Uv ./lsof-4.93.2-4.fc33.aarch64.rpm 
warning: waiting for transaction lock on /var/lib/rpm/.rpm.lock
Verifying packages...
Preparing packages...
lsof-4.93.2-4.fc33.aarch64
[root@localhost ~]#
```
Then check for it:
```
[root@localhost ~]# rpm -qi lsof
package lsof is not installed
[root@localhost ~]#
```
However, the bits are all there:
```
[root@localhost ~]# lsof -v
lsof version information:
revision: 4.93.2
...
```
This behavior reproduces reliably. Version is:
```
[root@localhost ~]# rpm --version
RPM version 4.16.1.2
[root@localhost ~]# 
```

Above repro is on Fedora 33. I observe the same behavior in Photon 4.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1761___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint