WARNING: database upgrade coming

Jani Nikula jani at nikula.org
Mon Mar 17 14:31:40 PDT 2014


On Mon, 17 Mar 2014, David Bremner <david at tethera.net> wrote:
> Jani Nikula <jani at nikula.org> writes:
>
>>
>> FWIW it should always be safe to interrupt the upgrade; I know we don't
>> inform the user about this.
>>
>
> With that in mind, would it be reasonable/worthwhile to print a 5 second (or so)
> countdown before running the upgrade? But then people who run it
> non-interactively would still automagically get the upgrade, just 5
> seconds later.

Something like this? Just insert text that makes sense to the user. ;)

Jani.


diff --git a/notmuch-new.c b/notmuch-new.c
index 82acf695353e..f256a3142eb0 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -989,8 +989,11 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
 	    return EXIT_FAILURE;
 
 	if (notmuch_database_needs_upgrade (notmuch)) {
-	    if (add_files_state.verbosity >= VERBOSITY_NORMAL)
+	    if (add_files_state.verbosity >= VERBOSITY_NORMAL) {
 		printf ("Welcome to a new version of notmuch! Your database will now be upgraded.\n");
+		sleep (5);
+		printf ("Now really.\n");
+	    }
 	    gettimeofday (&add_files_state.tv_start, NULL);
 	    notmuch_database_upgrade (notmuch,
 				      add_files_state.verbosity >= VERBOSITY_NORMAL ? upgrade_print_progress : NULL,


More information about the notmuch mailing list