static int shortCircuit = 0; /*!< from --short-circuit */
static char buildMode = 0; /*!< Build mode (one of "btBC") */
static char buildChar = 0; /*!< Build stage (one of "abcilps ") */
+static rpmBuildFlags nobuildAmount = 0; /*!< Build stage disablers */
static ARGV_t build_targets = NULL; /*!< Target platform(s) */
static void buildArgCallback( poptContext con,
N_("generate package header(s) compatible with (legacy) rpm v3 packaging"),
NULL},
+ { "noclean", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CLEAN,
+ N_("do not execute %clean stage of the build"), NULL },
+ { "nocheck", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CHECK,
+ N_("do not execute %check stage of the build"), NULL },
+
{ "nolang", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_NOLANG,
N_("do not accept i18N msgstr's from specfile"), NULL},
{ "rmsource", '\0', 0, 0, POPT_RMSOURCE,
rpmpsPrint(NULL, ps);
}
rc = (ps != NULL);
- ps = rpmpsFree(ps);
+ rpmpsFree(ps);
return rc;
}
int checking;
f = fopen(specfile, "r");
- if (f == NULL || ferror(f)) {
+ if (f == NULL) {
rpmlog(RPMLOG_ERR, _("Unable to open spec file %s: %s\n"),
specfile, strerror(errno));
return 0;
int justRm = ((buildAmount & ~(RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)) == 0);
rpmSpecFlags specFlags = spec_flags;
-#ifndef DYING
- rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
-#endif
-
if (ba->buildRootOverride)
buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
}
exit:
- vsflags = rpmtsSetVSFlags(ts, ovsflags);
+ rpmtsSetVSFlags(ts, ovsflags);
/* Restore original configuration. */
rpmFreeMacros(NULL);
rpmFreeRpmrc();
ba->buildAmount |= RPMBUILD_CLEAN;
ba->buildAmount |= RPMBUILD_RMBUILD;
}
+ ba->buildAmount &= ~(nobuildAmount);
while ((pkg = poptGetArg(optCon))) {
char * specFile = NULL;
ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
break;
}
+ ba->buildAmount &= ~(nobuildAmount);
while ((pkg = poptGetArg(optCon))) {
ba->rootdir = rpmcliRootDir;
break;
}
- ts = rpmtsFree(ts);
- finishPipe();
- ba->buildRootOverride = _free(ba->buildRootOverride);
- build_targets = argvFree(build_targets);
+ rpmtsFree(ts);
+ if (finishPipe())
+ ec = EXIT_FAILURE;
+ free(ba->buildRootOverride);
+ argvFree(build_targets);
rpmcliFini(optCon);