19 #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
20 #define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}
84 fullName = n =
alloca(strlen(pname) + 1 + strlen(name) + 1);
85 while (*pname !=
'\0') *n++ = *pname++;
88 fullName = n =
alloca(strlen(name)+1);
98 if (pname && (! strcmp(fullName, pname))) {
105 return ((p == NULL) ? 1 : 0);
125 p->triggerScripts = NULL;
158 if (pkg == NULL)
return NULL;
187 while ((p = packages) != NULL) {
203 if ((num == p->
num) && (p->
flags & flag))
return p;
224 for (f = fe; *f !=
'\0'; f = fe) {
232 if (*fe !=
'\0') fe++;
259 const char *
name = NULL;
260 const char *mdir = NULL;
262 const char *fieldp = NULL;
272 mdir =
"%{_sourcedir}/";
273 fieldp = spec->
line + (
sizeof(
"Source")-1);
278 mdir =
"%{_patchdir}/";
279 fieldp = spec->
line + (
sizeof(
"Patch")-1);
284 mdir =
"%{_icondir}/";
294 if (fieldp != NULL) {
301 while ((*fieldp !=
':') && (*fieldp !=
' ') && (*fieldp !=
'\t'))
307 if (nump == NULL || *nump ==
'\0')
339 sprintf(buf,
"%sURL%d",
340 (flag & RPMFILE_PATCH) ?
"PATCH" :
"SOURCE", num);
373 if (sl == NULL)
return NULL;
406 if (st == NULL)
return NULL;
407 for (i = 0; i < st->
st_ntags; i++) {
427 spec->
lbuf[0] =
'\0';
479 if (spec == NULL)
return NULL;
584 const char * msgstr = NULL;
587 if (sl == NULL || st == NULL)
591 for (i = 0; i < st->
st_ntags; i++) {
606 for (fe = fmt; *fe && *fe !=
'('; fe++)
608 if (*fe ==
'(') *fe =
'\0';
611 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
614 (void)
headerNVR(h, &pkgname, NULL, NULL);
615 if (!strcmp(pkgname, fmt))
618 if (pkg == NULL || h == NULL)
629 msgstr =
_free(msgstr);
633 if (msgstr == NULL) {
647 {
char *buf =
xmalloc(strlen(tn) +
sizeof(
": ") + strlen(msgstr));
673 msgstr =
_free(msgstr);
680 if (strchr(s,
'\n') == NULL && s[strlen(s)-1] !=
'\n')
699 if (progTag !=(
rpmTag) 0) {
700 static const char prog[] =
"/bin/sh";
704 if (scriptTag != (
rpmTag)0 && sb != NULL) {
720 if (spec->
prep != NULL)
723 if (spec->
build != NULL)
729 if (spec->
check != NULL)
732 if (spec->
clean != NULL)
755 int anyarch = (target == NULL) ? 1 : 0;
756 char * passPhrase =
"";
764 if (
parseSpec(ts, specName,
"/", recursing, passPhrase,
765 cookie, anyarch, force, verify)
769 _(
"query of specfile %s failed, can't parse\n"),
789 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
794 if (target == NULL || pkg->
fileList != NULL)
818 if (targets == NULL) {
825 D_(
"Query specfile for platform(s): %s\n"), targets);
826 for (t = targets; *t !=
'\0'; t = te) {
828 if ((te = strchr(t,
',')) == NULL)
831 strncpy(target, t, (te-t));
853 if ((te = strchr(t,
',')) == NULL)
856 strncpy(target, t, (te-t));