Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on undefined macro uses in specs #1170

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion rpmbuild.c
Expand Up @@ -421,6 +421,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
int buildAmount = ba->buildAmount;
char * buildRootURL = NULL;
char * specFile = NULL;
char *buildtree = NULL;
rpmSpec spec = NULL;
int rc = 1; /* assume failure */
rpmSpecFlags specFlags = spec_flags;
Expand All @@ -436,8 +437,12 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);

/* Create build tree if necessary */
const char * buildtree = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
const char * buildpath = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
const char * rootdir = rpmtsRootDir(ts);

if (rpmExpandMacros(NULL, buildpath, &buildtree, RPMMACRO_WUNDEF) < 0)
goto exit;

if (rpmMkdirs(!rstreq(rootdir, "/") ? rootdir : NULL , buildtree)) {
goto exit;
}
Expand Down Expand Up @@ -520,6 +525,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
free(specFile);
rpmSpecFree(spec);
free(buildRootURL);
free(buildtree);
return rc;
}

Expand Down