[Rpm-maint] [Suse patch] Soft dependencies 1/3: Requires(missingok) backport
Panu Matilainen
pmatilai at redhat.com
Mon Jun 4 12:33:29 UTC 2007
This is the "mostly harmless" part of the soft dependency stuff,
depsolvers can just ignore the whole thing and still perform sanely.
>From this patch onwards it gets hairier... and the whole soft dependency
concept is more than a little controversial. I like it, but for just a
maintenance release I don't think it's really appropriate to even begin
including it.
Posting the patch-set here anyway for discussion, I personally would
like to see the soft dependencies included some day :)
- Panu -
----
Obey MISSINGOK flag for dependencies. Backport from rpm-4.4.7.
--- ./lib/depends.c.orig 2005-12-14 19:51:34.000000000 +0000
+++ ./lib/depends.c 2006-01-27 21:05:13.000000000 +0000
@@ -581,8 +632,13 @@ retry:
/*@=boundsread@*/
unsatisfied:
- rc = 1; /* dependency is unsatisfied */
- rpmdsNotify(dep, NULL, rc);
+ if (rpmdsFlags(dep) & RPMSENSE_MISSINGOK) {
+ rc = 0; /* dependency is unsatisfied, but just a hint. */
+ rpmdsNotify(dep, _("(hint skipped)"), rc);
+ } else {
+ rc = 1; /* dependency is unsatisfied */
+ rpmdsNotify(dep, NULL, rc);
+ }
exit:
/*
@@ -975,6 +1082,8 @@ static inline /*@observer@*/ const char
return "Requires(postun):";
if (f & RPMSENSE_SCRIPT_VERIFY)
return "Requires(verify):";
+ if (f & RPMSENSE_MISSINGOK)
+ return "Requires(hint):";
if (f & RPMSENSE_FIND_REQUIRES)
return "Requires(auto):";
return "Requires:";
--- ./lib/rpmlib.h.orig 2005-12-15 14:50:30.000000000 +0000
+++ ./lib/rpmlib.h 2006-02-03 13:22:27.000000000 +0000
@@ -547,6 +561,7 @@ typedef enum rpmsenseFlags_e {
RPMSENSE_SCRIPT_POSTUN | \
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
+ RPMSENSE_MISSINGOK | \
RPMSENSE_SCRIPT_PREP | \
RPMSENSE_SCRIPT_BUILD | \
RPMSENSE_SCRIPT_INSTALL | \
More information about the Rpm-maint
mailing list