2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * create architecture policies
23 const char *archpolicies[] = {
24 "x86_64", "x86_64:i686:i586:i486:i386",
25 "i686", "i686:i586:i486:i386",
26 "i586", "i586:i486:i386",
29 "s390x", "s390x:s390",
31 "ia64", "ia64:i686:i586:i486:i386",
38 pool_setarch(Pool *pool, const char *arch)
42 unsigned int score = 0x10001;
49 pool->id2arch = sat_free(pool->id2arch);
57 id2arch = sat_calloc(lastarch + 1, sizeof(Id));
61 for (i = 0; archpolicies[i]; i += 2)
62 if (!strcmp(archpolicies[i], arch))
65 a = archpolicies[i + 1];
69 l = strcspn(a, ":=>");
70 if (l && l < sizeof(buf) - 1)
74 id = str2id(pool, buf, 1);
77 id2arch = sat_realloc(id2arch, (id + 255 + 1) * sizeof(Id));
78 memset(id2arch + lastarch + 1, 0, (id + 255 - lastarch) * sizeof(Id));
94 pool->id2arch = id2arch;
95 pool->lastarch = lastarch;