summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-12-06 22:06:29 +0100
committerGuillem Jover <guillem@debian.org>2013-12-07 07:43:21 +0100
commite6793331989a7ce97af08209e536f1fb5932e993 (patch)
tree7b39c04b15a2b125fe9d3075363680fb6db4a1e2 /src
parent1b158222cceb4a9481f4fbab2e26cd0e2011a1a9 (diff)
downloaddpkg-e6793331989a7ce97af08209e536f1fb5932e993.tar.gz
dpkg: Reset the statoverrides from the in-core database on reload
If a statoverride gets removed in a maintainer script, it will not be reflected on the database until after the current dpkg process has been restarted. So we need to reset the statoverride information whenever we are going to reload the statoverride database.
Diffstat (limited to 'src')
-rw-r--r--src/statdb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/statdb.c b/src/statdb.c
index 18a519702..9763cabf7 100644
--- a/src/statdb.c
+++ b/src/statdb.c
@@ -117,6 +117,7 @@ ensure_statoverrides(void)
char *loaded_list, *loaded_list_end, *thisline, *nextline, *ptr;
struct file_stat *fso;
struct filenamenode *fnn;
+ struct fileiterator *iter;
if (statoverridename == NULL)
statoverridename = dpkg_db_get_path(STATOVERRIDEFILE);
@@ -154,6 +155,12 @@ ensure_statoverrides(void)
}
file_prev = file;
+ /* Reset statoverride information. */
+ iter = files_db_iter_new();
+ while ((fnn = files_db_iter_next(iter)))
+ fnn->statoverride = NULL;
+ files_db_iter_free(iter);
+
if (!file) {
onerr_abort--;
debug(dbg_general, "%s: none, resetting", __func__);