337
337
return RPMRC_FAIL;
340
/* LCL: s != NULL here. */
341
340
tnum = strtoul(s, &s1, 10);
342
341
if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
343
342
rpmlog(RPMLOG_ERR, _("Bad arch/os number: %s (%s:%d)\n"), s,
573
572
const char *rest = s + strlen(tables[i].key);
574
573
if (*rest == '_') rest++;
576
if (!strcmp(rest, "compat")) {
575
if (rstreq(rest, "compat")) {
577
576
if (machCompatCacheAdd(se, fn, linenum,
578
577
&tables[i].cache))
581
580
} else if (tables[i].hasTranslate &&
582
!strcmp(rest, "translate")) {
581
rstreq(rest, "translate")) {
583
582
if (addDefault(&tables[i].defaults,
584
583
&tables[i].defaultsLength,
585
584
se, fn, linenum))
588
587
} else if (tables[i].hasCanon &&
589
!strcmp(rest, "canon")) {
588
rstreq(rest, "canon")) {
590
589
if (addCanon(&tables[i].canons, &tables[i].canonsLength,
591
590
se, fn, linenum))
834
833
*((unsigned int *)&vendor[0]) = ebx;
835
834
*((unsigned int *)&vendor[4]) = edx;
836
835
*((unsigned int *)&vendor[8]) = ecx;
837
if (strncmp(vendor, "GenuineIntel", 12) != 0)
836
if (!rstreqn(vendor, "GenuineIntel", 12))
839
838
cpuid(1, &eax, &ebx, &ecx, &edx);
840
839
family = (eax >> 8) & 0x0f;
873
872
*((unsigned int *)&vendor[0]) = ebx;
874
873
*((unsigned int *)&vendor[4]) = edx;
875
874
*((unsigned int *)&vendor[8]) = ecx;
876
if (strncmp(vendor, "GenuineIntel", 12) != 0)
875
if (!rstreqn(vendor, "GenuineIntel", 12))
878
877
cpuid(1, &eax, &ebx, &ecx, &edx);
879
878
family = (eax >> 8) & 0x0f;
905
904
*((unsigned int *)&vendor[0]) = ebx;
906
905
*((unsigned int *)&vendor[4]) = edx;
907
906
*((unsigned int *)&vendor[8]) = ecx;
908
if (strncmp(vendor, "AuthenticAMD", 12) != 0)
907
if (!rstreqn(vendor, "AuthenticAMD", 12))
910
909
cpuid(1, &eax, &ebx, &ecx, &edx);
911
910
family = (eax >> 8) & 0x0f;
967
966
strncpy(un.sysname, "SINIX", sizeof(un.sysname));
969
if (!strcmp(un.sysname, "AIX")) {
968
if (rstreq(un.sysname, "AIX")) {
970
969
strcpy(un.machine, __power_pc() ? "ppc" : "rs6000");
971
970
sprintf(un.sysname,"aix%s.%s", un.version, un.release);
973
else if(!strcmp(un.sysname, "Darwin")) {
972
else if(rstreq(un.sysname, "Darwin")) {
975
974
strcpy(un.machine, "ppc");
976
975
#else ifdef __i386__
977
976
strcpy(un.machine, "i386");
980
else if (!strcmp(un.sysname, "SunOS")) {
981
if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ {
979
else if (rstreq(un.sysname, "SunOS")) {
980
if (rstreqn(un.release,"4", 1)) /* SunOS 4.x */ {
984
983
(un.release[fd] != 0 && (fd < sizeof(un.release)));
998
997
/* Solaris on Intel hardware reports i86pc instead of i386
999
998
* (at least on 2.6 and 2.8)
1001
if (!strcmp(un.machine, "i86pc"))
1000
if (rstreq(un.machine, "i86pc"))
1002
1001
sprintf(un.machine, "i386");
1004
else if (!strcmp(un.sysname, "HP-UX"))
1003
else if (rstreq(un.sysname, "HP-UX"))
1005
1004
/*make un.sysname look like hpux9.05 for example*/
1006
1005
sprintf(un.sysname, "hpux%s", strpbrk(un.release, "123456789"));
1007
else if (!strcmp(un.sysname, "OSF1"))
1006
else if (rstreq(un.sysname, "OSF1"))
1008
1007
/*make un.sysname look like osf3.2 for example*/
1009
1008
sprintf(un.sysname, "osf%s", strpbrk(un.release, "123456789"));
1010
else if (!strncmp(un.sysname, "IP", 2))
1009
else if (rstreqn(un.sysname, "IP", 2))
1011
1010
un.sysname[2] = '\0';
1012
else if (!strncmp(un.sysname, "SINIX", 5)) {
1011
else if (rstreqn(un.sysname, "SINIX", 5)) {
1013
1012
sprintf(un.sysname, "sinix%s",un.release);
1014
if (!strncmp(un.machine, "RM", 2))
1013
if (rstreqn(un.machine, "RM", 2))
1015
1014
sprintf(un.machine, "mips");
1017
else if ((!strncmp(un.machine, "34", 2) ||
1018
!strncmp(un.machine, "33", 2)) && \
1019
!strncmp(un.release, "4.0", 3))
1016
else if ((rstreqn(un.machine, "34", 2) ||
1017
rstreqn(un.machine, "33", 2)) && \
1018
rstreqn(un.release, "4.0", 3))
1021
1020
/* we are on ncr-sysv4 */
1022
1021
char * prelid = NULL;
1099
1098
# endif /* hpux */
1101
1100
# if defined(__linux__) && defined(__sparc__)
1102
if (!strcmp(un.machine, "sparc")) {
1101
if (rstreq(un.machine, "sparc")) {
1103
1102
#define PERS_LINUX 0x00000000
1104
1103
#define PERS_LINUX_32BIT 0x00800000
1105
1104
#define PERS_LINUX32 0x00000008
1230
if (next->arch && arch && !strcmp(next->arch, arch)) {
1229
if (next->arch && arch && rstreq(next->arch, arch)) {
1231
1230
next->value = _free(next->value);
1232
1231
next->arch = _free(next->arch);
1233
1232
} else if (next->arch || arch) {
1272
1271
canonEntry canon = lookupInCanonTable(name,
1273
1272
tables[RPM_MACHTABLE_INSTARCH].canons,
1274
1273
tables[RPM_MACHTABLE_INSTARCH].canonsLength);
1275
return (canon != NULL || strcmp(name, "noarch") == 0);
1274
return (canon != NULL || rstreq(name, "noarch"));
1278
1277
/** \ingroup rpmrc
1311
1310
if (os == NULL) return; /* XXX can't happen */
1313
if (!current[ARCH] || strcmp(arch, current[ARCH])) {
1312
if (!current[ARCH] || !rstreq(arch, current[ARCH])) {
1314
1313
current[ARCH] = _free(current[ARCH]);
1315
1314
current[ARCH] = xstrdup(arch);
1316
1315
rebuildCompatTables(ARCH, host_cpu);
1319
if (!current[OS] || strcmp(os, current[OS])) {
1318
if (!current[OS] || !rstreq(os, current[OS])) {
1320
1319
char * t = xstrdup(os);
1321
1320
current[OS] = _free(current[OS]);