Pass tsflags to rpmal and remember them
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 1 Sep 2011 10:19:18 +0000 (13:19 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 1 Sep 2011 10:21:45 +0000 (13:21 +0300)
- No functional changes here, but we'll need to know some of these
  bits for accurately calculating various dependency bits later on.

lib/depends.c
lib/order.c
lib/rpmal.c
lib/rpmal.h

index 75d7830..4db55d2 100644 (file)
@@ -286,7 +286,8 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
     }
 
     if (tsmem->addedPackages == NULL) {
-       tsmem->addedPackages = rpmalCreate(5, tscolor, rpmtsPrefColor(ts));
+       tsmem->addedPackages = rpmalCreate(5, rpmtsFlags(ts),
+                                          tscolor, rpmtsPrefColor(ts));
     }
 
     if (oc >= tsmem->orderAlloced) {
index e709bd5..0c8d1cb 100644 (file)
@@ -548,7 +548,8 @@ int rpmtsOrder(rpmts ts)
     rpmte * newOrder;
     int newOrderCount = 0;
     int rc;
-    rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts), prefcolor);
+    rpmal erasedPackages = rpmalCreate(5, rpmtsFlags(ts),
+                                       rpmtsColor(ts), prefcolor);
     scc SCCs;
     int nelem = rpmtsNElements(ts);
     tsortInfo sortInfo = xcalloc(nelem, sizeof(struct tsortInfo_s));
index 15c2634..a84fad8 100644 (file)
@@ -68,6 +68,7 @@ struct rpmal_s {
     int delta;                 /*!< Delta for pkg list reallocation. */
     int size;                  /*!< No. of pkgs in list. */
     int alloced;               /*!< No. of pkgs allocated for list. */
+    rpmtransFlags tsflags;     /*!< Transaction control flags. */
     rpm_color_t tscolor;       /*!< Transaction color. */
     rpm_color_t prefcolor;     /*!< Transaction preferred color. */
 };
@@ -82,7 +83,8 @@ static void rpmalFreeIndex(rpmal al)
     al->fileHash = rpmalFileHashFree(al->fileHash);
 }
 
-rpmal rpmalCreate(int delta, rpm_color_t tscolor, rpm_color_t prefcolor)
+rpmal rpmalCreate(int delta, rpmtransFlags tsflags,
+                 rpm_color_t tscolor, rpm_color_t prefcolor)
 {
     rpmal al = xcalloc(1, sizeof(*al));
 
@@ -93,6 +95,7 @@ rpmal rpmalCreate(int delta, rpm_color_t tscolor, rpm_color_t prefcolor)
 
     al->providesHash = NULL;
     al->fileHash = NULL;
+    al->tsflags = tsflags;
     al->tscolor = tscolor;
     al->prefcolor = prefcolor;
 
index 9a0e640..8e4b805 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <rpm/rpmtypes.h>
+#include <rpm/rpmts.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -17,12 +18,14 @@ typedef struct rpmal_s * rpmal;
 /**
  * Initialize available packckages, items, and directory list.
  * @param delta                no. of entries to add on each realloc
+ * @param tsflags      transaction control flags
  * @param tscolor      transaction color bits
  * @param prefcolor    preferred color
  * @return al          new available list
  */
 RPM_GNUC_INTERNAL
-rpmal rpmalCreate(int delta, rpm_color_t tscolor, rpm_color_t prefcolor);
+rpmal rpmalCreate(int delta, rpmtransFlags tsflags,
+                 rpm_color_t tscolor, rpm_color_t prefcolor);
 
 /**
  * Free available packages, items, and directory members.