Matt Mower | 18794c8 | 2015-11-11 16:22:45 -0600 | [diff] [blame] | 1 | #!/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 | |
| 11 | set -e |
| 12 | |
| 13 | PROJECT="dosfstools" |
| 14 | VERSION="$(cat ../VERSION)" |
| 15 | |
| 16 | DATE="$(LC_ALL=C date +%Y\\\\-%m\\\\-%d)" |
| 17 | |
| 18 | DAY="$(LC_ALL=C date +%d)" |
| 19 | MONTH="$(LC_ALL=C date +%m)" |
| 20 | YEAR="$(LC_ALL=C date +%Y)" |
| 21 | |
| 22 | echo "Updating version headers..." |
| 23 | |
| 24 | for MANPAGE in en/* |
| 25 | do |
| 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} |
| 30 | done |
| 31 | |
| 32 | # European date format |
| 33 | for _LANGUAGE in de 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 .*.2014-.*$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \ |
| 40 | -e "s|^msgstr .*.2014\"$|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 .*.2014-.*$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \ |
| 52 | -e "s|^msgstr .*-2014\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \ |
| 53 | "${_FILE}" |
| 54 | done |
| 55 | fi |