From e814a73480fe5fa2e7b4f0867a808b9535e9e182 Mon Sep 17 00:00:00 2001 From: Miguel Bernal Marin Date: Wed, 6 Dec 2017 17:48:51 -0600 Subject: [PATCH] heuristics: set /usr/src/kernel as not state dir The kernel sources will be shipped in /usr/src/kernel but /usr/src/* is state. This commit enables /usr/src/kernel and its contents as a no state directory. Fixes #108 Signed-off-by: Miguel Bernal Marin --- src/heuristics.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/heuristics.c b/src/heuristics.c index 94eee53..9a8dfb3 100644 --- a/src/heuristics.c +++ b/src/heuristics.c @@ -45,6 +45,7 @@ static void runtime_state_heuristics(struct file *file) /* these are shipped directories that are not themselves state, * rather only their contents are state */ if ((strcmp(file->filename, "/usr/src/debug") == 0) || + (strcmp(file->filename, "/usr/src/kernel") == 0) || (strcmp(file->filename, "/dev") == 0) || (strcmp(file->filename, "/home") == 0) || (strcmp(file->filename, "/proc") == 0) || @@ -56,6 +57,12 @@ static void runtime_state_heuristics(struct file *file) return; } + /* the contents of these directory are not state, + * but it belongs to a state directory */ + if ((strncmp(file->filename, "/usr/src/kernel/", 16) == 0)) { + return; + } + /* the contents of these directory are state, ideally this never * triggers if our package builds are clean */ if ((strncmp(file->filename, "/dev/", 5) == 0) || @@ -72,7 +79,7 @@ static void runtime_state_heuristics(struct file *file) return; } - /* these are commonly added directories for user customizatio, + /* these are commonly added directories for user customization, * ideally this never triggers if our package builds are clean */ if ((strncmp(file->filename, "/acct", 5) == 0) || (strncmp(file->filename, "/cache", 6) == 0) ||