]> granicus.if.org Git - strace/blob - tests/gen_pure_executables.sh
Update copyright headers
[strace] / tests / gen_pure_executables.sh
1 #!/bin/sh -efu
2 #
3 # Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
4 # All rights reserved.
5 #
6 # SPDX-License-Identifier: GPL-2.0-or-later
7
8 usage()
9 {
10         cat >&2 <<EOF
11 Usage: $0 [<input> [<output>]]
12
13 Generate pure_executables.am from <input> list.
14 Deduce output file from <input> unless an <output> is specified.
15 EOF
16         exit 1
17 }
18
19 input="${0%/*}/pure_executables.list"
20 [ $# -eq 0 ] || { input="$1"; shift; }
21 output="$(dirname "$input")/pure_executables.am"
22 [ $# -eq 0 ] || { output="$1"; shift; }
23 [ $# -eq 0 ] || usage
24
25 exec > "$output"
26
27 echo "# Generated by $0 from $input; do not edit."
28 echo 'PURE_EXECUTABLES = \'
29 sed -n 's/^[^#].*/  & \\/p' < "$input"
30 echo '  #'