More shellcheck fixes.
This commit is contained in:
parent
3e0d1a33de
commit
4ada4a5786
18
backport
18
backport
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
source "`dirname $0`/ths-variables"
|
source "$(dirname "$0")/ths-variables"
|
||||||
|
|
||||||
function jobidfromstring()
|
function jobidfromstring()
|
||||||
{
|
{
|
||||||
|
@ -8,22 +8,22 @@ function jobidfromstring()
|
||||||
local RET;
|
local RET;
|
||||||
|
|
||||||
STRING=$1;
|
STRING=$1;
|
||||||
RET="$(echo $STRING | sed 's/^[^0-9]*//' | sed 's/[^0-9].*$//')"
|
RET="$(echo "$STRING" | sed 's/^[^0-9]*//' | sed 's/[^0-9].*$//')"
|
||||||
|
|
||||||
echo $RET;
|
echo "$RET";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo -e $BLUE"Running poupdate..."$ENDCOLOR
|
echo -e "${BLUE}Running poupdate...${ENDCOLOR}"
|
||||||
./poupdate -NS --silent trunk-kf5/$lcode/messages stable-kf5/$lcode/messages stable-kf5/templates/messages &
|
./poupdate -NS --silent trunk-kf5/$lcode/messages stable-kf5/$lcode/messages stable-kf5/templates/messages &
|
||||||
LASTJOB=`jobidfromstring $(jobs %%)`
|
LASTJOB=$(jobidfromstring "$(jobs %%)")
|
||||||
JOBLIST="$LASTJOB"
|
JOBLIST="$LASTJOB"
|
||||||
./poupdate -NS --silent trunk-kf5/$lcode/docmessages stable-kf5/$lcode/docmessages stable-kf5/templates/docmessages &
|
./poupdate -NS --silent trunk-kf5/$lcode/docmessages stable-kf5/$lcode/docmessages stable-kf5/templates/docmessages &
|
||||||
LASTJOB=`jobidfromstring $(jobs %%)`
|
LASTJOB=$(jobidfromstring "$(jobs %%)")
|
||||||
JOBLIST="$JOBLIST $LASTJOB"
|
JOBLIST="$JOBLIST $LASTJOB"
|
||||||
|
|
||||||
for JOB in $JOBLIST ; do
|
for JOB in $JOBLIST ; do
|
||||||
wait %$JOB
|
wait %"$JOB"
|
||||||
done
|
done
|
||||||
echo -e $BLUE"Removing obsolete entries..."$ENDCOLOR
|
echo -e "${BLUE}Removing obsolete entries...${ENDCOLOR}"
|
||||||
./obsolete stable-kf5/$lcode/messages
|
./obsolete stable-kf5/$lcode/messages
|
||||||
./obsolete stable-kf5/$lcode/docmessages
|
./obsolete stable-kf5/$lcode/docmessages
|
||||||
|
|
10
checkout
10
checkout
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
# Copyright (C) 2009 Andrius Štikonas <andrius@stikonas.eu>
|
# Copyright (C) 2009 Andrius Štikonas <andrius@stikonas.eu>
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -18,7 +18,7 @@ source "`dirname $0`/ths-variables"
|
||||||
|
|
||||||
if [ ! -f ".ths" ]; then
|
if [ ! -f ".ths" ]; then
|
||||||
echo "Please enter your language code (Default: lt):"
|
echo "Please enter your language code (Default: lt):"
|
||||||
read lcode
|
read -r lcode
|
||||||
if [ ! "$lcode" ]; then
|
if [ ! "$lcode" ]; then
|
||||||
lcode="lt"
|
lcode="lt"
|
||||||
fi
|
fi
|
||||||
|
@ -26,9 +26,9 @@ if [ ! -f ".ths" ]; then
|
||||||
|
|
||||||
while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do
|
while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do
|
||||||
echo "Do you have write access to KDE svn repository? [y/N]"
|
echo "Do you have write access to KDE svn repository? [y/N]"
|
||||||
read svnwrite
|
read -r svnwrite
|
||||||
svnwrite=`echo $svnwrite | tr YN yn`
|
svnwrite=$(echo $svnwrite | tr YN yn)
|
||||||
if [ ! $svnwrite ]; then
|
if [ ! "$svnwrite" ]; then
|
||||||
svnwrite="n"
|
svnwrite="n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
2
obsolete
2
obsolete
|
@ -26,4 +26,4 @@ else
|
||||||
folder="trunk-kf5/$lcode/messages"
|
folder="trunk-kf5/$lcode/messages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
posieve remove-obsolete $folder
|
posieve remove-obsolete "$folder"
|
||||||
|
|
|
@ -16,5 +16,5 @@
|
||||||
|
|
||||||
source ".ths"
|
source ".ths"
|
||||||
|
|
||||||
tar cfvj trunk.tar.bz2 `svn status trunk-kf5/$lcode | awk '{print $2}'`
|
tar cfvj trunk.tar.bz2 "$(svn status trunk-kf5/$lcode | awk '{print $2}')"
|
||||||
tar cfvj stable.tar.bz2 `svn status trunk-kf5/$lcode | awk '{print $2}'`
|
tar cfvj stable.tar.bz2 "$(svn status trunk-kf5/$lcode | awk '{print $2}')"
|
||||||
|
|
12
pocompare
12
pocompare
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
#
|
#
|
||||||
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
||||||
#
|
#
|
||||||
|
@ -20,14 +20,14 @@
|
||||||
# for best comparison.
|
# for best comparison.
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo "Usage `basename $0` <file1> <file2>"
|
echo "Usage $(basename "$0") <file1> <file2>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file1=$1
|
file1=$1
|
||||||
file2=$2
|
file2=$2
|
||||||
|
|
||||||
msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
|
msgmerge --no-wrap "$file1" "$file1" -o "${file1}.for.diff"
|
||||||
msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
|
msgmerge --no-wrap "$file2" "$file2" -o "${file2}.for.diff"
|
||||||
diff ${file1}.for.diff ${file2}.for.diff
|
diff "${file1}.for.diff" "${file2}.for.diff"
|
||||||
rm ${file1}.for.diff ${file2}.for.diff
|
rm "${file1}.for.diff" "${file2}.for.diff"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
#
|
#
|
||||||
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
||||||
#
|
#
|
||||||
|
@ -20,14 +20,14 @@
|
||||||
# unwrapps first for best comparison.
|
# unwrapps first for best comparison.
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo "Usage `basename $0` <file1> <file2>"
|
echo "Usage $(basename "$0") <file1> <file2>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file1=$1
|
file1=$1
|
||||||
file2=$2
|
file2=$2
|
||||||
|
|
||||||
msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
|
msgmerge --no-wrap "$file1" "$file1" -o "${file1}.for.diff"
|
||||||
msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
|
msgmerge --no-wrap "$file2" "$file2" -o "${file2}.for.diff"
|
||||||
kdiff3 ${file1}.for.diff ${file2}.for.diff
|
kdiff3 "${file1}.for.diff" "${file2}.for.diff"
|
||||||
rm ${file1}.for.diff ${file2}.for.diff
|
rm "${file1}.for.diff" "${file2}.for.diff"
|
||||||
|
|
16
potopot
16
potopot
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
#
|
#
|
||||||
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
||||||
#
|
#
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
# strips all the translation).
|
# strips all the translation).
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
echo "Usage: `basename $0` </directory/with/pofiles/>"
|
echo "Usage: $(basename "$0") </directory/with/pofiles/>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -33,24 +33,24 @@ sleep 3
|
||||||
|
|
||||||
echo "Creating directory ${pofiles}/templates/ ... "
|
echo "Creating directory ${pofiles}/templates/ ... "
|
||||||
|
|
||||||
mkdir $pofiles/templates
|
mkdir "$pofiles/templates"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
for file in `cd $pofiles; find . -name "*.po"`
|
for file in $(cd "$pofiles"; find . -name "*.po")
|
||||||
do
|
do
|
||||||
echo -n "Working on ${file}. Unwrapping..."
|
echo -n "Working on ${file}. Unwrapping..."
|
||||||
# unwrap messages for cleaner operation
|
# unwrap messages for cleaner operation
|
||||||
msgmerge --no-wrap ${pofiles}/$file $pofiles/$file -o $pofiles/$file
|
msgmerge --no-wrap "${pofiles}/$file $pofiles/$file" -o "$pofiles/$file"
|
||||||
# remove the translations and creating pot files
|
# remove the translations and creating pot files
|
||||||
echo "Cleaning up translations..."
|
echo "Cleaning up translations..."
|
||||||
msgfilter --input=$pofiles/$file --output-file=$pofiles/templates/${file}t --keep-header sed --expression='s/.*//' ; echo "done."
|
msgfilter --input="$pofiles/$file" --output-file="$pofiles/templates/${file}t" --keep-header sed --expression='s/.*//' ; echo "done."
|
||||||
# applying some more filters via sed: remove remaining \n signs (sed 1 and 2), removing the fuzzy headers (3), removing the empty "" (4), removing the extra empty lines (5)
|
# applying some more filters via sed: remove remaining \n signs (sed 1 and 2), removing the fuzzy headers (3), removing the empty "" (4), removing the extra empty lines (5)
|
||||||
echo "Applying additional filter..."
|
echo "Applying additional filter..."
|
||||||
cat $pofiles/templates/${file}t | sed -e 's/msgstr \"\\n\"/msgstr \"\"/' | \
|
cat "$pofiles/templates/${file}t" | sed -e 's/msgstr \"\\n\"/msgstr \"\"/' | \
|
||||||
sed -e 's/\"\\n\"/\"\"/' | \
|
sed -e 's/\"\\n\"/\"\"/' | \
|
||||||
sed -e 's/#, fuzzy//' | \
|
sed -e 's/#, fuzzy//' | \
|
||||||
sed -e 's/^""//' | \
|
sed -e 's/^""//' | \
|
||||||
sed '/./,/^$/!d' > $pofiles/templates/${file}t ; echo "done."
|
sed '/./,/^$/!d' > "$pofiles/templates/${file}t" ; echo "done."
|
||||||
echo "File ${file}t in directory templates/ created."
|
echo "File ${file}t in directory templates/ created."
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
16
stripfuzzy
16
stripfuzzy
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
#
|
#
|
||||||
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
||||||
#
|
#
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
# ths-stripfuzzy.sh - makes all fuzzy strings non-fuzzy in a translation project.
|
# ths-stripfuzzy.sh - makes all fuzzy strings non-fuzzy in a translation project.
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo "Usage `basename $0` <pofile directory> <templates directory>"
|
echo "Usage $(basename "$0") <pofile directory> <templates directory>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -27,16 +27,16 @@ pofiles=$1
|
||||||
templates=$2
|
templates=$2
|
||||||
|
|
||||||
echo "Completely removing the fuzzy strings from the pofiles..."
|
echo "Completely removing the fuzzy strings from the pofiles..."
|
||||||
for po in `cd $pofiles ; find . -name "*.po"`
|
for po in $(cd "$pofiles" ; find . -name "*.po")
|
||||||
do
|
do
|
||||||
echo -n $pofiles/$po
|
echo -n "$pofiles/$po"
|
||||||
msgattrib -o $pofiles/$po --no-fuzzy $pofiles/$po
|
msgattrib -o "$pofiles/$po" --no-fuzzy "$pofiles/$po"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
echo "Restoring the previously fuzzy as untranslated strings..."
|
echo "Restoring the previously fuzzy as untranslated strings..."
|
||||||
for po in `cd $pofiles ; find . -name "*.po"`
|
for po in $(cd "$pofiles" ; find . -name "*.po")
|
||||||
do
|
do
|
||||||
echo -n $pofiles/$po
|
echo -n "$pofiles/$po"
|
||||||
msgmerge --no-fuzzy-matching --backup=off --update $pofiles/$po $templates/${po}t
|
msgmerge --no-fuzzy-matching --backup=off --update "$pofiles/$po" "$templates/${po}t"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue