r4863 - trunk/src/target/opkg/libopkg
tick at docs.openmoko.org
tick at docs.openmoko.org
Sun Dec 14 12:09:17 CET 2008
Author: tick
Date: 2008-12-14 12:09:16 +0100 (Sun, 14 Dec 2008)
New Revision: 4863
Modified:
trunk/src/target/opkg/libopkg/active_list.c
trunk/src/target/opkg/libopkg/pkg.c
trunk/src/target/opkg/libopkg/pkg.h
Log:
opkg: introduce active list into pkg_t
Modified: trunk/src/target/opkg/libopkg/active_list.c
===================================================================
--- trunk/src/target/opkg/libopkg/active_list.c 2008-12-13 13:28:33 UTC (rev 4862)
+++ trunk/src/target/opkg/libopkg/active_list.c 2008-12-14 11:09:16 UTC (rev 4863)
@@ -86,6 +86,10 @@
}
void active_list_clear(struct active_list *head) {
list_head_clear(&head->node);
+ if (head->depend.next != &head->depend) {
+ list_head_clear(&head->depend);
+ }
+ active_list_init(head);
}
void active_list_add_depend(struct active_list *node, struct active_list *depend) {
Modified: trunk/src/target/opkg/libopkg/pkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/pkg.c 2008-12-13 13:28:33 UTC (rev 4862)
+++ trunk/src/target/opkg/libopkg/pkg.c 2008-12-14 11:09:16 UTC (rev 4863)
@@ -90,7 +90,6 @@
int pkg_init(pkg_t *pkg)
{
- memset(pkg, 0, sizeof(pkg_t));
pkg->name = NULL;
pkg->epoch = 0;
pkg->version = NULL;
@@ -112,6 +111,8 @@
pkg->recommends_str = NULL;
pkg->suggests_count = 0;
pkg->recommends_count = 0;
+
+ active_list_init(&pkg->list);
/* Abhaya: added init for conflicts fields */
pkg->conflicts = NULL;
@@ -183,7 +184,8 @@
pkg->state_flag = SF_OK;
pkg->state_status = SS_NOT_INSTALLED;
- //for (i = 0; i < pkg->replaces_count; i++)
+ active_list_clear(&pkg->list);
+
free (pkg->replaces);
pkg->replaces = NULL;
Modified: trunk/src/target/opkg/libopkg/pkg.h
===================================================================
--- trunk/src/target/opkg/libopkg/pkg.h 2008-12-13 13:28:33 UTC (rev 4862)
+++ trunk/src/target/opkg/libopkg/pkg.h 2008-12-14 11:09:16 UTC (rev 4863)
@@ -24,6 +24,7 @@
#include "pkg_vec.h"
#include "str_list.h"
+#include "active_list.h"
#include "pkg_src.h"
#include "pkg_dest.h"
#include "opkg_conf.h"
@@ -135,6 +136,7 @@
int recommends_count;
char **suggests_str;
int suggests_count;
+ struct active_list list; /* Used for installing|upgrading */
compound_depend_t * depends;
/* Abhaya: new conflicts */
More information about the commitlog
mailing list