rpm/missingok.diff

40 lines
1.3 KiB
Diff

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 | \