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()
|
||||
{
|
||||
|
@ -8,22 +8,22 @@ function jobidfromstring()
|
|||
local RET;
|
||||
|
||||
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 &
|
||||
LASTJOB=`jobidfromstring $(jobs %%)`
|
||||
LASTJOB=$(jobidfromstring "$(jobs %%)")
|
||||
JOBLIST="$LASTJOB"
|
||||
./poupdate -NS --silent trunk-kf5/$lcode/docmessages stable-kf5/$lcode/docmessages stable-kf5/templates/docmessages &
|
||||
LASTJOB=`jobidfromstring $(jobs %%)`
|
||||
LASTJOB=$(jobidfromstring "$(jobs %%)")
|
||||
JOBLIST="$JOBLIST $LASTJOB"
|
||||
|
||||
for JOB in $JOBLIST ; do
|
||||
wait %$JOB
|
||||
wait %"$JOB"
|
||||
done
|
||||
echo -e $BLUE"Removing obsolete entries..."$ENDCOLOR
|
||||
echo -e "${BLUE}Removing obsolete entries...${ENDCOLOR}"
|
||||
./obsolete stable-kf5/$lcode/messages
|
||||
./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>
|
||||
#
|
||||
# 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
|
||||
echo "Please enter your language code (Default: lt):"
|
||||
read lcode
|
||||
read -r lcode
|
||||
if [ ! "$lcode" ]; then
|
||||
lcode="lt"
|
||||
fi
|
||||
|
@ -26,9 +26,9 @@ if [ ! -f ".ths" ]; then
|
|||
|
||||
while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do
|
||||
echo "Do you have write access to KDE svn repository? [y/N]"
|
||||
read svnwrite
|
||||
svnwrite=`echo $svnwrite | tr YN yn`
|
||||
if [ ! $svnwrite ]; then
|
||||
read -r svnwrite
|
||||
svnwrite=$(echo $svnwrite | tr YN yn)
|
||||
if [ ! "$svnwrite" ]; then
|
||||
svnwrite="n"
|
||||
fi
|
||||
done
|
||||
|
|
2
obsolete
2
obsolete
|
@ -26,4 +26,4 @@ else
|
|||
folder="trunk-kf5/$lcode/messages"
|
||||
fi
|
||||
|
||||
posieve remove-obsolete $folder
|
||||
posieve remove-obsolete "$folder"
|
||||
|
|
|
@ -16,5 +16,5 @@
|
|||
|
||||
source ".ths"
|
||||
|
||||
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 trunk.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>
|
||||
#
|
||||
|
@ -20,14 +20,14 @@
|
|||
# for best comparison.
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage `basename $0` <file1> <file2>"
|
||||
echo "Usage $(basename "$0") <file1> <file2>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file1=$1
|
||||
file2=$2
|
||||
|
||||
msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
|
||||
msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
|
||||
diff ${file1}.for.diff ${file2}.for.diff
|
||||
rm ${file1}.for.diff ${file2}.for.diff
|
||||
msgmerge --no-wrap "$file1" "$file1" -o "${file1}.for.diff"
|
||||
msgmerge --no-wrap "$file2" "$file2" -o "${file2}.for.diff"
|
||||
diff "${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>
|
||||
#
|
||||
|
@ -20,14 +20,14 @@
|
|||
# unwrapps first for best comparison.
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage `basename $0` <file1> <file2>"
|
||||
echo "Usage $(basename "$0") <file1> <file2>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file1=$1
|
||||
file2=$2
|
||||
|
||||
msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
|
||||
msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
|
||||
kdiff3 ${file1}.for.diff ${file2}.for.diff
|
||||
rm ${file1}.for.diff ${file2}.for.diff
|
||||
msgmerge --no-wrap "$file1" "$file1" -o "${file1}.for.diff"
|
||||
msgmerge --no-wrap "$file2" "$file2" -o "${file2}.for.diff"
|
||||
kdiff3 "${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>
|
||||
#
|
||||
|
@ -20,7 +20,7 @@
|
|||
# strips all the translation).
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: `basename $0` </directory/with/pofiles/>"
|
||||
echo "Usage: $(basename "$0") </directory/with/pofiles/>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -33,24 +33,24 @@ sleep 3
|
|||
|
||||
echo "Creating directory ${pofiles}/templates/ ... "
|
||||
|
||||
mkdir $pofiles/templates
|
||||
mkdir "$pofiles/templates"
|
||||
sleep 1
|
||||
|
||||
for file in `cd $pofiles; find . -name "*.po"`
|
||||
for file in $(cd "$pofiles"; find . -name "*.po")
|
||||
do
|
||||
echo -n "Working on ${file}. Unwrapping..."
|
||||
# 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
|
||||
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)
|
||||
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/#, fuzzy//' | \
|
||||
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
|
||||
done
|
||||
|
|
16
stripfuzzy
16
stripfuzzy
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
||||
#
|
||||
|
@ -19,7 +19,7 @@
|
|||
# ths-stripfuzzy.sh - makes all fuzzy strings non-fuzzy in a translation project.
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage `basename $0` <pofile directory> <templates directory>"
|
||||
echo "Usage $(basename "$0") <pofile directory> <templates directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -27,16 +27,16 @@ pofiles=$1
|
|||
templates=$2
|
||||
|
||||
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
|
||||
echo -n $pofiles/$po
|
||||
msgattrib -o $pofiles/$po --no-fuzzy $pofiles/$po
|
||||
echo -n "$pofiles/$po"
|
||||
msgattrib -o "$pofiles/$po" --no-fuzzy "$pofiles/$po"
|
||||
done
|
||||
|
||||
|
||||
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
|
||||
echo -n $pofiles/$po
|
||||
msgmerge --no-fuzzy-matching --backup=off --update $pofiles/$po $templates/${po}t
|
||||
echo -n "$pofiles/$po"
|
||||
msgmerge --no-fuzzy-matching --backup=off --update "$pofiles/$po" "$templates/${po}t"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue