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;
120 const char *b, *be = line;
121 size_t toklen = strlen(token);
124 while ( *(b = be) !=
'\0' ) {
130 if (toklen != (
size_t)(be-b) ||
xstrncasecmp(token, b, (be-b)))
186 int pc = 0, bc = 0, nc = 0;
191 while (*from && ch !=
'\n')
192 ch = *to++ = *from++;
200 for (p = spec->
lbuf; *p; p++) {
204 case '\n': p++, nc = 1;
break;
209 case '\n': nc = 0;
break;
212 case '{': p++, bc++;
break;
213 case '(': p++, pc++;
break;
214 case '%': p++;
break;
217 case '{':
if (bc > 0) bc++;
break;
218 case '}':
if (bc > 0) bc--;
break;
219 case '(':
if (pc > 0) pc++;
break;
220 case ')':
if (pc > 0) pc--;
break;
226 if (pc || bc || nc ) {
263 while (*spec->
nextline && ch !=
'\n') {
293 if (ofi->
fd == NULL) {
309 if (f == NULL || !fgets(ofi->
readBuf, (
int)
sizeof(ofi->
readBuf), f)) {
379 }
else if (! strncmp(
"%ifarch", s,
sizeof(
"%ifarch")-1)) {
380 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
384 }
else if (! strncmp(
"%ifnarch", s,
sizeof(
"%ifnarch")-1)) {
385 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
389 }
else if (! strncmp(
"%ifos", s,
sizeof(
"%ifos")-1)) {
390 const char *os =
rpmExpand(
"%{_target_os}", NULL);
394 }
else if (! strncmp(
"%ifnos", s,
sizeof(
"%ifnos")-1)) {
395 const char *os =
rpmExpand(
"%{_target_os}", NULL);
399 }
else if (! strncmp(
"%if", s,
sizeof(
"%if")-1)) {
404 _(
"%s:%d: parseExpressionBoolean returns %d\n"),
408 }
else if (! strncmp(
"%else", s,
sizeof(
"%else")-1)) {
413 _(
"%s:%d: Got a %%else with no %%if\n"),
419 spec->
line[0] =
'\0';
420 }
else if (! strncmp(
"%endif", s,
sizeof(
"%endif")-1)) {
425 _(
"%s:%d: Got a %%endif with no %%if\n"),
432 spec->
line[0] =
'\0';
433 }
else if (! strncmp(
"%include", s,
sizeof(
"%include")-1)) {
434 char *fileName, *endFileName, *p;
443 endFileName = fileName;
465 spec->
line[0] =
'\0';
469 spec->
line[0] =
'\0';
498 const char *N, *V, *R;
499 char fileName[BUFSIZ];
502 (void)
snprintf(fileName,
sizeof(fileName),
"%s-%s-%s.%ssrc.rpm",
503 N, V, R, spec->
noSource ?
"no" :
"");
504 fileName[
sizeof(fileName)-1] =
'\0';
521 int recursing,
const char *passPhrase,
522 const char *cookie,
int anyarch,
int force,
int verify)
524 HE_t he = memset(
alloca(
sizeof(*he)), 0,
sizeof(*he));
526 int initialPackage = 1;
546 spec->
toplevel = (!recursing ? 1 : 0);
620 if (goterror || parsePart >=
PART_LAST) {
640 for (x = 0; x < spec->
BACount; x++) {
648 passPhrase, cookie, anyarch, force, verify)
666 _(
"No compatible architectures found for build\n"));
701 const char *arch =
rpmExpand(
"%{_target_cpu}", NULL);
702 const char *os =
rpmExpand(
"%{_target_os}", NULL);
704 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
744 platform =
_free(platform);