summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-02-21 15:31:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-03-30 12:53:02 +0000
commite43ec608749a44a305afec89f46bcb282ab93d10 (patch)
treef9677a1e6347a0aa98a8ff83911f3d57667e1dfc /src
parent0f6475b88466b6e4cd424f9807fa14eab0fafe96 (diff)
downloadapk-tools-e43ec608749a44a305afec89f46bcb282ab93d10.tar.gz
apk-tools-e43ec608749a44a305afec89f46bcb282ab93d10.tar.bz2
apk-tools-e43ec608749a44a305afec89f46bcb282ab93d10.tar.xz
apk-tools-e43ec608749a44a305afec89f46bcb282ab93d10.zip
state: use db in own struc when committing
The db parameter to apk_state_commit is not needed so we remove it.
Diffstat (limited to 'src')
-rw-r--r--src/add.c2
-rw-r--r--src/apk_state.h2
-rw-r--r--src/del.c2
-rw-r--r--src/fix.c2
-rw-r--r--src/state.c4
-rw-r--r--src/upgrade.c4
6 files changed, 8 insertions, 8 deletions
diff --git a/src/add.c b/src/add.c
index 977c772..d63f61d 100644
--- a/src/add.c
+++ b/src/add.c
@@ -142,7 +142,7 @@ static int add_main(void *ctx, struct apk_database *db, int argc, char **argv)
apk_state_print_errors(state);
r = -1;
} else {
- r = apk_state_commit(state, db);
+ r = apk_state_commit(state);
}
if (state != NULL)
apk_state_unref(state);
diff --git a/src/apk_state.h b/src/apk_state.h
index 1ac049a..e0df54e 100644
--- a/src/apk_state.h
+++ b/src/apk_state.h
@@ -37,7 +37,7 @@ struct apk_state *apk_state_dup(struct apk_state *state);
void apk_state_unref(struct apk_state *state);
void apk_state_print_errors(struct apk_state *state);
-int apk_state_commit(struct apk_state *state, struct apk_database *db);
+int apk_state_commit(struct apk_state *state);
int apk_state_lock_dependency(struct apk_state *state,
struct apk_dependency *dep);
int apk_state_lock_name(struct apk_state *state,
diff --git a/src/del.c b/src/del.c
index 695785f..4c00ade 100644
--- a/src/del.c
+++ b/src/del.c
@@ -58,7 +58,7 @@ static int del_main(void *ctx, struct apk_database *db, int argc, char **argv)
r |= apk_state_lock_dependency(state, &dep);
}
if (r == 0)
- r = apk_state_commit(state, db);
+ r = apk_state_commit(state);
else
apk_state_print_errors(state);
err:
diff --git a/src/fix.c b/src/fix.c
index 1bacce2..48cab9c 100644
--- a/src/fix.c
+++ b/src/fix.c
@@ -89,7 +89,7 @@ static int fix_main(void *pctx, struct apk_database *db, int argc, char **argv)
r |= apk_state_lock_dependency(state, &deps[i]);
if (r == 0 || (apk_flags & APK_FORCE))
- r = apk_state_commit(state, db);
+ r = apk_state_commit(state);
else
apk_state_print_errors(state);
err:
diff --git a/src/state.c b/src/state.c
index fef1cbb..d63e1bf 100644
--- a/src/state.c
+++ b/src/state.c
@@ -937,11 +937,11 @@ void apk_state_print_errors(struct apk_state *state)
printf("\n");
}
-int apk_state_commit(struct apk_state *state,
- struct apk_database *db)
+int apk_state_commit(struct apk_state *state)
{
struct progress prog;
struct apk_change *change;
+ struct apk_database *db = state->db;
int n = 0, r = 0, size_diff = 0, toplevel = FALSE, deleteonly = TRUE;
/* Count what needs to be done */
diff --git a/src/upgrade.c b/src/upgrade.c
index eb51457..4db0c00 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -48,7 +48,7 @@ int apk_do_self_upgrade(struct apk_database *db, struct apk_state *state)
apk_message("Uprading first to new apk-tools:");
state->print_ok = 0;
- r = apk_state_commit(state, db);
+ r = apk_state_commit(state);
apk_state_unref(state);
apk_db_close(db);
@@ -101,7 +101,7 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
if (i != 0)
printf("\n");
- r = apk_state_commit(state, db);
+ r = apk_state_commit(state);
} else
apk_state_print_errors(state);
err: