- Grand Renaming of rpm data types.
[platform/upstream/rpm.git] / build.c
diff --git a/build.c b/build.c
index e0ee60e..5e2e1d8 100644 (file)
--- a/build.c
+++ b/build.c
@@ -7,38 +7,44 @@
 #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, 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;
 }
@@ -89,7 +95,7 @@ static int isSpecFile(const char * specfile)
 
 /**
  */
-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,
@@ -115,6 +121,7 @@ static int buildForTarget(rpmTransactionSet ts, const char * arg, BTA_t ba)
        buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
     /*@=branchstate@*/
 
+    /*@-compmempass@*/ /* FIX: static zcmds heartburn */
     if (ba->buildMode == 't') {
        FILE *fp;
        const char * specDir;
@@ -214,6 +221,7 @@ static int buildForTarget(rpmTransactionSet ts, const char * arg, BTA_t ba)
     } else {
        specURL = arg;
     }
+    /*@=compmempass@*/
 
     specut = urlPath(specURL, &specFile);
     if (*specFile != '/') {
@@ -281,7 +289,7 @@ exit:
     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;