mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Add script to update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
9489b5edc4
commit
67542c64b2
22
maint/utils/update-years.sh
Executable file
22
maint/utils/update-years.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
YEAR=`date +%Y`
|
||||||
|
|
||||||
|
SOURCES="`find lib src tests -name '*.c'`"
|
||||||
|
|
||||||
|
LINE="Copyright (C)"
|
||||||
|
|
||||||
|
for i in "$SOURCES"; do
|
||||||
|
# replace year: XXXX-YYYY -> XXXX-ZZZZ
|
||||||
|
# add year: XXXX -> XXXX-ZZZZ
|
||||||
|
sed -i -e "
|
||||||
|
1,20 {
|
||||||
|
/$LINE/s/-[0-9]\{4\}$/-$YEAR/
|
||||||
|
};
|
||||||
|
1,20 {
|
||||||
|
/$LINE/s/ [0-9]\{4\}$/&-$YEAR/
|
||||||
|
}" $i
|
||||||
|
done
|
||||||
|
|
||||||
|
# special case
|
||||||
|
sed -i -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c
|
Loading…
Reference in New Issue
Block a user