24 #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
25 #define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}
72 HE_t he = memset(
alloca(
sizeof(*he)), 0,
sizeof(*he));
90 assert(xx != 0 && he->
p.
str != NULL);
95 if ((V = strrchr(N,
'-')) != NULL) {
108 if (xx && he->
p.
str != NULL) {
109 n = (
char *) he->
p.
str;
115 if (xx && he->
p.
str != NULL) {
116 v = (
char *) he->
p.
str;
126 if (!strcmp(NV, nv) || !strcmp(NV, n)
127 || (!strcmp(N, n) && (V == NULL || !strcmp(V, v))))
159 p->triggerScripts = NULL;
185 if (pkg == NULL)
return NULL;
217 while ((p = packages) != NULL) {
233 if ((num == p->
num) && (p->
flags & flag))
return p;
253 for (i = 0; i <
num; i++)
254 if ((p = p->
next) == NULL)
return NULL;
286 return source->
flags;
304 for (f = fe; *f !=
'\0'; f = fe) {
312 if (*fe !=
'\0') fe++;
334 const char *field,
rpmTag tag)
337 #if defined(RPM_VENDOR_OPENPKG)
341 const char *
name = NULL;
342 const char *mdir = NULL;
344 const char *fieldp = NULL;
353 fieldp = spec->
line + (
sizeof(
"Source")-1);
358 fieldp = spec->
line + (
sizeof(
"Patch")-1);
369 #if !defined(RPM_VENDOR_OPENPKG)
371 assert(mdir != NULL);
375 if (fieldp != NULL) {
382 while ((*fieldp !=
':') && (*fieldp !=
' ') && (*fieldp !=
'\t'))
388 if (nump == NULL || *nump ==
'\0')
399 if ( p->
num != num )
continue;
418 #if defined(RPM_VENDOR_OPENPKG)
421 while (p_last != NULL && p_last->
next != NULL)
422 p_last = p_last->
next;
435 #if defined(RPM_VENDOR_OPENPKG)
444 sprintf(buf,
"%sURL%d",
445 (flag & RPMFILE_PATCH) ?
"PATCH" :
"SOURCE", num);
450 const char * what = (flag &
RPMFILE_PATCH) ?
"patches" :
"sources";
490 if (sl == NULL)
return NULL;
520 if (st == NULL)
return NULL;
521 for (i = 0; i < st->
st_ntags; i++) {
595 if (spec == NULL)
return NULL;
693 HE_t he = memset(
alloca(
sizeof(*he)), 0,
sizeof(*he));
697 const char * msgstr = NULL;
701 if (sl == NULL || st == NULL)
704 for (i = 0; i < st->
st_ntags; i++) {
718 for (fe = fmt; *fe && *fe !=
'('; fe++)
720 if (*fe ==
'(') *fe =
'\0';
722 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
726 if (!strcmp(he->
p.
str, fmt)) {
732 if (pkg == NULL || h == NULL)
741 msgstr =
_free(msgstr);
745 if (msgstr == NULL) {
758 {
char *buf =
xmalloc(strlen(tn) +
sizeof(
": ") + strlen(msgstr));
782 msgstr =
_free(msgstr);
789 if (strchr(s,
'\n') == NULL && s[strlen(s)-1] !=
'\n')
806 HE_t he = memset(
alloca(
sizeof(*he)), 0,
sizeof(*he));
809 if (progTag !=(
rpmTag) 0) {
810 static const char prog[] =
"/bin/sh";
818 if (scriptTag != (
rpmTag)0 && iob != NULL) {
838 if (spec->
prep != NULL)
841 if (spec->
build != NULL)
847 if (spec->
check != NULL)
850 if (spec->
clean != NULL)
873 int anyarch = (target == NULL) ? 1 : 0;
874 char * passPhrase =
"";
881 if (
parseSpec(ts, specName,
"/", recursing, passPhrase,
882 cookie, anyarch, 1, verify)
886 _(
"query of specfile %s failed, can't parse\n"),
906 for (pkg = spec->
packages; pkg != NULL; pkg = pkg->
next) {
911 if (target == NULL || pkg->
fileList != NULL)
934 if (targets == NULL) {
941 _(
"Query specfile for platform(s): %s\n"), targets);
942 for (t = targets; *t !=
'\0'; t = te) {
944 if ((te = strchr(t,
',')) == NULL)
947 strncpy(target, t, (te-t));
969 if ((te = strchr(t,
',')) == NULL)
972 strncpy(target, t, (te-t));