Blame scripts/update-copyrights

Packit 6c4009
#!/bin/sh
Packit 6c4009
# Update copyright year lists.
Packit 6c4009
# Copyright (C) 2012-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
# The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
# modify it under the terms of the GNU Lesser General Public
Packit 6c4009
# License as published by the Free Software Foundation; either
Packit 6c4009
# version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
# The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
# Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
# You should have received a copy of the GNU Lesser General Public
Packit 6c4009
# License along with the GNU C Library; if not, see
Packit 6c4009
# <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
# Run this script with the first argument being the location of
Packit 6c4009
# gnulib's update-copyright script.  Any other arguments are ignored.
Packit 6c4009
# FSF copyright notices in the glibc source directory containing this
Packit 6c4009
# script will be updated; glibc must then be built to update generated
Packit 6c4009
# files.  Copyright dates in --version copyright notices are not
Packit 6c4009
# updated.
Packit 6c4009
Packit 6c4009
set -e
Packit 6c4009
Packit 6c4009
export LC_ALL=C
Packit 6c4009
export UPDATE_COPYRIGHT_FORCE=1
Packit 6c4009
export UPDATE_COPYRIGHT_USE_INTERVALS=2
Packit 6c4009
export UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
Packit 6c4009
Packit 6c4009
update_script=$1
Packit 6c4009
Packit 6c4009
if ! [ -f "$update_script" ]; then
Packit 6c4009
  echo "error: first argument must point to gnulib update-copyright script" >&2
Packit 6c4009
  exit 1
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
cd "$(dirname "$0")/.."
Packit 6c4009
Packit 6c4009
files=$(find . -type f | sed 's|^\./||' | grep -v '^\.git/')
Packit 6c4009
Packit 6c4009
for f in $files; do
Packit 6c4009
  case $f in
Packit 6c4009
    COPYING | COPYING.LIB | manual/fdl-1.3.texi | manual/lgpl-2.1.texi)
Packit 6c4009
      # Licenses imported verbatim from FSF sources.
Packit 6c4009
      ;;
Packit 6c4009
    manual/texinfo.tex | scripts/config.guess | scripts/config.sub \
Packit 6c4009
      | scripts/install-sh | scripts/mkinstalldirs | scripts/move-if-change)
Packit 6c4009
      # Other files imported verbatim from other GNU repositories.
Packit 6c4009
      ;;
Packit 6c4009
    po/*.po)
Packit 6c4009
      # Files imported verbatim from the Translation Project.
Packit 6c4009
      ;;
Packit 6c4009
    INSTALL | locale/C-translit.h \
Packit 6c4009
      | locale/programs/charmap-kw.h | locale/programs/locfile-kw.h \
Packit 6c4009
      | po/libc.pot | sysdeps/gnu/errlist.c)
Packit 6c4009
      # Generated files.
Packit 6c4009
      ;;
Packit 6c4009
    configure | */configure | preconfigure | */preconfigure)
Packit 6c4009
      # Possibly generated files.
Packit 6c4009
      if ! [ -f "$f.ac" ]; then
Packit 6c4009
	"$update_script" "$f"
Packit 6c4009
      fi
Packit 6c4009
      ;;
Packit 6c4009
    grp/initgroups.c | misc/bits/stab.def | posix/regex.h \
Packit 6c4009
      | sysdeps/wordsize-32/divdi3.c)
Packit 6c4009
      # Pre-1991 gaps in copyright years, so cannot use a single range.
Packit 6c4009
      UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f"
Packit 6c4009
      ;;
Packit 6c4009
    *)
Packit 6c4009
      "$update_script" "$f"
Packit 6c4009
      ;;
Packit 6c4009
  esac
Packit 6c4009
done