summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2018-11-13 14:03:28 +0200
committerPanu Matilainen <pmatilai@redhat.com>2020-03-26 11:57:58 +0200
commita2156fcfe9b19497aff71c063fdde8be7278de7e (patch)
treea34b041e91d78b0a59f219093359b3a07ef51466
parent529350e6ef7d734c824ee39da73ef0ce1bda3b88 (diff)
downloadrpm-a2156fcfe9b19497aff71c063fdde8be7278de7e.tar.gz
Add + use a bitmask for order-agnostic dependency types
No functional changes but makes the information available to API users, and is more in line with the other IsFooPreReq() macros. (cherry picked from commit a75fc903e980a5a239dc77ee969bd2dd7f8e4bd9)
-rw-r--r--lib/order.c2
-rw-r--r--lib/rpmds.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/order.c b/lib/order.c
index 7a1dd10fd..ccf8dff1a 100644
--- a/lib/order.c
+++ b/lib/order.c
@@ -180,7 +180,7 @@ static inline int addRelation(rpmts ts,
dsflags = rpmdsFlags(requires);
/* Avoid dependendencies which are not relevant for ordering */
- if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS))
+ if (isUnorderedReq(rpmdsFlags(requires)))
return 0;
if (rpmdsIsRich(requires)) {
diff --git a/lib/rpmds.h b/lib/rpmds.h
index 4a16a1475..708f83066 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -80,10 +80,13 @@ typedef rpmFlags rpmsenseFlags;
_notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
#define _ERASE_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
+#define _UNORDERED_ONLY_MASK \
+ _notpre(RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
#define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
+#define isUnorderedReq(_x) ((_x) & _UNORDERED_ONLY_MASK)