int specut;
char buf[BUFSIZ];
rpmSpec spec = NULL;
- int rc;
+ int rc = 1; /* assume failure */
#ifndef DYING
rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
char *s = alloca(BUFSIZ);
if (!getcwd(s, BUFSIZ)) {
rpmlog(RPMLOG_ERR, _("getcwd failed: %m\n"));
- rc = 1;
goto exit;
}
strcat(s, "/");
struct stat st;
if (stat(specURL, &st) < 0) {
rpmlog(RPMLOG_ERR, _("failed to stat %s: %m\n"), specURL);
- rc = 1;
goto exit;
}
if (! S_ISREG(st.st_mode)) {
rpmlog(RPMLOG_ERR, _("File %s is not a regular file.\n"),
specURL);
- rc = 1;
goto exit;
}
if (!isSpecFile(specURL)) {
rpmlog(RPMLOG_ERR,
_("File %s does not appear to be a specfile.\n"), specURL);
- rc = 1;
goto exit;
}
}
if (parseSpec(ts, specURL, ba->rootdir, buildRootURL, 0, passPhrase,
cookie, _anyarch(buildAmount), ba->force))
{
- rc = 1;
goto exit;
}
#undef _anyarch
if ((spec = rpmtsSetSpec(ts, NULL)) == NULL) {
- rc = 1;
goto exit;
}
/* Check build prerequisites */
if (!ba->noDeps && checkSpec(ts, spec->sourceHeader)) {
- rc = 1;
goto exit;
}
if (buildSpec(ts, spec, buildAmount, ba->noBuild)) {
- rc = 1;
goto exit;
}