diff options
author | Florian Festi <ffesti@redhat.com> | 2020-02-03 09:25:47 +0100 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2020-02-27 12:17:45 +0100 |
commit | 2fcccaaf245f363659cd0703293ab7c8694e8c6d (patch) | |
tree | 4309fd88231d7e9417bc8fb12a871cc217e847de | |
parent | c9380471adfa9fb06ace251a5f02b348507db345 (diff) | |
download | rpm-2fcccaaf245f363659cd0703293ab7c8694e8c6d.tar.gz |
Add isTransientReq macro
Centralize the logic in one place to make it easier to add new qualifiers
These relations are only relevant during installation and are ignored at some
places e.g. when processing already installed packages. They are also not added
to the rpmdb indexes.
The way the qualifiers work is a bit peculiar as no qualifier means the
relation is always relevant. Adding any qualifier restricts the the relation
to this particular place and time. But adding more qulifiers do not further
restrict the validity of the relation but adds more relevant cases.
So here there are three cases:
No qualifiers, only install only qualifiers, install only qualifiers that
get overruled by others
-rw-r--r-- | lib/depends.c | 2 | ||||
-rw-r--r-- | lib/rpmdb.c | 3 | ||||
-rw-r--r-- | lib/rpmds.h | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/depends.c b/lib/depends.c index ede02610c..6acb21dc3 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -689,7 +689,7 @@ retry: } /* Dont look at pre-requisites of already installed packages */ - if (!adding && isInstallPreReq(dsflags) && !isErasePreReq(dsflags)) + if (!adding && isTransientReq(dsflags)) goto exit; /* Handle rich dependencies */ diff --git a/lib/rpmdb.c b/lib/rpmdb.c index a07281376..ad723db81 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -2243,8 +2243,7 @@ rpmRC tag2index(dbiIndex dbi, rpmTagVal rpmtag, case RPMTAG_REQUIRENAME: { /* Filter out install prerequisites. */ rpm_flag_t *rflag = rpmtdNextUint32(&reqflags); - if (rflag && isInstallPreReq(*rflag) && - !isErasePreReq(*rflag)) + if (rflag && isTransientReq(*rflag)) continue; break; } diff --git a/lib/rpmds.h b/lib/rpmds.h index d160c948e..cf3c7eb3a 100644 --- a/lib/rpmds.h +++ b/lib/rpmds.h @@ -90,7 +90,8 @@ typedef rpmFlags rpmsenseFlags; #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK) #define isUnorderedReq(_x) ((_x) & _UNORDERED_ONLY_MASK && \ !((_x) & _FORCE_ORDER_ONLY_MASK)) - +#define isTransientReq(_x) (isInstallPreReq(_x) && \ + !isErasePreReq(_x)) /** \ingroup rpmds * Return only those flags allowed for given type of dependencies |