#!/bin/sh
# Test suite for update-copyright.
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This file is part of the GNUlib Library.
#
# This program is free software: you can redistribute it and/or modify
# Ensure the update-copyright program gets found.
PATH=$abs_aux_dir:$PATH
+export PATH
TMP_BASE=update-copyright.test
trap 'rm -f $TMP_BASE*' 0 1 2 3 15
# Foundation, Inc.
EOF
-rm -f $TMP.*.bak
UPDATE_COPYRIGHT_YEAR=2009 \
- update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990-2005, 2007-2009 Free Software
# Foundation, Inc.
EOF
-rm -f $TMP.*.bak
UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_USE_INTERVALS=1 \
- update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990-2005, 2007-2010 Free Software Foundation,
# Copyright (C) 1990-2005, 2007-2010 Free Software Foundation, Inc.
EOF
-rm -f $TMP.*.bak
UPDATE_COPYRIGHT_YEAR=2010 UPDATE_COPYRIGHT_FORCE=1 \
- update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
+ update-copyright $TMP.? 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP.4: warning: FSF copyright statement not found
-$TMP.5: warning: FSF copyright statement not found
+$TMP.4: warning: copyright statement not found
+$TMP.5: warning: copyright statement not found
EOF
compare - $TMP.1 <<EOF || exit 1
Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP: warning: FSF copyright statement not found
+$TMP: warning: copyright statement not found
EOF
compare - $TMP <<EOF || exit 1
#### Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
compare - $TMP-stderr <<EOF || exit 1
-$TMP: warning: FSF copyright statement not found
+$TMP: warning: copyright statement not found
EOF
compare - $TMP <<EOF || exit 1
#Copyright (C) 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985,
# Copyright (C) 1987-1988, 1991-2011 Free Software
# Foundation, Inc.
EOF
+UPDATE_COPYRIGHT_YEAR=2011 UPDATE_COPYRIGHT_USE_INTERVALS=2 \
+ UPDATE_COPYRIGHT_FORCE=1 update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
+compare /dev/null $TMP-stdout || exit 1
+compare /dev/null $TMP-stderr || exit 1
+compare - $TMP <<EOF || exit 1
+ # Copyright (C) 1987-2011 Free Software Foundation, Inc.
+EOF
rm $TMP*
## --------- ##
/* Copyright 1987, 1988, 1991, 1992 Free Software Foundation, Inc. ***
* End of comments. */
EOF
+cat > $TMP.two-digit-final-is-substr-of-first <<EOF
+ /* Copyright 1991, 99 Free Software Foundation, Inc. */
+EOF
UPDATE_COPYRIGHT_YEAR=2010 \
update-copyright $TMP.* 1> $TMP-stdout 2> $TMP-stderr
compare /dev/null $TMP-stdout || exit 1
Inc. ***
* End of comments. */
EOF
+compare - $TMP.two-digit-final-is-substr-of-first <<EOF || exit 1
+ /* Copyright 1991, 1999, 2010 Free Software Foundation, Inc. */
+EOF
rm $TMP*
exit 0