mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 19:14:51 +00:00
More work on check-po.sh. I guess I'll get this working in branch first,
and then port to trunk later, rather than keep committing to both. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39102 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
be8a1cac97
commit
6ee45831bd
@ -4,7 +4,14 @@
|
|||||||
# The script expects an environment variable FARM that
|
# The script expects an environment variable FARM that
|
||||||
# will provide it with the location of the LyX www tree.
|
# will provide it with the location of the LyX www tree.
|
||||||
|
|
||||||
DEBUG="echo";
|
DEBUG="";
|
||||||
|
|
||||||
|
while getopts ":dh" options $ARGS; do
|
||||||
|
case $options in
|
||||||
|
d) DEBUG="echo";;
|
||||||
|
h) echo "check-po.sh [-d]"; echo "You must also point the FARM variable to LyX's www tree."; exit 0;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "$FARM" ]; then
|
if [ -z "$FARM" ]; then
|
||||||
echo "You must set the FARM variable to run this script, e.g.:";
|
echo "You must set the FARM variable to run this script, e.g.:";
|
||||||
@ -38,11 +45,11 @@ fi
|
|||||||
VCS="";
|
VCS="";
|
||||||
if svn log >/dev/null 2>&1; then
|
if svn log >/dev/null 2>&1; then
|
||||||
VCS="svn";
|
VCS="svn";
|
||||||
else if git diff >/dev/null 2>&1; then
|
elif git diff >/dev/null 2>&1; then
|
||||||
VCS="git";
|
VCS="git";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$VCS" ]; then
|
if [ -z "$VCS" ]; then
|
||||||
echo "Unable to determine version control system!";
|
echo "Unable to determine version control system!";
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
@ -59,6 +66,7 @@ make update-po >/dev/null 2>&1;
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
echo Running make i18n.inc...
|
echo Running make i18n.inc...
|
||||||
|
rm -f i18n.inc;
|
||||||
make i18n.inc >/dev/null 2>&1;
|
make i18n.inc >/dev/null 2>&1;
|
||||||
if [ -n "$TRUNK" ]; then
|
if [ -n "$TRUNK" ]; then
|
||||||
mv i18n.inc i18n_trunk.inc
|
mv i18n.inc i18n_trunk.inc
|
||||||
@ -67,13 +75,13 @@ else
|
|||||||
I18NFILE=i18n.inc;
|
I18NFILE=i18n.inc;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if diff -w -q $I18NFILE $FARM/$I18NFILE >/dev/null; then
|
if diff -w -q $I18NFILE $FARM/$I18NFILE >/dev/null 2>&1; then
|
||||||
# No differences found
|
# No differences found
|
||||||
echo No string differences found.
|
echo No string differences found.
|
||||||
if [ "$VCS" = "svn" ]; then
|
if [ "$VCS" = "svn" ]; then
|
||||||
svn revert *.po >/dev/null 2>&1;
|
svn revert *.po;
|
||||||
else
|
else
|
||||||
git co *.po >/dev/null 2>&1;
|
git co *.po;
|
||||||
fi
|
fi
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
@ -82,25 +90,31 @@ fi
|
|||||||
if [ "$VCS" = "svn" ]; then
|
if [ "$VCS" = "svn" ]; then
|
||||||
$DEBUG svn ci *.po;
|
$DEBUG svn ci *.po;
|
||||||
else
|
else
|
||||||
|
NOTSAFE="";
|
||||||
|
if git status | grep -Pq 'Your branch is (?:ahead|behind)'; then
|
||||||
|
NOTSAFE="TRUE";
|
||||||
|
fi
|
||||||
$DEBUG git commit *.po -m "Remerge strings.";
|
$DEBUG git commit *.po -m "Remerge strings.";
|
||||||
$DEBUG git svn dcommit;
|
if [ -n "$NOTSAFE" ]; then
|
||||||
|
echo "You will need to push changes to po files manually."
|
||||||
|
else
|
||||||
|
git svn dcommit;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 1;
|
|
||||||
|
|
||||||
if ! cd $FARM; then
|
if ! cd $FARM; then
|
||||||
echo "Unable to cd to $FARM!";
|
echo "Unable to cd to $FARM!";
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo Updating the www-user tree...
|
echo Updating the www-user tree...
|
||||||
svn up
|
# note that we're assuming this one is svn.
|
||||||
|
svn up;
|
||||||
|
|
||||||
echo Copying $I18NFILE...;
|
echo Moving $I18NFILE...;
|
||||||
cp $LYXROOT/po/$I18NFILE .;
|
mv $LYXROOT/po/$I18NFILE .;
|
||||||
|
|
||||||
echo Committing...;
|
echo Committing...;
|
||||||
svn commit -m "* $I18NFILE: update stats" $I18NFILE;
|
$DEBUG svn commit -m "* $I18NFILE: update stats" $I18NFILE;
|
||||||
|
|
||||||
echo DONE!
|
echo DONE!
|
||||||
|
Loading…
Reference in New Issue
Block a user