amend copyright
[live-boot-grml.git] / manpages / bin / update-version.sh
1 #!/bin/sh
2
3 ## live-boot(7) - System Boot Components
4 ## Copyright (C) 2016-2020 The Debian Live team
5 ## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
6 ##
7 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
8 ## This is free software, and you are welcome to redistribute it
9 ## under certain conditions; see COPYING for details.
10
11
12 set -e
13
14 PROGRAM="LIVE\\\-BOOT"
15 VERSION="$(dpkg-parsechangelog -S Version)"
16
17 DATE="$(LC_ALL=C date +%Y\\\\-%m\\\\-%d)"
18
19 DAY="$(LC_ALL=C date +%d)"
20 MONTH="$(LC_ALL=C date +%m)"
21 YEAR="$(LC_ALL=C date +%Y)"
22
23 echo "Updating version headers..."
24
25 for MANPAGE in en/*
26 do
27         SECTION="$(basename ${MANPAGE} | awk -F. '{ print $2 }')"
28
29         sed -i -e "s|^.TH.*$|.TH ${PROGRAM} ${SECTION} ${DATE} ${VERSION} \"Live Systems Project\"|" ${MANPAGE}
30 done
31
32 # European date format
33 for _LANGUAGE in es fr it
34 do
35         if ls po/${_LANGUAGE}/*.po > /dev/null 2>&1
36         then
37                 for _FILE in po/${_LANGUAGE}/*.po
38                 do
39                         sed -i  -e "s|^msgstr .*.2015-.*$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
40                                 -e "s|^msgstr .*.2015\"$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
41                         "${_FILE}"
42                 done
43         fi
44 done
45
46 # Brazilian date format
47 if ls po/pt_BR/*.po > /dev/null 2>&1
48 then
49         for _FILE in po/pt_BR/*.po
50         do
51                 sed -i  -e "s|^msgstr .*.2015-.*$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
52                         -e "s|^msgstr .*-2015\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
53                 "${_FILE}"
54         done
55 fi