#include <rpmcli.h>
#include <rpmbuild.h>
+#include "rpmps.h"
+#include "rpmte.h"
+#include "rpmts.h"
+
#include "build.h"
#include "debug.h"
-/*@access rpmTransactionSet @*/ /* XXX compared with NULL @*/
+/*@access rpmts @*/ /* XXX compared with NULL @*/
/*@access rpmdb @*/ /* XXX compared with NULL @*/
/*@access FD_t @*/ /* XXX compared with NULL @*/
/**
*/
-static int checkSpec(rpmTransactionSet ts, Header h)
+static int checkSpec(rpmts ts, Header h)
/*@globals fileSystem, internalState @*/
/*@modifies ts, h, fileSystem, internalState @*/
{
- rpmProblem conflicts;
- int numConflicts;
+ rpmps ps;
int rc;
if (!headerIsEntry(h, RPMTAG_REQUIRENAME)
&& !headerIsEntry(h, RPMTAG_CONFLICTNAME))
return 0;
- rc = rpmtransAddPackage(ts, h, NULL, NULL, 0, NULL);
+ rc = rpmtsAddPackage(ts, h, NULL, 0, NULL);
- rc = rpmdepCheck(ts, &conflicts, &numConflicts);
- /*@-branchstate@*/
- if (rc == 0 && conflicts) {
- rpmMessage(RPMMESS_ERROR, _("failed build dependencies:\n"));
- printDepProblems(stderr, conflicts, numConflicts);
- conflicts = rpmdepFreeConflicts(conflicts, numConflicts);
+ rc = rpmtsCheck(ts);
+
+ ps = rpmtsGetProblems(ts);
+ if (rc == 0 && ps) {
+ rpmMessage(RPMMESS_ERROR, _("Failed build dependencies:\n"));
+ printDepProblems(stderr, ps);
rc = 1;
}
- /*@=branchstate@*/
+ ps = rpmpsFree(ps);
+
+ /* XXX nuke the added package. */
+ rpmtsClean(ts);
return rc;
}
/**
*/
-static int buildForTarget(rpmTransactionSet ts, const char * arg, BTA_t ba)
+static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext,
buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
/*@=branchstate@*/
+ /*@-compmempass@*/ /* FIX: static zcmds heartburn */
if (ba->buildMode == 't') {
FILE *fp;
const char * specDir;
} else {
specURL = arg;
}
+ /*@=compmempass@*/
specut = urlPath(specURL, &specFile);
if (*specFile != '/') {
return rc;
}
-int build(rpmTransactionSet ts, const char * arg, BTA_t ba, const char * rcfile)
+int build(rpmts ts, const char * arg, BTA_t ba, const char * rcfile)
{
char *t, *te;
int rc = 0;