- more boring lclint annotations and fiddles.
- yet more boring lclint annotations and fiddles.
- still more boring lclint annotations and fiddles.
+ - enough lclint annotations and fiddles already.
+ - fix: specfile queries with BuildArch: (#27589).
4.0 -> 4.0.[12]
- add doxygen and lclint annotations most everywhere.
rc = 0;
exit:
- if (spec)
- freeSpec(spec);
+ spec = freeSpec(spec);
buildRootURL = _free(buildRootURL);
return rc;
}
{
int rc = 0;
- if (!spec->inBuildArchitectures && spec->buildArchitectureCount) {
+ if (!spec->recursing && spec->BACount) {
int x;
- /* When iterating over buildArchitectures, do the source */
+ /* When iterating over BANames, do the source */
/* packaging on the first run, and skip RMSOURCE altogether */
- if (spec->buildArchitectureSpecs != NULL)
- for (x = 0; x < spec->buildArchitectureCount; x++) {
- if ((rc = buildSpec(spec->buildArchitectureSpecs[x],
+ if (spec->BASpecs != NULL)
+ for (x = 0; x < spec->BACount; x++) {
+ if ((rc = buildSpec(spec->BASpecs[x],
(what & ~RPMBUILD_RMSOURCE) |
(x ? 0 : (what & RPMBUILD_PACKAGESOURCE)),
test))) {
#if 0
/**
*/
-static void dumpAttrRec(const char *msg, AttrRec ar) /*@*/
+static void dumpAttrRec(const char * msg, AttrRec ar)
+ /*@modifies fileSystem @*/
{
if (msg)
fprintf(stderr, "%s:\t", msg);
}
headerFreeIterator(hi);
- if (spec->buildArchitectures && spec->buildArchitectureCount > 0) {
+ if (spec->BANames && spec->BACount > 0) {
(void) headerAddEntry(spec->sourceHeader, RPMTAG_BUILDARCHS,
RPM_STRING_ARRAY_TYPE,
- spec->buildArchitectures, spec->buildArchitectureCount);
+ spec->BANames, spec->BACount);
}
}
if (specp)
*specp = spec;
else
- freeSpec(spec);
+ spec = freeSpec(spec);
if (csa != NULL)
csa->cpioFdIn = fdi;
int arg;
const char **argv = NULL;
poptContext optCon = NULL;
- struct spectag *t = NULL;
+ spectag t = NULL;
name = NULL;
lang = RPMBUILD_DEFAULT_LANG;
return rc;
}
-struct spectag *
-stashSt(Spec spec, Header h, int tag, const char *lang)
+spectag stashSt(Spec spec, Header h, int tag, const char * lang)
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
- struct spectag *t = NULL;
+ spectag t = NULL;
if (spec->st) {
- struct spectags *st = spec->st;
+ spectags st = spec->st;
if (st->st_ntags == st->st_nalloc) {
st->st_nalloc += 10;
st->st_t = xrealloc(st->st_t, st->st_nalloc * sizeof(*(st->st_t)));
break;
case RPMTAG_BUILDARCHS:
if ((rc = poptParseArgvString(field,
- &(spec->buildArchitectureCount),
- &(spec->buildArchitectures)))) {
+ &(spec->BACount),
+ &(spec->BANames)))) {
rpmError(RPMERR_BADSPEC,
_("line %d: Bad BuildArchitecture format: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
- if (!spec->buildArchitectureCount)
- spec->buildArchitectures = _free(spec->buildArchitectures);
+ if (!spec->BACount)
+ spec->BANames = _free(spec->BANames);
break;
default:
}
if (handlePreambleTag(spec, pkg, tag, macro, lang))
return RPMERR_BADSPEC;
- if (spec->buildArchitectures && !spec->inBuildArchitectures)
+ if (spec->BANames && !spec->recursing)
return PART_BUILDARCHITECTURES;
}
if ((rc =
ofi->lineNum++;
spec->lineNum = ofi->lineNum;
if (spec->sl) {
- struct speclines * sl = spec->sl;
+ speclines sl = spec->sl;
if (sl->sl_nlines == sl->sl_nalloc) {
sl->sl_nalloc += 100;
sl->sl_lines = (char **) xrealloc(sl->sl_lines,
extern int noLang; /* XXX FIXME: pass as arg */
+/*@todo Skip parse recursion if os is not compatible. @*/
int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
- const char *buildRootURL, int inBuildArch, const char *passPhrase,
+ const char *buildRootURL, int recursing, const char *passPhrase,
char *cookie, int anyarch, int force)
{
rpmParseState parsePart = PART_PREAMBLE;
const char *saveArch;
#endif
Package pkg;
- int x, index;
Spec spec;
/* Set up a new Spec structure with no packages. */
fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootURL, spec->buildRootURL, buildRoot);
}
addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
- spec->inBuildArchitectures = inBuildArch;
+ spec->recursing = recursing;
spec->anyarch = anyarch;
spec->force = force;
}
if (parsePart >= PART_LAST) {
- freeSpec(spec);
+ spec = freeSpec(spec);
return parsePart;
}
if (parsePart == PART_BUILDARCHITECTURES) {
- spec->buildArchitectureSpecs =
- xmalloc(sizeof(Spec) * spec->buildArchitectureCount);
+ int index;
+ int x;
+
+ closeSpec(spec);
+
+ spec->BASpecs = xmalloc(spec->BACount * sizeof(Spec));
index = 0;
- if (spec->buildArchitectures != NULL)
- for (x = 0; x < spec->buildArchitectureCount; x++) {
- if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
- spec->buildArchitectures[x])) {
+ if (spec->BANames != NULL)
+ for (x = 0; x < spec->BACount; x++) {
+
+ /* Skip if not arch is not compatible. */
+ if (!rpmMachineScore(RPM_MACHTABLE_BUILDARCH, spec->BANames[x]))
+ continue;
#ifdef DYING
- rpmGetMachine(&saveArch, NULL);
- saveArch = xstrdup(saveArch);
- rpmSetMachine(spec->buildArchitectures[x], NULL);
+ rpmGetMachine(&saveArch, NULL);
+ saveArch = xstrdup(saveArch);
+ rpmSetMachine(spec->BANames[x], NULL);
#else
- addMacro(NULL, "_target_cpu", NULL, spec->buildArchitectures[x], RMIL_RPMRC);
+ addMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC);
#endif
- if (parseSpec(&(spec->buildArchitectureSpecs[index]),
+ if (parseSpec(&(spec->BASpecs[index]),
specFile, spec->rootURL, buildRootURL, 1,
- passPhrase, cookie, anyarch, force)) {
- spec->buildArchitectureCount = index;
- freeSpec(spec);
+ passPhrase, cookie, anyarch, force))
+ {
+ spec->BACount = index;
+ spec = freeSpec(spec);
return RPMERR_BADSPEC;
- }
+ }
#ifdef DYING
- rpmSetMachine(saveArch, NULL);
- saveArch = _free(saveArch);
+ rpmSetMachine(saveArch, NULL);
+ saveArch = _free(saveArch);
#else
- delMacro(NULL, "_target_cpu");
+ delMacro(NULL, "_target_cpu");
#endif
- index++;
- }
+ index++;
}
- spec->buildArchitectureCount = index;
+
+ spec->BACount = index;
if (! index) {
- freeSpec(spec);
- rpmError(RPMERR_BADSPEC, _("No buildable architectures\n"));
+ spec = freeSpec(spec);
+ rpmError(RPMERR_BADSPEC,
+ _("No compatible architectures found for build\n"));
return RPMERR_BADSPEC;
}
- /* XXX HACK: Swap sl/st with child.
+ /*
+ * Return the 1st child's fully parsed Spec structure.
* The restart of the parse when encountering BuildArch
- * causes problems for "rpm -q --specfile --specedit"
- * which needs to keep track of the entire spec file.
+ * causes problems for "rpm -q --specfile". This is
+ * still a hack because there may be more than 1 arch
+ * specified (unlikely but possible.) There's also the
+ * further problem that the macro context, particularly
+ * %{_target_cpu}, disagrees with the info in the header.
*/
-
- if (spec->sl && spec->st) {
- Spec nspec = *spec->buildArchitectureSpecs;
- struct speclines *sl = spec->sl;
- struct spectags *st = spec->st;
- spec->sl = nspec->sl;
- spec->st = nspec->st;
- nspec->sl = sl;
- nspec->st = st;
+ if (spec->BACount >= 1) {
+ Spec nspec = spec->BASpecs[0];
+ spec->BASpecs = _free(spec->BASpecs);
+ spec = freeSpec(spec);
+ spec = nspec;
}
- closeSpec(spec);
*specp = spec;
return 0;
}
(void) headerNVR(pkg->header, &name, NULL, NULL);
rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
name);
- freeSpec(spec);
+ spec = freeSpec(spec);
return RPMERR_BADSPEC;
}
/** \ingroup rpmbuild
* Destroy all packages associated with spec file.
- * @param spec spec file control structure
+ * @param packages package control structure chain
+ * @return NULL
*/
-void freePackages(Spec spec)
- /*@modifies spec->packages @*/;
+/*@null@*/ Package freePackages(/*@only@*/ /*@null@*/ Package packages)
+ /*@modifies packages @*/;
/** \ingroup rpmbuild
* Destroy package control structure.
* @param pkg package control structure
+ * @return NULL
*/
-void freePackage(/*@only@*/ Package pkg)
+/*@null@*/ Package freePackage(/*@only@*/ /*@null@*/ Package pkg)
/*@modifies pkg @*/;
/** \ingroup rpmbuild
*/
void initSourceHeader(Spec spec)
/*@modifies spec->sourceHeader,
- spec->buildRestrictions, spec->buildArchitectures,
+ spec->buildRestrictions, spec->BANames,
spec->packages->header @*/;
/** \ingroup rpmbuild
*/
int processSourceFiles(Spec spec)
/*@modifies spec->sourceHeader, spec->sourceCpioList,
- spec->buildRestrictions, spec->buildArchitectures,
+ spec->buildRestrictions, spec->BANames,
spec->packages->header @*/;
/* global entry points */
* @param specFile
* @param rootdir
* @param buildRoot
- * @param inBuildArch
+ * @param recursing parse is recursive?
* @param passPhrase
* @param cookie
* @param anyarch
int parseSpec(/*@out@*/ Spec * specp, const char * specFile,
/*@null@*/ const char * rootdir,
/*@null@*/ const char * buildRoot,
- int inBuildArch,
+ int recursing,
/*@null@*/ const char * passPhrase,
/*@null@*/ char * cookie,
int anyarch, int force)
* @param specFile
* @param rootdir
* @param buildRoot
- * @param inBuildArch
+ * @param recursing parse is recursive?
* @param passPhrase
* @param cookie
* @param anyarch
extern int (*parseSpecVec) (Spec * specp, const char * specFile,
const char * rootdir,
/*@null@*/ const char * buildRoot,
- int inBuildArch,
+ int recursing,
/*@null@*/ const char * passPhrase,
/*@null@*/ char * cookie,
int anyarch, int force)
int buildSpec(Spec spec, int what, int test)
/*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie,
spec->sourceRpmName, spec->macros,
- spec->buildArchitectureSpecs,
- spec->buildRestrictions, spec->buildArchitectures,
+ spec->BASpecs,
+ spec->buildRestrictions, spec->BANames,
spec->packages->cpioList, spec->packages->specialDoc,
spec->packages->header @*/;
/** \ingroup rpmbuild
*/
-struct spectag {
+typedef struct spectag_s {
int t_tag;
int t_startx;
int t_nlines;
/*@only@*/ const char * t_lang;
/*@only@*/ const char * t_msgid;
-};
+} * spectag;
/** \ingroup rpmbuild
*/
-struct spectags {
-/*@owned@*/ struct spectag *st_t;
+typedef struct spectags_s {
+/*@owned@*/ spectag st_t;
int st_nalloc;
int st_ntags;
-};
+} * spectags;
/** \ingroup rpmbuild
*/
-struct speclines {
+typedef struct speclines_s {
/*@only@*/ char **sl_lines;
int sl_nalloc;
int sl_nlines;
-};
+} * speclines;
/** \ingroup rpmbuild
* The structure used to store values parsed from a spec file.
/*@only@*/ const char * buildSubdir;
/*@only@*/ const char * rootURL;
-/*@owned@*/ /*@null@*/ struct speclines * sl;
-/*@owned@*/ /*@null@*/ struct spectags * st;
+/*@owned@*/ /*@null@*/ speclines sl;
+/*@owned@*/ /*@null@*/ spectags st;
/*@owned@*/ struct OpenFileInfo * fileStack;
char lbuf[4*BUFSIZ];
/*@owned@*/ struct ReadLevelEntry * readStack;
/*@refcounted@*/ Header buildRestrictions;
-/*@owned@*/ /*@null@*/ struct SpecStruct ** buildArchitectureSpecs;
-/*@only@*/ /*@null@*/ const char ** buildArchitectures;
- int buildArchitectureCount;
- int inBuildArchitectures;
+/*@owned@*/ /*@null@*/ struct SpecStruct ** BASpecs;
+/*@only@*/ /*@null@*/ const char ** BANames;
+ int BACount;
+ int recursing; /*!< parse is recursive? */
int force;
int anyarch;
/** \ingroup rpmbuild
* Create and initialize Spec structure.
+ * @return spec spec file control structure
*/
/*@only@*/ Spec newSpec(void) /*@*/;
/** \ingroup rpmbuild
* Destroy Spec structure.
* @param spec spec file control structure
+ * @return NULL always
*/
-void freeSpec(/*@only@*/ Spec spec)
+/*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
/*@modifies spec @*/;
/** \ingroup rpmbuild
* @param spec spec file control structure
+ * @return NULL always
*/
-extern void (*freeSpecVec) (Spec spec) /* XXX FIXME */
+extern /*@null@*/ Spec (*freeSpecVec) (Spec spec) /* XXX FIXME */
/*@modifies spec @*/;
/** \ingroup rpmbuild
/** \ingroup rpmbuild
* @param spec spec file control structure
*/
-struct spectag * stashSt(Spec spec, Header h, int tag, const char * lang)
+spectag stashSt(Spec spec, Header h, int tag, const char * lang)
/*@modifies spec->st @*/;
/** \ingroup rpmbuild
/*@access Header @*/ /* compared with NULL */
/**
+ * @return NULL always
*/
-static inline void freeTriggerFiles(/*@only@*/ struct TriggerFileEntry *p)
+static inline
+/*@null@*/ struct TriggerFileEntry * freeTriggerFiles(/*@only@*/ /*@null@*/ struct TriggerFileEntry * p)
{
struct TriggerFileEntry *o, *q = p;
o->prog = _free(o->prog);
o = _free(o);
}
+ return NULL;
}
/**
+ * Destroy source component chain.
+ * @param source component chain
+ * @return NULL always
*/
-static inline void freeSources(/*@only@*/ struct Source *s)
+static inline
+/*@null@*/ struct Source * freeSources(/*@only@*/ /*@null@*/ struct Source * s)
{
struct Source *r, *t = s;
r->fullSource = _free(r->fullSource);
r = _free(r);
}
+ return NULL;
}
int lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkg)
return p;
}
-void freePackage(/*@only@*/ Package p)
+Package freePackage(Package p)
{
- if (p == NULL)
- return;
+ if (p == NULL) return NULL;
p->preInFile = _free(p->preInFile);
p->postInFile = _free(p->postInFile);
p->verifyFile = _free(p->verifyFile);
headerFree(p->header);
+ p->header = NULL;
p->fileList = freeStringBuf(p->fileList);
p->fileFile = _free(p->fileFile);
if (p->cpioList) {
}
p->specialDoc = freeStringBuf(p->specialDoc);
-
- freeSources(p->icon);
-
- freeTriggerFiles(p->triggerFiles);
+ p->icon = freeSources(p->icon);
+ p->triggerFiles = freeTriggerFiles(p->triggerFiles);
p = _free(p);
+ return NULL;
}
-void freePackages(Spec spec)
+Package freePackages(Package packages)
{
Package p;
- while ((p = spec->packages) != NULL) {
- /*@-dependenttrans@*/
- spec->packages = p->next;
- /*@=dependenttrans@*/
+ while ((p = packages) != NULL) {
+ packages = p->next;
p->next = NULL;
- freePackage(p);
+ p = freePackage(p);
}
+ return NULL;
}
/**
{
struct Source *p;
- for (p = spec->sources; p != NULL; p = p->next) {
- if ((num == p->num) && (p->flags & flag)) {
- return p;
- }
- }
+ for (p = spec->sources; p != NULL; p = p->next)
+ if ((num == p->num) && (p->flags & flag)) return p;
return NULL;
}
-int parseNoSource(Spec spec, const char *field, int tag)
+int parseNoSource(Spec spec, const char * field, int tag)
{
const char *f, *fe;
const char *name;
p = xmalloc(sizeof(struct Source));
p->num = num;
p->fullSource = xstrdup(field);
- p->source = strrchr(p->fullSource, '/');
p->flags = flag;
+ p->source = strrchr(p->fullSource, '/');
if (p->source) {
p->source++;
} else {
/**
*/
-static inline /*@only@*/ /*@null@*/ struct speclines * newSl(void)
+static inline /*@only@*/ /*@null@*/ speclines newSl(void)
{
- struct speclines * sl = NULL;
+ speclines sl = NULL;
if (specedit) {
- sl = xmalloc(sizeof(struct speclines));
+ sl = xmalloc(sizeof(*sl));
sl->sl_lines = NULL;
sl->sl_nalloc = 0;
sl->sl_nlines = 0;
/**
*/
-static inline void freeSl(/*@only@*/ /*@null@*/ struct speclines * sl)
+static inline /*@null@*/ speclines freeSl(/*@only@*/ /*@null@*/ speclines sl)
{
int i;
- if (sl == NULL)
- return;
+ if (sl == NULL) return NULL;
for (i = 0; i < sl->sl_nlines; i++)
/*@-unqualifiedtrans@*/
sl->sl_lines[i] = _free(sl->sl_lines[i]);
/*@=unqualifiedtrans@*/
sl->sl_lines = _free(sl->sl_lines);
- sl = _free(sl);
+ return _free(sl);
}
/**
*/
-static inline /*@only@*/ /*@null@*/ struct spectags * newSt(void)
+static inline /*@only@*/ /*@null@*/ spectags newSt(void)
{
- struct spectags *st = NULL;
+ spectags st = NULL;
if (specedit) {
- st = xmalloc(sizeof(struct spectags));
+ st = xmalloc(sizeof(*st));
st->st_t = NULL;
st->st_nalloc = 0;
st->st_ntags = 0;
/**
*/
-static inline void freeSt(/*@only@*/ /*@null@*/ struct spectags *st)
+static inline /*@null@*/ spectags freeSt(/*@only@*/ /*@null@*/ spectags st)
{
int i;
- if (st == NULL)
- return;
+ if (st == NULL) return NULL;
for (i = 0; i < st->st_ntags; i++) {
- struct spectag *t = st->st_t + i;
+ spectag t = st->st_t + i;
t->t_lang = _free(t->t_lang);
t->t_msgid = _free(t->t_msgid);
}
st->st_t = _free(st->st_t);
- st = _free(st);
+ return _free(st);
}
Spec newSpec(void)
spec->cookie = NULL;
spec->buildRestrictions = headerNew();
- spec->buildArchitectures = NULL;
- spec->buildArchitectureCount = 0;
- spec->inBuildArchitectures = 0;
- spec->buildArchitectureSpecs = NULL;
+ spec->BANames = NULL;
+ spec->BACount = 0;
+ spec->recursing = 0;
+ spec->BASpecs = NULL;
spec->force = 0;
spec->anyarch = 0;
return spec;
}
-void freeSpec(/*@only@*/ Spec spec)
+Spec freeSpec(Spec spec)
{
- struct OpenFileInfo *ofi;
struct ReadLevelEntry *rl;
- freeSl(spec->sl); spec->sl = NULL;
- freeSt(spec->st); spec->st = NULL;
+ if (spec == NULL) return NULL;
+
+ spec->sl = freeSl(spec->sl);
+ spec->st = freeSt(spec->st);
spec->prep = freeStringBuf(spec->prep);
spec->build = freeStringBuf(spec->build);
spec->specFile = _free(spec->specFile);
spec->sourceRpmName = _free(spec->sourceRpmName);
+#ifdef DEAD
+ { struct OpenFileInfo *ofi;
while (spec->fileStack) {
ofi = spec->fileStack;
spec->fileStack = ofi->next;
ofi->fileName = _free(ofi->fileName);
ofi = _free(ofi);
}
+ }
+#else
+ closeSpec(spec);
+#endif
while (spec->readStack) {
rl = spec->readStack;
headerFree(spec->buildRestrictions);
spec->buildRestrictions = NULL;
- if (!spec->inBuildArchitectures) {
- if (spec->buildArchitectureSpecs != NULL)
- while (spec->buildArchitectureCount--) {
+ if (!spec->recursing) {
+ if (spec->BASpecs != NULL)
+ while (spec->BACount--) {
/*@-unqualifiedtrans@*/
- freeSpec(
- spec->buildArchitectureSpecs[spec->buildArchitectureCount]);
+ spec->BASpecs[spec->BACount] =
+ freeSpec(spec->BASpecs[spec->BACount]);
/*@=unqualifiedtrans@*/
}
/*@-compdef@*/
- spec->buildArchitectureSpecs = _free(spec->buildArchitectureSpecs);
+ spec->BASpecs = _free(spec->BASpecs);
/*@=compdef@*/
}
- spec->buildArchitectures = _free(spec->buildArchitectures);
+ spec->BANames = _free(spec->BANames);
spec->passPhrase = _free(spec->passPhrase);
spec->cookie = _free(spec->cookie);
- freeSources(spec->sources); spec->sources = NULL;
- /*@-nullstate@*/ /* FIX: non-null pointers, shrug. */
- freePackages(spec);
- closeSpec(spec);
- /*@=nullstate@*/
+ spec->sources = freeSources(spec->sources);
+ spec->packages = freePackages(spec->packages);
spec = _free(spec);
+
+ return spec;
}
/*@only@*/ struct OpenFileInfo * newOpenFileInfo(void)
@echo expect 10 shift/reduce conflicts
$(YACC) $(srcdir)/getdate.y
-@if test -f y.tab.c; then \
- { echo "/*@-globstate -retvalint -unqualifiedtrans -usedef -varuse -nullderef -exportlocal @*/";\
- cat y.tab.c ;\
- echo "/*@=globstate =retvalint =unqualifiedtrans =usedef =varuse =nullderef =exportlocal @*/";\
+ { echo "/*@-globstate -statictrans -unqualifiedtrans @*/";\
+ echo "/*@-retvalint -usedef -varuse -nullderef -nullassign @*/";\
+ sed -e 's,y.tab.c,getdate.c,' y.tab.c \
+ -e 's,^YYSTYPE ,static &,' \
+ -e 's,^short ,static &,' \
+ -e 's,^const short ,static &,' \
+ -e 's,^int yydebug,/*@unused@*/ static &,' \
+ -e 's,^int ,static &,' ;\
+ echo "/*@=retvalint =usedef =varuse =nullderef =nullassign @*/";\
+ echo "/*@=globstate =statictrans =unqualifiedtrans @*/";\
} > getdate.c ;\
rm -f y.tab.c; \
else \
struct stat * ost = &fsm->osb;
int saveerrno = errno;
int rc = fsm->rc;
- int left;
+ size_t left;
int i;
#define _fafilter(_a) \
void * headerFreeData( /*@only@*/ /*@null@*/ const void * data, rpmTagType type)
{
if (data) {
+ /*@-branchstate@*/
if (type < 0 ||
type == RPM_STRING_ARRAY_TYPE ||
type == RPM_I18NSTRING_TYPE ||
type == RPM_BIN_TYPE)
free((void *)data);
+ /*@=branchstate@*/
}
return NULL;
}
printNewSpecfile(Spec spec)
{
Header h = spec->packages->header;
- struct speclines *sl = spec->sl;
- struct spectags *st = spec->st;
+ speclines sl = spec->sl;
+ spectags st = spec->st;
const char * msgstr = NULL;
int i, j;
return;
for (i = 0; i < st->st_ntags; i++) {
- struct spectag * t = st->st_t + i;
+ spectag t = st->st_t + i;
const char * tn = tagName(t->t_tag);
const char * errstr;
char fmt[128];
* @todo Eliminate linkage loop into librpmbuild.a
*/
int (*parseSpecVec) (Spec *specp, const char *specFile, const char *rootdir,
- const char *buildRoot, int inBuildArch, const char *passPhrase,
+ const char *buildRoot, int recursing, const char *passPhrase,
char *cookie, int anyarch, int force) = NULL;
/**
* @todo Eliminate linkage loop into librpmbuild.a
*/
-void (*freeSpecVec) (Spec spec) = NULL;
+/*@null@*/ Spec (*freeSpecVec) (Spec spec) = NULL;
int rpmQueryVerify(QVA_t qva, rpmQVSources source, const char * arg,
rpmdb rpmdb, QVF_t showPackage)
{ Spec spec = NULL;
Package pkg;
char * buildRoot = NULL;
- int inBuildArch = 0;
+ int recursing = 0;
char * passPhrase = "";
char *cookie = NULL;
int anyarch = 1;
int force = 1;
- rc = parseSpecVec(&spec, arg, "/", buildRoot, inBuildArch, passPhrase,
+ rc = parseSpecVec(&spec, arg, "/", buildRoot, recursing, passPhrase,
cookie, anyarch, force);
if (rc || spec == NULL) {
rpmError(RPMERR_QUERY,
_("query of specfile %s failed, can't parse\n"), arg);
- if (spec != NULL) freeSpecVec(spec);
+ spec = freeSpecVec(spec);
retcode = 1;
break;
}
if (specedit) {
printNewSpecfile(spec);
- freeSpecVec(spec);
+ spec = freeSpecVec(spec);
retcode = 0;
break;
}
- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next)
(void) showPackage(qva, NULL, pkg->header);
- }
- freeSpecVec(spec);
+ spec = freeSpecVec(spec);
} break;
case RPMQV_ALL: