54 for (; p->
token != NULL; p++)
86 const char *b, *be = line;
87 size_t toklen = strlen(token);
91 while ( *(b = be) !=
'\0' ) {
149 int pc = 0, bc = 0, nc = 0;
154 while (*from && ch !=
'\n')
155 ch = *to++ = *from++;
163 for (p = spec->
lbuf; *p; p++) {
167 case '\n': p++, nc = 1;
break;
172 case '\n': nc = 0;
break;
175 case '{': p++, bc++;
break;
176 case '(': p++, pc++;
break;
177 case '%': p++;
break;
180 case '{':
if (bc > 0) bc++;
break;
181 case '}':
if (bc > 0) bc--;
break;
182 case '(':
if (pc > 0) pc++;
break;
183 case ')':
if (pc > 0) pc--;
break;
189 if (pc || bc || nc ) {
216 while (*spec->
nextline && ch !=
'\n') {
240 const char *alternate_arch = NULL;
241 if (! strncmp(
"x86_64", arch,
sizeof(
"x86_64")-1))
242 alternate_arch =
"amd64";
243 else if (! strncmp(
"amd64", arch,
sizeof(
"amd64")-1))
244 alternate_arch =
"x86_64";
245 return alternate_arch;
264 if (ofi->
fd == NULL) {
281 if (f == NULL || !fgets(ofi->
readBuf, BUFSIZ, f)) {
330 }
else if (! strncmp(
"%ifarch", s,
sizeof(
"%ifarch")-1)) {
331 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
334 match =
matchTok(arch, s) || (alternate_arch &&
matchTok(alternate_arch, s));
336 }
else if (! strncmp(
"%ifnarch", s,
sizeof(
"%ifnarch")-1)) {
337 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
340 match = !
matchTok(arch, s) && (!alternate_arch || !
matchTok(alternate_arch, s));
342 }
else if (! strncmp(
"%ifos", s,
sizeof(
"%ifos")-1)) {
343 const char *os =
rpmExpand(
"%{_target_os}", NULL);
347 }
else if (! strncmp(
"%ifnos", s,
sizeof(
"%ifnos")-1)) {
348 const char *os =
rpmExpand(
"%{_target_os}", NULL);
352 }
else if (! strncmp(
"%if", s,
sizeof(
"%if")-1)) {
357 _(
"%s:%d: parseExpressionBoolean returns %d\n"),
361 }
else if (! strncmp(
"%else", s,
sizeof(
"%else")-1)) {
366 _(
"%s:%d: Got a %%else with no %%if\n"),
372 spec->
line[0] =
'\0';
373 }
else if (! strncmp(
"%endif", s,
sizeof(
"%endif")-1)) {
378 _(
"%s:%d: Got a %%endif with no %%if\n"),
385 spec->
line[0] =
'\0';
386 }
else if (! strncmp(
"%include", s,
sizeof(
"%include")-1)) {
387 char *fileName, *endFileName, *p;
396 endFileName = fileName;
418 spec->
line[0] =
'\0';
422 spec->
line[0] =
'\0';
452 int recursing,
const char *passPhrase,
453 char *cookie,
int anyarch,
int force,
int verify)
456 int initialPackage = 1;
556 for (x = 0; x < spec->
BACount; x++) {
564 passPhrase, cookie, anyarch, force, verify)
582 _(
"No compatible architectures found for build\n"));
616 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
617 const char *os =
rpmExpand(
"%{_target_os}", NULL);
619 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
639 platform =
_free(platform);