From ef382d2a806568a4eff81252d2aaf478eec85e3b Mon Sep 17 00:00:00 2001 From: Ivan Zakharyaschev Date: Mon, 25 Feb 2019 07:45:16 +0300 Subject: [PATCH] add disttag to struct availablePackage (like buildtime; affects rpm -U & interdep.c) --- lib/al.c | 2 +- lib/depends.h | 1 + lib/transaction.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/al.c b/lib/al.c index 7fa71fa..65c179f 100644 --- a/lib/al.c +++ b/lib/al.c @@ -386,7 +386,7 @@ alAddPackage(availableList al, p->depth = p->npreds = 0; memset(&p->tsi, 0, sizeof(p->tsi)); - (void) headerNVR(p->h, &p->name, &p->version, &p->release); + (void) headerNVRD(p->h, &p->name, &p->version, &p->release, &p->disttag); if (!hge(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch, NULL)) p->epoch = NULL; diff --git a/lib/depends.h b/lib/depends.h index 5feaeec..a3f3ae1 100644 --- a/lib/depends.h +++ b/lib/depends.h @@ -60,6 +60,7 @@ struct availablePackage { /*@null@*/ FD_t fd; int_32 * buildtime; +/*@dependent@*/ const char * disttag; /*!< Header disttag (if any). */ } ; /** \ingroup rpmdep diff --git a/lib/transaction.c b/lib/transaction.c index 35e6ef9..7e1a728 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1654,6 +1654,10 @@ int rpmRunTransactions( rpmTransactionSet ts, RPMMIRE_DEFAULT, alp->version); (void) rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, alp->release); + if (alp->disttag) { + (void) rpmdbSetIteratorRE(mi, RPMTAG_DISTTAG, + RPMMIRE_DEFAULT, alp->disttag); + } if (alp->buildtime && upgrade_honor_buildtime()) { sprintf(b, "%u", *alp->buildtime); (void) rpmdbSetIteratorRE(mi, RPMTAG_BUILDTIME,