Merge branch '4627_help_segfault'
[midnight-commander.git] / maint / update-years.sh
blobc0febbb7e02ecb76bae13830a31a32537ecd8c65
1 #! /bin/sh
3 YEAR=`date +%Y`
5 SOURCES="`find lib src tests -name '*.c'`"
6 SOURCES="$SOURCES src/man2hlp/man2hlp.in"
7 SOURCES="$SOURCES tests/src/vfs/extfs/helpers-list/test_all"
9 LINE="Copyright (C)"
11 for i in $SOURCES; do
12 # replace year: XXXX-YYYY -> XXXX-ZZZZ
13 # add year: XXXX -> XXXX-ZZZZ
14 ${SED-sed} -e "
15 1,20 {
16 /$LINE/s/-[0-9]\{4\}$/-$YEAR/
18 1,20 {
19 /$LINE/s/ [0-9]\{4\}$/&-$YEAR/
20 }" $i > $i.tmp && mv -f $i.tmp $i
21 done
23 # special case
24 ${SED-sed} -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c > src/editor/editwidget.c.tmp && \
25 mv -f src/editor/editwidget.c.tmp src/editor/editwidget.c