int i;
for (i = 0; i < cache->size; i++)
- if (!strcmp(cache->cache[i].name, key)) return cache->cache + i;
+ if (rstreq(cache->cache[i].name, key)) return cache->cache + i;
return NULL;
}
{
while (tableLen) {
tableLen--;
- if (strcmp(name, table[tableLen].name))
+ if (!rstreq(name, table[tableLen].name))
continue;
return &(table[tableLen]);
}
{
while (tableLen) {
tableLen--;
- if (table[tableLen].name && !strcmp(name, table[tableLen].name))
+ if (table[tableLen].name && rstreq(name, table[tableLen].name))
return table[tableLen].defName;
}
/* Only add macros if appropriate for this arch */
if (option->macroize &&
- (arch == NULL || !strcmp(arch, current[ARCH]))) {
+ (arch == NULL || rstreq(arch, current[ARCH]))) {
char *n, *name;
n = name = xmalloc(strlen(option->name)+2);
if (option->localize)
gotit = 0;
for (i = 0; i < RPM_MACHTABLE_COUNT; i++) {
- if (!strncmp(tables[i].key, s, strlen(tables[i].key)))
+ if (rstreqn(tables[i].key, s, strlen(tables[i].key)))
break;
}
const char *rest = s + strlen(tables[i].key);
if (*rest == '_') rest++;
- if (!strcmp(rest, "compat")) {
+ if (rstreq(rest, "compat")) {
if (machCompatCacheAdd(se, fn, linenum,
&tables[i].cache))
goto exit;
gotit = 1;
} else if (tables[i].hasTranslate &&
- !strcmp(rest, "translate")) {
+ rstreq(rest, "translate")) {
if (addDefault(&tables[i].defaults,
&tables[i].defaultsLength,
se, fn, linenum))
goto exit;
gotit = 1;
} else if (tables[i].hasCanon &&
- !strcmp(rest, "canon")) {
+ rstreq(rest, "canon")) {
if (addCanon(&tables[i].canons, &tables[i].canonsLength,
se, fn, linenum))
goto exit;
for (i=0; i<4; i++)
vendor[8+i] = (unsigned char) (ecx >>(8*i));
- if (strncmp(vendor, "AuthenticAMD", 12) != 0)
+ if (!rstreqn(vendor, "AuthenticAMD", 12))
return 0;
return 1;
*((unsigned int *)&vendor[0]) = ebx;
*((unsigned int *)&vendor[4]) = edx;
*((unsigned int *)&vendor[8]) = ecx;
- if (strncmp(vendor, "GenuineIntel", 12) != 0)
+ if (!rstreqn(vendor, "GenuineIntel", 12))
return 0;
cpuid(1, &eax, &ebx, &ecx, &edx);
family = (eax >> 8) & 0x0f;
*((unsigned int *)&vendor[0]) = ebx;
*((unsigned int *)&vendor[4]) = edx;
*((unsigned int *)&vendor[8]) = ecx;
- if (strncmp(vendor, "GenuineIntel", 12) != 0)
+ if (!rstreqn(vendor, "GenuineIntel", 12))
return 0;
cpuid(1, &eax, &ebx, &ecx, &edx);
family = (eax >> 8) & 0x0f;
*((unsigned int *)&vendor[0]) = ebx;
*((unsigned int *)&vendor[4]) = edx;
*((unsigned int *)&vendor[8]) = ecx;
- if (strncmp(vendor, "AuthenticAMD", 12) != 0)
+ if (!rstreqn(vendor, "AuthenticAMD", 12))
return 0;
cpuid(1, &eax, &ebx, &ecx, &edx);
family = (eax >> 8) & 0x0f;
*/
strncpy(un.sysname, "SINIX", sizeof(un.sysname));
#endif
- if (!strcmp(un.sysname, "AIX")) {
+ if (rstreq(un.sysname, "AIX")) {
strcpy(un.machine, __power_pc() ? "ppc" : "rs6000");
sprintf(un.sysname,"aix%s.%s", un.version, un.release);
}
- else if(!strcmp(un.sysname, "Darwin")) {
+ else if(rstreq(un.sysname, "Darwin")) {
#ifdef __ppc__
strcpy(un.machine, "ppc");
#else ifdef __i386__
strcpy(un.machine, "i386");
#endif
}
- else if (!strcmp(un.sysname, "SunOS")) {
- if (!strncmp(un.release,"4", 1)) /* SunOS 4.x */ {
+ else if (rstreq(un.sysname, "SunOS")) {
+ if (rstreqn(un.release,"4", 1)) /* SunOS 4.x */ {
int fd;
for (fd = 0;
(un.release[fd] != 0 && (fd < sizeof(un.release)));
/* Solaris on Intel hardware reports i86pc instead of i386
* (at least on 2.6 and 2.8)
*/
- if (!strcmp(un.machine, "i86pc"))
+ if (rstreq(un.machine, "i86pc"))
sprintf(un.machine, "i386");
}
- else if (!strcmp(un.sysname, "HP-UX"))
+ else if (rstreq(un.sysname, "HP-UX"))
/*make un.sysname look like hpux9.05 for example*/
sprintf(un.sysname, "hpux%s", strpbrk(un.release, "123456789"));
- else if (!strcmp(un.sysname, "OSF1"))
+ else if (rstreq(un.sysname, "OSF1"))
/*make un.sysname look like osf3.2 for example*/
sprintf(un.sysname, "osf%s", strpbrk(un.release, "123456789"));
- else if (!strncmp(un.sysname, "IP", 2))
+ else if (rstreqn(un.sysname, "IP", 2))
un.sysname[2] = '\0';
- else if (!strncmp(un.sysname, "SINIX", 5)) {
+ else if (rstreqn(un.sysname, "SINIX", 5)) {
sprintf(un.sysname, "sinix%s",un.release);
- if (!strncmp(un.machine, "RM", 2))
+ if (rstreqn(un.machine, "RM", 2))
sprintf(un.machine, "mips");
}
- else if ((!strncmp(un.machine, "34", 2) ||
- !strncmp(un.machine, "33", 2)) && \
- !strncmp(un.release, "4.0", 3))
+ else if ((rstreqn(un.machine, "34", 2) ||
+ rstreqn(un.machine, "33", 2)) && \
+ rstreqn(un.release, "4.0", 3))
{
/* we are on ncr-sysv4 */
char * prelid = NULL;
# endif /* hpux */
# if defined(__linux__) && defined(__sparc__)
- if (!strcmp(un.machine, "sparc")) {
+ if (rstreq(un.machine, "sparc")) {
#define PERS_LINUX 0x00000000
#define PERS_LINUX_32BIT 0x00800000
#define PERS_LINUX32 0x00000008
if (oldpers != -1) {
if (personality(PERS_LINUX) != -1) {
uname(&un);
- if (! strcmp(un.machine, "sparc64")) {
+ if (rstreq(un.machine, "sparc64")) {
strcpy(un.machine, "sparcv9");
oldpers = PERS_LINUX32;
}
if (arch) {
next = &values[var];
while (next) {
- if (next->arch && !strcmp(next->arch, arch)) return next->value;
+ if (next->arch && rstreq(next->arch, arch)) return next->value;
next = next->next;
}
}
if (next->value) {
if (arch) {
while (next->next) {
- if (next->arch && !strcmp(next->arch, arch)) break;
+ if (next->arch && rstreq(next->arch, arch)) break;
next = next->next;
}
} else {
}
}
- if (next->arch && arch && !strcmp(next->arch, arch)) {
+ if (next->arch && arch && rstreq(next->arch, arch)) {
next->value = _free(next->value);
next->arch = _free(next->arch);
} else if (next->arch || arch) {
canonEntry canon = lookupInCanonTable(name,
tables[RPM_MACHTABLE_INSTARCH].canons,
tables[RPM_MACHTABLE_INSTARCH].canonsLength);
- return (canon != NULL || strcmp(name, "noarch") == 0);
+ return (canon != NULL || rstreq(name, "noarch"));
}
/** \ingroup rpmrc
}
if (os == NULL) return; /* XXX can't happen */
- if (!current[ARCH] || strcmp(arch, current[ARCH])) {
+ if (!current[ARCH] || !rstreq(arch, current[ARCH])) {
current[ARCH] = _free(current[ARCH]);
current[ARCH] = xstrdup(arch);
rebuildCompatTables(ARCH, host_cpu);
}
- if (!current[OS] || strcmp(os, current[OS])) {
+ if (!current[OS] || !rstreq(os, current[OS])) {
char * t = xstrdup(os);
current[OS] = _free(current[OS]);
/*
* XXX used by rpmInstallPackage->{os,arch}Okay->rpmMachineScore->
* XXX to verify correct arch/os from headers.
*/
- if (!strcmp(t, "linux"))
+ if (rstreq(t, "linux"))
*t = 'L';
current[OS] = t;