4 * create architecture policies
16 const char *archpolicies[] = {
17 "x86_64", "x86_64:i686:i586:i486:i386",
18 "i686", "i686:i586:i486:i386",
19 "i586", "i586:i486:i386",
22 "s390x", "s390x:s390",
24 "ia64", "ia64:i686:i586:i486:i386",
31 pool_setarch(Pool *pool, const char *arch)
35 unsigned int score = 0x10001;
42 pool->id2arch = xfree(pool->id2arch);
50 id2arch = xcalloc(lastarch + 1, sizeof(Id));
54 for (i = 0; archpolicies[i]; i += 2)
55 if (!strcmp(archpolicies[i], arch))
58 a = archpolicies[i + 1];
62 l = strcspn(a, ":=>");
63 if (l && l < sizeof(buf) - 1)
67 id = str2id(pool, buf, 1);
70 id2arch = xrealloc(id2arch, (id + 255 + 1) * sizeof(Id));
71 memset(id2arch + lastarch + 1, 0, (id + 255 - lastarch) * sizeof(Id));
87 pool->id2arch = id2arch;
88 pool->lastarch = lastarch;