geany/scripts/update-year-in-po.sh
Enrico Tröger 1526af4068 Update all copyright notices to mention only the first publish year
And so remove the current year to ease maintenance and since it is not
strictly necessary.
Also remove individual copyright holders (where appropriate) and replace
the name with "The Geany contributors". The detailed authorship
information is still available in the GIT history.

Also remove copyright notice and author names from READMEs.
2019-04-07 11:43:58 +02:00

32 lines
717 B
Bash
Executable File

#!/bin/sh
set -e
# THIS IS OBSOLETE AS WE DO NOT MENTION THE CURRENT YEAR ANY LONGER IN COPYRIGHT NOTICES
# prevent sed from doing stupid things in case the locale encoding doesn't
# match the files'. Unlikely, but doesn't hurt.
export LANG=C
year=$(grep -Po '(?<="Copyright \(c\) 2005-)20[0-9][0-9](?=\\n)' src/about.c)
echo "new years are: $year"
for f in po/*.po; do
echo "processing $f..."
sed -f /dev/stdin -i "$f" <<EOF
/^"Copyright (c) 2005-20[0-9][0-9]\\\\n"\$/{
s/\\(2005-\\)20[0-9][0-9]/\\1$year/
n
:loop
/^msgstr/{
n
# in case the range uses something else than the ASCII dash
s/\\(2005.*\\)20[0-9][0-9]/\\1$year/
b done
}
n
b loop
:done
}
EOF
done