summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-06-11 17:16:03 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-06-11 17:16:03 +0300
commit31f0d94df1c50a7a2802c76f491620be22b9a8fa (patch)
treec2fc50ef1036ab97decef831c27c888136b992ab /lib
parent85f9df3c0d511cb1e84484c8d616b98e5e4a2123 (diff)
downloadlibrpm-tizen-31f0d94df1c50a7a2802c76f491620be22b9a8fa.tar.gz
librpm-tizen-31f0d94df1c50a7a2802c76f491620be22b9a8fa.tar.bz2
librpm-tizen-31f0d94df1c50a7a2802c76f491620be22b9a8fa.zip
Add preferred color to rpmal
Diffstat (limited to 'lib')
-rw-r--r--lib/depends.c2
-rw-r--r--lib/order.c2
-rw-r--r--lib/rpmal.c4
-rw-r--r--lib/rpmal.h3
4 files changed, 7 insertions, 4 deletions
diff --git a/lib/depends.c b/lib/depends.c
index c96702856..945d9ac8d 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -130,7 +130,7 @@ int rpmtsAddInstallElement(rpmts ts, Header h,
}
if (ts->addedPackages == NULL) {
- ts->addedPackages = rpmalCreate(5, tscolor);
+ ts->addedPackages = rpmalCreate(5, tscolor, rpmtsPrefColor(ts));
}
/* XXX Always add source headers. */
diff --git a/lib/order.c b/lib/order.c
index 2409908c3..b9a8d4759 100644
--- a/lib/order.c
+++ b/lib/order.c
@@ -584,7 +584,7 @@ int rpmtsOrder(rpmts ts)
int newOrderCount = 0;
int treex;
int rc;
- rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts));
+ rpmal erasedPackages = rpmalCreate(5, rpmtsColor(ts), prefcolor);
scc SCCs;
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_ORDER), 0);
diff --git a/lib/rpmal.c b/lib/rpmal.c
index ee7abb72b..021261482 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -87,6 +87,7 @@ struct rpmal_s {
int size; /*!< No. of pkgs in list. */
int alloced; /*!< No. of pkgs allocated for list. */
rpm_color_t tscolor; /*!< Transaction color. */
+ rpm_color_t prefcolor; /*!< Transaction preferred color. */
};
/**
@@ -99,7 +100,7 @@ static void rpmalFreeIndex(rpmal al)
al->fileHash = rpmalFileHashFree(al->fileHash);
}
-rpmal rpmalCreate(int delta, rpm_color_t tscolor)
+rpmal rpmalCreate(int delta, rpm_color_t tscolor, rpm_color_t prefcolor)
{
rpmal al = xcalloc(1, sizeof(*al));
@@ -111,6 +112,7 @@ rpmal rpmalCreate(int delta, rpm_color_t tscolor)
al->providesHash = NULL;
al->fileHash = NULL;
al->tscolor = tscolor;
+ al->prefcolor = prefcolor;
return al;
}
diff --git a/lib/rpmal.h b/lib/rpmal.h
index ffa9d5bf7..83602e305 100644
--- a/lib/rpmal.h
+++ b/lib/rpmal.h
@@ -21,10 +21,11 @@ typedef void * rpmalKey;
* Initialize available packckages, items, and directory list.
* @param delta no. of entries to add on each realloc
* @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);
+rpmal rpmalCreate(int delta, rpm_color_t tscolor, rpm_color_t prefcolor);
/**
* Free available packages, items, and directory members.