blob: 48e9c08c092f1ff8c8b0f534c3c9e54869db5470 [file] [log] [blame]
Matt Mower18794c82015-11-11 16:22:45 -06001#!/bin/sh
2
3## dosfstools(7)
4## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11set -e
12
13PROJECT="dosfstools"
14VERSION="$(cat ../VERSION)"
15
16DATE="$(LC_ALL=C date +%Y\\\\-%m\\\\-%d)"
17
18DAY="$(LC_ALL=C date +%d)"
19MONTH="$(LC_ALL=C date +%m)"
20YEAR="$(LC_ALL=C date +%Y)"
21
22echo "Updating version headers..."
23
24for MANPAGE in en/*
25do
26 PROGRAM="$(basename ${MANPAGE} | sed -e 's|\(.*\).[0-9]$|\1|' | tr [a-z] [A-Z])"
27 SECTION="$(basename ${MANPAGE} | sed -e 's|.*.\([0-9]\)$|\1|')"
28
29 sed -i -e "s|^.TH.*$|.TH ${PROGRAM} ${SECTION} ${DATE} ${VERSION} \"${PROJECT}\"|" ${MANPAGE}
30done
31
32# European date format
33for _LANGUAGE in de es fr it
34do
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 .*.2014-.*$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
40 -e "s|^msgstr .*.2014\"$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
41 "${_FILE}"
42 done
43 fi
44done
45
46# Brazilian date format
47if ls po/pt_BR/*.po > /dev/null 2>&1
48then
49 for _FILE in po/pt_BR/*.po
50 do
51 sed -i -e "s|^msgstr .*.2014-.*$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
52 -e "s|^msgstr .*-2014\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
53 "${_FILE}"
54 done
55fi