12 #define _RPMTAG_INTERNAL
60 for (; p->
token != NULL; p++)
66 const char * line = spec->
line;
92 if (aTags != NULL && aTags[0] != NULL) {
95 #if defined(RPM_VENDOR_OPENPKG)
96 av = argvSearchLinear(aTags, s, argvFnmatchCasefold);
104 spec->
foo[spec->
nfoo].iob = NULL;
121 const char *b, *be = line;
122 size_t toklen = strlen(token);
125 while ( *(b = be) !=
'\0' ) {
131 if (toklen != (
size_t)(be-b) ||
xstrncasecmp(token, b, (be-b)))
187 int pc = 0, bc = 0, nc = 0;
192 while (from && *from && ch !=
'\n')
193 ch = *to++ = *from++;
201 for (p = spec->
lbuf; *p; p++) {
205 case '\n': p++, nc = 1;
break;
210 case '\n': nc = 0;
break;
213 case '{': p++, bc++;
break;
214 case '(': p++, pc++;
break;
215 case '%': p++;
break;
218 case '{':
if (bc > 0) bc++;
break;
219 case '}':
if (bc > 0) bc--;
break;
220 case '(':
if (pc > 0) pc++;
break;
221 case ')':
if (pc > 0) pc--;
break;
227 if (pc || bc || nc ) {
264 while (*spec->
nextline && ch !=
'\n') {
294 if (ofi->
fd == NULL) {
310 if (f == NULL || !fgets(ofi->
readBuf, (
int)
sizeof(ofi->
readBuf), f)) {
382 }
else if (! strncmp(
"%ifarch", s,
sizeof(
"%ifarch")-1)) {
383 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
387 }
else if (! strncmp(
"%ifnarch", s,
sizeof(
"%ifnarch")-1)) {
388 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
392 }
else if (! strncmp(
"%ifos", s,
sizeof(
"%ifos")-1)) {
393 const char *os =
rpmExpand(
"%{_target_os}", NULL);
397 }
else if (! strncmp(
"%ifnos", s,
sizeof(
"%ifnos")-1)) {
398 const char *os =
rpmExpand(
"%{_target_os}", NULL);
402 }
else if (! strncmp(
"%if", s,
sizeof(
"%if")-1)) {
407 _(
"%s:%d: parseExpressionBoolean returns %d\n"),
411 }
else if (! strncmp(
"%else", s,
sizeof(
"%else")-1)) {
416 _(
"%s:%d: Got a %%else with no %%if\n"),
422 spec->
line[0] =
'\0';
423 }
else if (! strncmp(
"%endif", s,
sizeof(
"%endif")-1)) {
428 _(
"%s:%d: Got a %%endif with no %%if\n"),
435 spec->
line[0] =
'\0';
436 }
else if (spec->
readStack->
reading && ! strncmp(
"%include", s,
sizeof(
"%include")-1)) {
437 char *fileName, *endFileName, *p;
446 endFileName = fileName;
468 spec->
line[0] =
'\0';
472 spec->
line[0] =
'\0';
501 const char *N, *V, *R;
502 char fileName[BUFSIZ];
505 (void)
snprintf(fileName,
sizeof(fileName),
"%s-%s-%s.%ssrc.rpm",
506 N, V, R, spec->
noSource ?
"no" :
"");
507 fileName[
sizeof(fileName)-1] =
'\0';
524 int recursing,
const char *passPhrase,
525 const char *cookie,
int anyarch,
int force,
int verify)
529 int initialPackage = 1;
550 spec->
toplevel = (!recursing ? 1 : 0);
624 if (goterror || parsePart >=
PART_LAST) {
644 for (x = 0; x < spec->
BACount; x++) {
652 passPhrase, cookie, anyarch, force, verify)
670 _(
"No compatible architectures found for build\n"));
705 const char *platformNoarch = NULL;
706 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
707 const char *os =
rpmExpand(
"%{_target_os}", NULL);
709 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
727 if(pkg->
noarch && !platformNoarch && strcmp(arch,
"noarch")) {
729 platformNoarch =
rpmExpand(
"%{_target_platform}", NULL);
750 platform =
_free(platform);
751 platformNoarch =
_free(platformNoarch);
762 platform =
_free(platform);
763 platformNoarch =
_free(platformNoarch);