From ecd9aceb565be9b672091cbcb5b2db408dcb1d91 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 3 Aug 2012 11:59:12 +0300 Subject: [PATCH] Honor RPMSENSE_MISSINGOK flag in dependency checking - For now there's no way to set this flag from packages so it doesn't actually do anything, but it doesn't hurt anything either, allows Suse & friends to drop one patch (greetings Michael :) and there are might be some things we could use this for internally. --- lib/depends.c | 10 ++++++++-- lib/rpmds.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 7e3c437..ed8a2c5 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -534,8 +534,14 @@ retry: } unsatisfied: - rc = 1; /* dependency is unsatisfied */ - rpmdsNotify(dep, NULL, rc); + if (dsflags & RPMSENSE_MISSINGOK) { + /* note the result, but missingok deps are never unsatisfied */ + rpmdsNotify(dep, "(missingok)", 1); + } else { + /* dependency is unsatisfied */ + rc = 1; + rpmdsNotify(dep, NULL, rc); + } exit: return rc; diff --git a/lib/rpmds.h b/lib/rpmds.h index 84f4fbb..d096b67 100644 --- a/lib/rpmds.h +++ b/lib/rpmds.h @@ -72,7 +72,8 @@ typedef rpmFlags rpmsenseFlags; RPMSENSE_KEYRING | \ RPMSENSE_PRETRANS | \ RPMSENSE_POSTTRANS | \ - RPMSENSE_PREREQ) + RPMSENSE_PREREQ | \ + RPMSENSE_MISSINGOK) #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ) #define _INSTALL_ONLY_MASK \ -- 2.7.4