summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-06 16:00:20 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-06 16:00:20 +0300
commitf02f326238fd1e6424bf914e102ce265e7c156ec (patch)
treeceded7eb995efa68086b613cbc286d198b60da0a /src/state.c
parentced1fa83d6361ebfdc40920d98eb292ca4661b4e (diff)
downloadapk-tools-f02f326238fd1e6424bf914e102ce265e7c156ec.tar.bz2
apk-tools-f02f326238fd1e6424bf914e102ce265e7c156ec.tar.xz
db: prefer local repositories, and implement --no-network
this helps boots sequence when network is not available.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index ff1a2bb..f18b005 100644
--- a/src/state.c
+++ b/src/state.c
@@ -142,6 +142,7 @@ struct apk_state *apk_state_new(struct apk_database *db)
state = (struct apk_state*) calloc(1, num_bytes);
state->refs = 1;
state->num_names = db->name_id;
+ state->db = db;
list_init(&state->change_list_head);
/* Instantiate each 'name' target in world, and lockout incompatible
@@ -292,6 +293,10 @@ int apk_state_lock_dependency(struct apk_state *state,
if (apk_pkg_get_state(c->pkgs[i]) == APK_PKG_INSTALLED)
installed = pkg;
+ if (pkg->filename == NULL &&
+ apk_db_select_repo(state->db, pkg) == NULL)
+ continue;
+
if (latest == NULL) {
latest = pkg;
continue;