live-build/manpages/bin/update-version.sh

55 lines
1.3 KiB
Bash
Raw Normal View History

2010-05-08 11:49:47 +00:00
#!/bin/sh
2013-10-17 09:18:55 +00:00
## live-build(7) - Live System Build Components
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
2010-05-08 11:49:47 +00:00
set -e
2010-09-02 11:31:35 +00:00
PROGRAM="LIVE\\\-BUILD"
2010-07-24 15:14:07 +00:00
VERSION="$(cat ../VERSION)"
2010-06-06 09:23:19 +00:00
DATE="$(LC_ALL=C date +%Y\\\\-%m\\\\-%d)"
DAY="$(LC_ALL=C date +%d)"
MONTH="$(LC_ALL=C date +%m)"
YEAR="$(LC_ALL=C date +%Y)"
2010-05-08 11:49:47 +00:00
echo "Updating version headers..."
for MANPAGE in en/*
do
SECTION="$(basename ${MANPAGE} | awk -F. '{ print $2 }')"
2013-03-11 04:35:40 -01:00
sed -i -e "s|^.TH.*$|.TH ${PROGRAM} ${SECTION} ${DATE} ${VERSION} \"Live Systems Project\"|" ${MANPAGE}
2010-05-08 11:49:47 +00:00
done
# European date format
for _LANGUAGE in de es fr it
do
if ls po/${_LANGUAGE}/*.po > /dev/null 2>&1
then
for _FILE in po/${_LANGUAGE}/*.po
do
sed -i -e "s|^msgstr .*.2013-.*$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
-e "s|^msgstr .*.2013\"$|msgstr \"${DAY}.${MONTH}.${YEAR}\"|g" \
"${_FILE}"
done
fi
done
# Brazilian date format
if ls po/pt_BR/*.po > /dev/null 2>&1
then
for _FILE in po/pt_BR/*.po
do
sed -i -e "s|^msgstr .*.2013-.*$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
-e "s|^msgstr .*-2013\"$|msgstr \"${DAY}-${MONTH}-${YEAR}\"|g" \
"${_FILE}"
done
fi