char *absolute = talloc_asprintf (state->removed_directories,
"%s/%s", path, filename);
if (state->debug)
- printf ("(D) add_files, pass 2: queuing passed directory %s for deletion from database\n",
- absolute);
+ printf (
+ "(D) add_files, pass 2: queuing passed directory %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_directories, absolute);
}
notmuch_filenames_get (db_subdirs));
if (state->debug)
- printf ("(D) add_files, pass 3: queuing leftover directory %s for deletion from database\n",
- absolute);
+ printf (
+ "(D) add_files, pass 3: queuing leftover directory %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_directories, absolute);
}
static int
-_maybe_upgrade (notmuch_database_t *notmuch, add_files_state_t *state) {
+_maybe_upgrade (notmuch_database_t *notmuch, add_files_state_t *state)
+{
if (notmuch_database_needs_upgrade (notmuch)) {
time_t now = time (NULL);
struct tm *gm_time = gmtime (&now);
}
int
-notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
add_files_state_t add_files_state = {
.verbosity = VERBOSITY_NORMAL,
struct timeval tv_start;
int ret = 0;
const char *db_path;
- char *dot_notmuch_path;
struct sigaction action;
_filename_node_t *f;
int opt_index;
for (notmuch_config_values_start (add_files_state.new_tags);
notmuch_config_values_valid (add_files_state.new_tags);
notmuch_config_values_move_to_next (add_files_state.new_tags)) {
- const char *tag,*error_msg;
+ const char *tag, *error_msg;
tag = notmuch_config_values_get (add_files_state.new_tags);
error_msg = illegal_tag (tag, false);
}
if (hooks) {
- ret = notmuch_run_hook (db_path, "pre-new");
+ ret = notmuch_run_hook (notmuch, "pre-new");
if (ret)
return EXIT_FAILURE;
}
- dot_notmuch_path = talloc_asprintf (notmuch, "%s/%s", db_path, ".notmuch");
-
notmuch_exit_if_unmatched_db_uuid (notmuch);
if (notmuch_database_get_revision (notmuch, NULL) == 0) {
action.sa_flags = SA_RESTART;
sigaction (SIGINT, &action, NULL);
- talloc_free (dot_notmuch_path);
- dot_notmuch_path = NULL;
-
gettimeofday (&add_files_state.tv_start, NULL);
add_files_state.removed_files = _filename_list_create (notmuch);
if (do_print_progress) {
do_print_progress = 0;
generic_print_progress ("Cleaned up", "messages",
- tv_start, add_files_state.removed_messages + add_files_state.renamed_messages,
+ tv_start, add_files_state.removed_messages +
+ add_files_state.renamed_messages,
add_files_state.removed_files->count);
}
}
notmuch_database_close (notmuch);
if (hooks && ! ret && ! interrupted)
- ret = notmuch_run_hook (db_path, "post-new");
+ ret = notmuch_run_hook (notmuch, "post-new");
notmuch_database_destroy (notmuch);