2021-01-05 16:40:08 +01:00
|
|
|
--- ./lib/backend/ndb/glue.c.orig 2021-01-05 15:36:03.097744355 +0000
|
2021-01-07 11:24:11 +01:00
|
|
|
+++ ./lib/backend/ndb/glue.c 2021-01-07 10:23:41.113114258 +0000
|
|
|
|
@@ -311,12 +311,13 @@ static void setdata(dbiCursor dbc, unsi
|
|
|
|
|
|
|
|
static rpmRC ndb_pkgdbPut(dbiIndex dbi, dbiCursor dbc, unsigned int *hdrNum, unsigned char *hdrBlob, unsigned int hdrLen)
|
|
|
|
{
|
|
|
|
+ struct ndbEnv_s *ndbenv = dbc->dbi->dbi_rpmdb->db_dbenv;
|
|
|
|
unsigned int hnum = *hdrNum;
|
|
|
|
int rc = RPMRC_OK;
|
2021-01-05 16:40:08 +01:00
|
|
|
|
|
|
|
if (hnum == 0) {
|
|
|
|
rc = rpmpkgNextPkgIdx(dbc->dbi->dbi_db, &hnum);
|
|
|
|
- if (!rc)
|
|
|
|
+ if (!rc && ndbenv->hdrNum == hnum)
|
|
|
|
setdata(dbc, hnum, 0, 0);
|
2020-12-21 16:31:25 +01:00
|
|
|
}
|
|
|
|
|
2021-01-07 11:24:11 +01:00
|
|
|
@@ -325,7 +326,8 @@ static rpmRC ndb_pkgdbPut(dbiIndex dbi,
|
2020-12-21 16:31:25 +01:00
|
|
|
|
|
|
|
if (!rc) {
|
2021-01-05 16:40:08 +01:00
|
|
|
dbc->hdrNum = hnum;
|
|
|
|
- setdata(dbc, hnum, 0, 0);
|
|
|
|
+ if (ndbenv->hdrNum == hnum)
|
|
|
|
+ setdata(dbc, hnum, 0, 0);
|
2020-12-21 16:31:25 +01:00
|
|
|
*hdrNum = hnum;
|
|
|
|
}
|
2021-01-05 16:40:08 +01:00
|
|
|
return rc;
|
2021-01-07 11:24:11 +01:00
|
|
|
@@ -333,8 +335,10 @@ static rpmRC ndb_pkgdbPut(dbiIndex dbi,
|
|
|
|
|
2020-12-21 16:31:25 +01:00
|
|
|
static rpmRC ndb_pkgdbDel(dbiIndex dbi, dbiCursor dbc, unsigned int hdrNum)
|
|
|
|
{
|
2021-01-07 11:24:11 +01:00
|
|
|
+ struct ndbEnv_s *ndbenv = dbc->dbi->dbi_rpmdb->db_dbenv;
|
2021-01-05 16:40:08 +01:00
|
|
|
dbc->hdrNum = 0;
|
|
|
|
- setdata(dbc, 0, 0, 0);
|
|
|
|
+ if (ndbenv->hdrNum == hnum)
|
|
|
|
+ setdata(dbc, 0, 0, 0);
|
2020-12-21 16:31:25 +01:00
|
|
|
return rpmpkgDel(dbc->dbi->dbi_db, hdrNum);
|
|
|
|
}
|
|
|
|
|