meson: Only perform macos checks on macos
[geany-mirror.git] / scripts / update-year-in-po.sh
blobcebfed2bc3522b445e368fea8b5974e6ca160cf1
1 #!/bin/sh
2 set -e
4 # THIS IS OBSOLETE AS WE DO NOT MENTION THE CURRENT YEAR ANY LONGER IN COPYRIGHT NOTICES
6 # prevent sed from doing stupid things in case the locale encoding doesn't
7 # match the files'. Unlikely, but doesn't hurt.
8 export LANG=C
10 year=$(grep -Po '(?<="Copyright \(c\) 2005-)20[0-9][0-9](?=\\n)' src/about.c)
11 echo "new years are: $year"
13 for f in po/*.po; do
14 echo "processing $f..."
15 sed -f /dev/stdin -i "$f" <<EOF
16 /^"Copyright (c) 2005-20[0-9][0-9]\\\\n"\$/{
17 s/\\(2005-\\)20[0-9][0-9]/\\1$year/
19 :loop
20 /^msgstr/{
22 # in case the range uses something else than the ASCII dash
23 s/\\(2005.*\\)20[0-9][0-9]/\\1$year/
24 b done
27 b loop
28 :done
30 EOF
31 done