]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: add separator to header, update tests
authorKarel Zak <kzak@redhat.com>
Tue, 25 Jan 2022 15:31:02 +0000 (16:31 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 25 Jan 2022 15:31:02 +0000 (16:31 +0100)
* add separator before "<not executed on terminal>"
* update test (due to 4d8edee5eeb3ea5457eeff321bca7dd64108eb8f)

Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/script.c
tests/expected/script/options-append
tests/expected/script/options-force
tests/expected/script/options-quiet
tests/expected/script/options-return
tests/expected/script/options-size

index afd43eb515c75f813893e2afcb2e77d0453ba990..ec9536477e7fb376a42f3f98b035b54305f052c7 100644 (file)
@@ -409,10 +409,10 @@ static int log_start(struct script_control *ctl,
                        if (ctl->ttyname)
                                x += fprintf(log->fp, "%*sTTY=\"%s\"", !!x, "", ctl->ttyname);
 
-                       fprintf(log->fp, "%*sCOLUMNS=\"%d\" LINES=\"%d\"", !!x, "",
+                       x += fprintf(log->fp, "%*sCOLUMNS=\"%d\" LINES=\"%d\"", !!x, "",
                                        ctl->ttycols, ctl->ttylines);
                } else
-                       fprintf(log->fp, _("<not executed on terminal>"));
+                       fprintf(log->fp, _("%*s<not executed on terminal>"), !!x, "");
 
                fputs("]\n", log->fp);
                break;
index f18c47b94af0ea84249355e622492ad601bed7b2..584d921b11dcd3e69a995903291ea37b7c4f6ed6 100644 (file)
@@ -1,8 +1,8 @@
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo append1" <not executed on terminal>]
 append1\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo append2" <not executed on terminal>]
 append2\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
index d8c005a2d7bf7c054a4712fb947256682ef3877c..7b9854ee0e33f0d9511e93bfdbe48afcb4e6ba26 100644 (file)
@@ -2,12 +2,12 @@ test_script: output file `typescript' is a link
 Use --force if you really want to use it.
 Program not started.
 1
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo with force" <not executed on terminal>]
 with force\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
 0
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo not typescript" <not executed on terminal>]
 not typescript\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
index a06b6a1952e2a462ae131cc3ef21cf0ba74ef751..9718d17060a39fc9be821aaffd0d2644ba73ae14 100644 (file)
@@ -1,8 +1,8 @@
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo quiet1" <not executed on terminal>]
 quiet1\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo quiet2" <not executed on terminal>]
 quiet2\r
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
index 437aea60057575238b97a8f40e7dd34d892be339..94cd86098ea2b1d404e2a7c16897cdcc0cb4f0ba 100644 (file)
@@ -1,16 +1,16 @@
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 1" <not executed on terminal>]
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="1"]
 0
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 0" <not executed on terminal>]
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="0"]
 0
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 42" <not executed on terminal>]
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="42"]
 42
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="exit 127" <not executed on terminal>]
 
 Script done on 2015-05-24 17:43:18+00:00 [COMMAND_EXIT_CODE="127"]
 127
index 459424b14d89e66d20d0d947942f45ec5c4bf711..bdbe688af0b48c22b4a7dead52e3978cada706c6 100644 (file)
@@ -1,8 +1,8 @@
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 1:1234567890" <not executed on terminal>]
 1:1234567890\r
 
 Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>]
-Script started on 2015-05-24 17:43:18+00:00 [<not executed on terminal>]
+Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 2:1234567890" <not executed on terminal>]
 2:1234567890\r
 
 Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>]