32 #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
33 #define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}
99 assert(xx != 0 && he->
p.
str != NULL);
105 if ((V = strrchr(N,
'-')) != NULL &&
xisdigit(V[1])) {
119 if (xx && he->
p.
str != NULL) {
120 n = (
char *) he->
p.
str;
126 if (xx && he->
p.
str != NULL) {
127 v = (
char *) he->
p.
str;
137 if (!strcmp(NV, nv) || !strcmp(NV, n)
138 || (!strcmp(N, n) && (V == NULL || !strcmp(V, v))))
162 if (pkg == NULL)
return;
177 if (pkg->
fi != NULL) {
194 if (_pkgPool == NULL) {
200 memset(((
char *)pkg)+
sizeof(pkg->
_item), 0,
sizeof(*pkg)-
sizeof(pkg->
_item));
216 pkg->triggers = NULL;
217 pkg->triggerScripts = NULL;
245 while ((p = packages) != NULL) {
261 if ((num == p->
num) && (p->
flags & flag))
return p;
281 for (i = 0; i <
num; i++)
282 if ((p = p->
next) == NULL)
return NULL;
314 return source->
flags;
332 for (f = fe; *f !=
'\0'; f = fe) {
340 if (*fe !=
'\0') fe++;
362 const char *field,
rpmTag tag)
365 #if defined(RPM_VENDOR_OPENPKG)
369 const char *
name = NULL;
370 const char *mdir = NULL;
371 const char *fieldp = NULL;
380 fieldp = spec->
line + strlen(name);
385 fieldp = spec->
line + strlen(name);
396 #if !defined(RPM_VENDOR_OPENPKG)
398 assert(mdir != NULL);
402 if (fieldp != NULL) {
405 num = strtoul(fieldp, &end, 10);
416 if ( p->
num != num )
continue;
435 #if defined(RPM_VENDOR_OPENPKG)
438 while (p_last != NULL && p_last->
next != NULL)
439 p_last = p_last->
next;
452 #if defined(RPM_VENDOR_OPENPKG)
461 sprintf(buf,
"%sURL%d",
462 (flag & RPMFILE_PATCH) ?
"PATCH" :
"SOURCE", num);
467 const char * what = (flag &
RPMFILE_PATCH) ?
"patches" :
"sources";
507 if (sl == NULL)
return NULL;
537 if (st == NULL)
return NULL;
538 for (i = 0; i < st->
st_ntags; i++) {
553 if (spec == NULL)
return;
587 if (spec->
fi != NULL) {
631 if (_specPool == NULL) {
637 memset(((
char *)spec)+
sizeof(spec->
_item), 0,
sizeof(*spec)-
sizeof(spec->
_item));
643 static const char _spec_line_buffer_size[] =
644 "%{?_spec_line_buffer_size}%{!?_spec_line_buffer_size:100000}";
655 spec->
lbuf[0] =
'\0';
741 const char * msgstr = NULL;
745 if (sl == NULL || st == NULL)
748 for (i = 0; i < st->
st_ntags; i++) {
762 for (fe = fmt; *fe && *fe !=
'('; fe++)
764 if (*fe ==
'(') *fe =
'\0';
766 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
770 if (!strcmp(he->
p.
str, fmt)) {
776 if (pkg == NULL || h == NULL)
785 msgstr =
_free(msgstr);
789 if (msgstr == NULL) {
802 {
char *buf =
xmalloc(strlen(tn) +
sizeof(
": ") + strlen(msgstr));
826 msgstr =
_free(msgstr);
833 if (strchr(s,
'\n') == NULL && s[strlen(s)-1] !=
'\n')
853 if (progTag !=(
rpmTag) 0) {
854 static const char prog[] =
"/bin/sh";
862 if (scriptTag != (
rpmTag)0 && iob != NULL) {
882 if (spec->
prep != NULL)
885 if (spec->
build != NULL)
891 if (spec->
check != NULL)
894 if (spec->
clean != NULL)
917 int anyarch = (target == NULL) ? 1 : 0;
918 char * passPhrase =
"";
925 if (
parseSpec(ts, specName,
"/", recursing, passPhrase,
926 cookie, anyarch, 1, verify)
930 _(
"query of specfile %s failed, can't parse\n"),
950 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
955 if (target == NULL || pkg->
fileList != NULL)
978 if (targets == NULL) {
985 _(
"Query specfile for platform(s): %s\n"), targets);
986 for (t = targets; *t !=
'\0'; t = te) {
988 if ((te = strchr(t,
',')) == NULL)
991 strncpy(target, t, (te-t));
1013 if ((te = strchr(t,
',')) == NULL)
1016 strncpy(target, t, (te-t));
1017 target[te-t] =
'\0';