update-copyrights 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. # Update copyright year lists.
  3. # Copyright (C) 2012-2019 Free Software Foundation, Inc.
  4. # This file is part of the GNU C Library.
  5. # The GNU C Library is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Lesser General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 2.1 of the License, or (at your option) any later version.
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. # You should have received a copy of the GNU Lesser General Public
  14. # License along with the GNU C Library; if not, see
  15. # <http://www.gnu.org/licenses/>.
  16. # Run this script with the first argument being the location of
  17. # gnulib's update-copyright script. Any other arguments are ignored.
  18. # FSF copyright notices in the glibc source directory containing this
  19. # script will be updated; glibc must then be built to update generated
  20. # files. Copyright dates in --version copyright notices are not
  21. # updated.
  22. set -e
  23. export LC_ALL=C
  24. export UPDATE_COPYRIGHT_FORCE=1
  25. export UPDATE_COPYRIGHT_USE_INTERVALS=2
  26. export UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
  27. update_script=$1
  28. if ! [ -f "$update_script" ]; then
  29. echo "error: first argument must point to gnulib update-copyright script" >&2
  30. exit 1
  31. fi
  32. cd "$(dirname "$0")/.."
  33. files=$(find . -type f | sed 's|^\./||' | grep -v '^\.git/')
  34. for f in $files; do
  35. case $f in
  36. COPYING | COPYING.LIB | manual/fdl-1.3.texi | manual/lgpl-2.1.texi)
  37. # Licenses imported verbatim from FSF sources.
  38. ;;
  39. manual/texinfo.tex | scripts/config.guess | scripts/config.sub \
  40. | scripts/install-sh | scripts/mkinstalldirs | scripts/move-if-change)
  41. # Other files imported verbatim from other GNU repositories.
  42. ;;
  43. po/*.po)
  44. # Files imported verbatim from the Translation Project.
  45. ;;
  46. INSTALL \
  47. | locale/programs/charmap-kw.h | locale/programs/locfile-kw.h \
  48. | po/libc.pot | sysdeps/gnu/errlist.c)
  49. # Generated files.
  50. ;;
  51. configure | */configure | preconfigure | */preconfigure)
  52. # Possibly generated files.
  53. if ! [ -f "$f.ac" ]; then
  54. "$update_script" "$f"
  55. fi
  56. ;;
  57. grp/initgroups.c | misc/bits/stab.def | posix/regex.h \
  58. | sysdeps/wordsize-32/divdi3.c)
  59. # Pre-1991 gaps in copyright years, so cannot use a single range.
  60. UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f"
  61. ;;
  62. *)
  63. "$update_script" "$f"
  64. ;;
  65. esac
  66. done