]> diplodocus.org Git - nmh/commitdiff
Wait for user to ack new version message.
authorDavid Levine <levinedl@acm.org>
Wed, 28 Sep 2016 22:48:16 +0000 (18:48 -0400)
committerDavid Levine <levinedl@acm.org>
Wed, 28 Sep 2016 22:48:16 +0000 (18:48 -0400)
sbr/utils.c
test/install-mh/test-version-check

index dcdf24a..783ac22 100644 (file)
@@ -392,16 +392,20 @@ nmh_init(const char *argv0, int read_context) {
             strcmp (invo_name, "whom")) {
 
             if (nmh_version_changed ()) {
             strcmp (invo_name, "whom")) {
 
             if (nmh_version_changed ()) {
-                fprintf (stderr, "==========================================="
-                        "============================\n");
-                fprintf (stderr, "Welcome to nmh version %s\n\n", VERSION);
-                fprintf (stderr, "See the release notes in %s/NEWS .\n\n",
+                printf ("==================================================="
+                        "====================\n");
+                printf ("Welcome to nmh version %s\n\n", VERSION);
+                printf ("See the release notes in %s/NEWS .\n\n",
                          mhdocdir);
                          mhdocdir);
-                print_intro (stderr, 1);
-                fprintf (stderr, "\nThis message will not be repeated until "
+                print_intro (stdout, 1);
+                printf ("\nThis message will not be repeated until "
                         "nmh is next updated.\n");
                         "nmh is next updated.\n");
-                fprintf (stderr, "==========================================="
-                        "============================\n\n\n");
+                printf ("==================================================="
+                        "====================\n\n");
+
+                fputs ("Press enter to continue: ", stdout);
+                (void) read_line ();
+                putchar ('\n');
             }
         }
 
             }
         }
 
index b8a91b6..f2fbe6c 100755 (executable)
@@ -27,7 +27,10 @@ start_test 'with welcome message'
 # Removing Version will trigger the welcome message.
 grep -v Version "$context" > "$context.NEW"
 mv -f "$context.NEW" "$context"
 # Removing Version will trigger the welcome message.
 grep -v Version "$context" > "$context.NEW"
 mv -f "$context.NEW" "$context"
-script -c 'pick last' -q "$actual" >/dev/null
+# The will command wait for the user to hit return.  script seems to do what
+# we want, continue, when run in the background.
+script -c 'pick last' -f -q "$actual" >/dev/null &
+wait $!
 grep 'Welcome to nmh version ' "$actual" >/dev/null
 rm "$actual"
 finish_test
 grep 'Welcome to nmh version ' "$actual" >/dev/null
 rm "$actual"
 finish_test
@@ -36,7 +39,8 @@ finish_test
 start_test 'without welcome message'
 # After running the previous test, this one should not have
 # the welcome message.
 start_test 'without welcome message'
 # After running the previous test, this one should not have
 # the welcome message.
-script -c 'pick last' -q "$actual" >/dev/null
+script -c 'pick last' -f -q "$actual" >/dev/null &
+wait $!
 grep 'Welcome to nmh version ' "$actual" >/dev/null  &&  false
 rm "$actual"
 finish_test
 grep 'Welcome to nmh version ' "$actual" >/dev/null  &&  false
 rm "$actual"
 finish_test