11 #define _RPMEVR_INTERNAL 17 #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} 18 #define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} 24 const char *r, *re, *v, *ve;
34 tagflags |= RPMSENSE_PROVIDES;
38 tagflags |= RPMSENSE_OBSOLETES;
42 tagflags |= RPMSENSE_CONFLICTS;
46 tagflags |= RPMSENSE_CONFLICTS;
50 tagflags |= RPMSENSE_ANY;
54 tagflags |= RPMSENSE_TRIGGERPREIN;
58 tagflags |= RPMSENSE_TRIGGERIN;
62 tagflags |= RPMSENSE_TRIGGERPOSTUN;
66 tagflags |= RPMSENSE_TRIGGERUN;
70 tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERPREIN);
74 tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERUN);
78 tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERIN);
82 tagflags |= (RPMSENSE_TRIGGERTRANS | RPMSENSE_TRIGGERPOSTUN);
87 tagflags |= RPMSENSE_MISSINGOK;
92 tagflags |= RPMSENSE_ANY;
96 tagflags |= RPMSENSE_PROVIDES;
100 tagflags |= RPMSENSE_OBSOLETES;
105 tagflags |= RPMSENSE_ANY;
110 for (r = field; *r !=
'\0'; r = re) {
121 strncpy(N, r, (re-r));
129 if (!(
xisalnum(N[ix]) || N[ix] ==
'_' || N[ix] ==
'/' || N[ix] ==
'^' 130 || (nr > 5 && N[ix] ==
'%' && N[ix+1] ==
'{' && N[nr-1] ==
'}')))
133 _(
"line %d: Dependency \"%s\" must begin with alpha-numeric, '_' or '/': %s\n"),
151 if (F && r[0] ==
'/') {
153 _(
"line %d: Versioned file name not permitted: %s\n"),
173 while (v < ve && *v !=
'\0')
176 default: *t++ = *v++;
break;
193 if (!(nr > 3 && EVR[0] ==
'%' && EVR[1] ==
'{' && EVR[nr-1] ==
'}'))
195 memset(evr, 0,
sizeof(*evr));
197 evr->str =
_free(evr->str);
208 (void)
addReqProv(spec, h, tagN, N, EVR, Flags, index);
#define RPMSENSE_SENSEMASK
static int xisalnum(int c)
int addReqProv(Spec spec, Header h, rpmTag tagN, const char *N, const char *EVR, rpmsenseFlags Flags, rpmuint32_t index)
Add dependency to header, filtering duplicates.
int rpmEVRparse(const char *evrstr, EVR_t evr)
Split EVR string into epoch, version, and release components.
static void rpmlog(int code, const char *fmt,...)
rpmsenseFlags rpmEVRflags(const char *op, const char **end)
Return comparison operator sense flags.
Yet Another syslog(3) API clone.
enum evrFlags_e rpmsenseFlags
The structure used to store values parsed from a spec file.
enum rpmRC_e rpmRC
RPM return codes.
This is the only module users of librpmbuild should need to include.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
rpmRC parseRCPOT(Spec spec, Package pkg, const char *field, rpmTag tagN, rpmuint32_t index, rpmsenseFlags tagflags)
Parse dependency relations from spec file and/or autogenerated output buffer.
The structure used to store values for a package.