• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3# Check -V option.
4. "${srcdir=.}/init.sh"
5
6run_prog_skip_if_failed date +%Y > /dev/null
7year="$(date +%Y)"
8
9run_strace -V > "$LOG"
10
11getval()
12{
13	sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' \
14		../../config.h
15}
16
17config_year=$(getval COPYRIGHT_YEAR)
18
19[ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || {
20	echo >&2 "The year derived from config.h (${config_year}) does not pass sanity checks."
21	exit 1
22}
23
24cat > "$EXP" << __EOF__
25$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION)
26Copyright (c) 1991-${config_year} The strace developers <$(getval PACKAGE_URL)>.
27This is free software; see the source for copying conditions.  There is NO
28warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29__EOF__
30
31match_diff "$LOG" "$EXP"
32