]> granicus.if.org Git - strace/commitdiff
tests: move generated common header comment into a variable
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 25 Apr 2017 02:20:50 +0000 (04:20 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 25 Apr 2017 14:35:47 +0000 (14:35 +0000)
* tests/gen_tests.sh: Move generated file header comment
into a variable, use it in all cases.

tests/gen_tests.sh

index 89108e8a4154de0e3399a3910bb0df639a0d67c9..ac3b7e15c42edec74e926b3e7bc4ad9830035267 100755 (executable)
@@ -63,19 +63,21 @@ while read -r name args; do {
                [ "$match" = "$name" ] || continue
        fi
 
+       hdr="\
+#!/bin/sh -efu
+# Generated by $0 from $input; do not edit."
+
        case "$args" in
                +*)
                cat <<-EOF
-               #!/bin/sh -efu
-               # Generated by $0 from $input; do not edit.
+               $hdr
                . "\${srcdir=.}/${args#+}"
                EOF
                ;;
 
                ''|-*)
                cat <<-EOF
-               #!/bin/sh -efu
-               # Generated by $0 from $input; do not edit.
+               $hdr
                . "\${srcdir=.}/init.sh"
                run_strace_match_diff $args
                EOF
@@ -83,8 +85,7 @@ while read -r name args; do {
 
                *)
                cat <<-EOF
-               #!/bin/sh -efu
-               # Generated by $0 from $input; do not edit.
+               $hdr
                . "\${srcdir=.}/init.sh"
                $args
                EOF