Fix copying of new files.
This commit is contained in:
parent
9c25044730
commit
91298df5fd
20
poupdate
20
poupdate
|
@ -33,6 +33,10 @@ if [ ! $DIFF ]; then
|
||||||
echo -e $RED"This program suggests the diff utility."$ENDCOLOR
|
echo -e $RED"This program suggests the diff utility."$ENDCOLOR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! $SVN ]; then
|
||||||
|
echo -e $RED"This program suggests the svn utility."$ENDCOLOR
|
||||||
|
fi
|
||||||
|
|
||||||
## Declaring Functions
|
## Declaring Functions
|
||||||
function usage() {
|
function usage() {
|
||||||
echo "Usage `basename $0` [options] <updated-file-dir> <translations-file-tree> <translations-template-tree>"
|
echo "Usage `basename $0` [options] <updated-file-dir> <translations-file-tree> <translations-template-tree>"
|
||||||
|
@ -79,14 +83,14 @@ tpl_tree=$3
|
||||||
newtrans=`cd $upd_dir; find . -name "*.po"`
|
newtrans=`cd $upd_dir; find . -name "*.po"`
|
||||||
total_files=`echo $newtrans | wc -w`
|
total_files=`echo $newtrans | wc -w`
|
||||||
skipped_files=0
|
skipped_files=0
|
||||||
merged_files=0
|
processed_files=0
|
||||||
changed_files=0
|
changed_files=0
|
||||||
|
|
||||||
|
|
||||||
if [ "$option_verbose" = "Y" ]; then
|
if [ "$option_verbose" = "Y" ]; then
|
||||||
echo "Checking if updated files are in the specified directory ..."
|
echo "Checking if updated files are in the specified directory ..."
|
||||||
else
|
else
|
||||||
echo -ne "\r$merged_files/$total_files merged"
|
echo -ne "\r$processed_files/$total_files merged"
|
||||||
fi
|
fi
|
||||||
if [ "$newtrans" == "" ]; then
|
if [ "$newtrans" == "" ]; then
|
||||||
echo -e $RED"\t\t... no updated files found in: $upd_dir"$ENDCOLOR
|
echo -e $RED"\t\t... no updated files found in: $upd_dir"$ENDCOLOR
|
||||||
|
@ -131,8 +135,8 @@ if [ `cd $tpl_tree; find ${updfile}t 2> /dev/null | wc -l` -lt 1 ]; then
|
||||||
find ${updfile}t -print
|
find ${updfile}t -print
|
||||||
fi
|
fi
|
||||||
skipped_files=$(($skipped_files+1))
|
skipped_files=$(($skipped_files+1))
|
||||||
|
processed_files=$(($processed_files+1))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ `cd "$tra_tree"; find ${updfile} 2> /dev/null | wc -l` -lt 1 ]; then
|
if [ `cd "$tra_tree"; find ${updfile} 2> /dev/null | wc -l` -lt 1 ]; then
|
||||||
|
@ -143,7 +147,9 @@ if [ `cd "$tra_tree"; find ${updfile} 2> /dev/null | wc -l` -lt 1 ]; then
|
||||||
tplfile=`cd "$tpl_tree"; find ${updfile}t`
|
tplfile=`cd "$tpl_tree"; find ${updfile}t`
|
||||||
secdir=`dirname "$tplfile"`
|
secdir=`dirname "$tplfile"`
|
||||||
cp "$upd_dir/$updfile" "$tra_tree/$updfile"
|
cp "$upd_dir/$updfile" "$tra_tree/$updfile"
|
||||||
svn add "$tra_tree/$updfile"
|
if [ $SVN ]; then
|
||||||
|
$SVN add "$tra_tree/$updfile"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# perform msgmerge and other actions
|
# perform msgmerge and other actions
|
||||||
|
@ -180,9 +186,9 @@ fi
|
||||||
|
|
||||||
rm $tra_tree/${trafile}.old $tra_tree/${trafile}.new
|
rm $tra_tree/${trafile}.old $tra_tree/${trafile}.new
|
||||||
|
|
||||||
merged_files=$(($merged_files+1))
|
processed_files=$(($processed_files+1))
|
||||||
if [ ! "$option_verbose" = "Y" ]; then
|
if [ ! "$option_verbose" = "Y" ]; then
|
||||||
echo -ne "\r$merged_files/$total_files merged"
|
echo -ne "\r$processed_files/$total_files processed"
|
||||||
if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
|
if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
|
||||||
echo -ne ", $changed_files changed"
|
echo -ne ", $changed_files changed"
|
||||||
fi
|
fi
|
||||||
|
@ -193,7 +199,7 @@ fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -ne $BLUE"\r$merged_files/$total_files merged"$ENDCOLOR
|
echo -ne $BLUE"\r$processed_files/$total_files processed"$ENDCOLOR
|
||||||
if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
|
if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
|
||||||
echo -ne $BLUE", $changed_files changed"$ENDCOLOR
|
echo -ne $BLUE", $changed_files changed"$ENDCOLOR
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
THS=".ths"
|
THS=".ths"
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
|
SVN=`which svn 2> /dev/null`
|
||||||
DIFF=`which diff 2> /dev/null`
|
DIFF=`which diff 2> /dev/null`
|
||||||
MSGATTRIB=`which msgattrib 2> /dev/null`
|
MSGATTRIB=`which msgattrib 2> /dev/null`
|
||||||
MSGFILTER=`which msgfilter 2> /dev/null`
|
MSGFILTER=`which msgfilter 2> /dev/null`
|
||||||
|
|
Loading…
Reference in New Issue