summaryrefslogtreecommitdiff
path: root/recipes/rpm/files/missingok.patch
blob: b008c9a02b0c83be871a2caaf43c7ab8ae5d98ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Obey MISSINGOK flag for dependencies. Backport from rpm-4.4.7.

Index: lib/depends.c
===================================================================
--- lib/depends.c.orig	2008-04-01 08:28:22.000000000 +0100
+++ lib/depends.c	2008-09-04 14:09:58.000000000 +0100
@@ -593,8 +593,13 @@
 /*@=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:
     /*
@@ -963,6 +968,8 @@
 	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:";
Index: lib/rpmlib.h
===================================================================
--- lib/rpmlib.h.orig	2008-09-03 22:22:43.000000000 +0100
+++ lib/rpmlib.h	2008-09-04 15:17:17.000000000 +0100
@@ -562,6 +562,8 @@
     RPMSENSE_SCRIPT_POSTUN | \
     RPMSENSE_SCRIPT_VERIFY | \
     RPMSENSE_FIND_REQUIRES | \
+    RPMSENSE_MISSINGOK | \
+    RPMSENSE_STRONG | \
     RPMSENSE_SCRIPT_PREP | \
     RPMSENSE_SCRIPT_BUILD | \
     RPMSENSE_SCRIPT_INSTALL | \