aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sat-solver/sat-solver/sat-solver_core.patch
blob: 11bf5b01823ce40c811c66456f2b8b8691e054c7 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Upstream-Status: Inappropriate [distribution]

Fix "arch" integration with Poky.

Add a missing "any" architecture type and update the semantics to use it.

Disable the built-in archpolicies structure, and replace it with one
we generate in the recipe.

Also add poky semantics option in CMake.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Qing He <qing.he@intel.com>

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 443281e..4456a87 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,11 @@ MESSAGE(STATUS "Building for Debian")
 ADD_DEFINITIONS( -DDEBIAN -DDEBIAN_SEMANTICS)
 ENDIF ( DEBIAN )
 
+IF ( OE_CORE )
+MESSAGE(STATUS "Building for OE core")
+ADD_DEFINITIONS( -DOE_CORE -DOE_CORE_SEMANTICS)
+ENDIF ( OE_CORE )
+
 IF ( MULTI_SEMANTICS )
 MESSAGE(STATUS "Enabling multi dist support")
 ADD_DEFINITIONS( -DMULTI_SEMANTICS)
diff --git a/src/knownid.h b/src/knownid.h
index 7757ae0..4b8bee7 100644
--- a/src/knownid.h
+++ b/src/knownid.h
@@ -57,6 +57,7 @@ KNOWNID(SYSTEM_SYSTEM,			"system:system"),
 KNOWNID(ARCH_SRC,			"src"),
 KNOWNID(ARCH_NOSRC,			"nosrc"),
 KNOWNID(ARCH_NOARCH,			"noarch"),
+KNOWNID(ARCH_ANY,			"any"),
 KNOWNID(ARCH_ALL,			"all"),
 
 KNOWNID(REPOSITORY_SOLVABLES,		"repository:solvables"),
diff --git a/src/policy.c b/src/policy.c
index 55c8677..3356ff8 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -486,6 +486,13 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2)
     }
 
   /* we allow changes to/from noarch */
+#ifdef OE_CORE_SEMANTICS
+  if (a1 == a2 || 
+	a1 == ARCH_NOARCH || a2 == ARCH_NOARCH ||
+	a1 == ARCH_ANY || a2 == ARCH_ANY ||
+	a1 == ARCH_ALL || a2 == ARCH_ALL)
+    return 0;
+#else
 #ifndef DEBIAN_SEMANTICS
   if (a1 == a2 || a1 == ARCH_NOARCH || a2 == ARCH_NOARCH)
     return 0;
@@ -493,6 +500,7 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2)
   if (a1 == a2 || a1 == ARCH_ALL || a2 == ARCH_ALL)
     return 0;
 #endif
+#endif
   if (!pool->id2arch)
     return 0;
   a1 = a1 <= pool->lastarch ? pool->id2arch[a1] : 0;
diff --git a/src/poolarch.c b/src/poolarch.c
index 34a14a3..2d7cd70 100644
--- a/src/poolarch.c
+++ b/src/poolarch.c
@@ -20,38 +20,8 @@
 #include "poolarch.h"
 #include "util.h"
 
-const char *archpolicies[] = {
-  "x86_64",	"x86_64:i686:i586:i486:i386",
-  "i686",	"i686:i586:i486:i386",
-  "i586",	"i586:i486:i386",
-  "i486",	"i486:i386",
-  "i386",	"i386",
-  "s390x",	"s390x:s390",
-  "s390",	"s390",
-  "ia64",	"ia64:i686:i586:i486:i386",
-  "ppc64",	"ppc64:ppc",
-  "ppc",	"ppc",
-  "armv7nhl",	"armv7nhl:armv7hl",
-  "armv7hl",	"armv7hl",
-  "armv7l",	"armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
-  "armv6l",	"armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
-  "armv5tejl",	"armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
-  "armv5tel",	"armv5tel:armv5l:armv4tl:armv4l:armv3l",
-  "armv5l",	"armv5l:armv4tl:armv4l:armv3l",
-  "armv4tl",	"armv4tl:armv4l:armv3l",
-  "armv4l",	"armv4l:armv3l",
-  "armv3l",	"armv3l",
-  "sh3",	"sh3",
-  "sh4",	"sh4",
-  "sh4a",	"sh4a:sh4",
-  "sparc64v",	"sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc",
-  "sparc64",	"sparc64:sparcv9:sparcv8:sparc",
-  "sparcv9v",	"sparcv9v:sparcv9:sparcv8:sparc",
-  "sparcv9",	"sparcv9:sparcv8:sparc",
-  "sparcv8",	"sparcv8:sparc",
-  "sparc",	"sparc",
-  0
-};
+/* Provide the const char *archpolicies structure */
+#include "core-arch.h"
 
 void
 pool_setarch(Pool *pool, const char *arch)
@@ -71,10 +41,10 @@ pool_setarch(Pool *pool, const char *arch)
       pool->lastarch = 0;
       return;
     }
-#ifndef DEBIAN_SEMANTICS
-  id = ARCH_NOARCH;
-#else
+#if defined(DEBIAN_SEMANTICS) || defined(OE_CORE_SEMANTICS)
   id = ARCH_ALL;
+#else
+  id = ARCH_NOARCH;
 #endif
   lastarch = id + 255;
   id2arch = sat_calloc(lastarch + 1, sizeof(Id));