Accepting request 232991 from Base:System

- New supplementary script: check-translation-completeness.sh
  that creates statistics of translation completeness.
- Merge latest upstream-collect.sh fixes from SLE11 SP3:
  * Re-add all strings lost after removal from upstream
    (bnc#807817#c15).
  * Do incremental update by default to prevent loss of strings
    removed from upstream (bnc#807817#c15).
  * Fix errors in debug mode.
- Merge latest translation-update-upstream-to-translation-update.sh
  fixes from SLE11 SP3:
  * rewrote to include strings from gnome-patch-translation
    (bnc#807817, bnc#811265). (forwarded request 232979 from sbrabec)

OBS-URL: https://build.opensuse.org/request/show/232991
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/translation-update-upstream?expand=0&rev=37
This commit is contained in:
Stephan Kulow 2014-05-22 18:37:32 +00:00 committed by Git OBS Bridge
commit f24e0d72b4
6 changed files with 371 additions and 104 deletions

View File

@ -0,0 +1,170 @@
#!/bin/bash
set -o errexit
# We need stable text format
export LANG=C
if ! test -d po-full ; then
echo >&2 "$0: You need \"po-full\" directory. Call this script only after ./upstream-collect.sh"
exit 1
fi
cd po-full
ALL_LNG="$(
for PO in */*.po ; do
LNG=${PO%.po}
LNG=${LNG##*/}
echo "$LNG"
done |
sort -u |
tr '\n' ' '
)"
#echo >&2 "$0 DBG: ALL_LNG=\"$ALL_LNG\""
for DOMAIN in * ; do
for LNG in $ALL_LNG ; do
# Sanitize to not contain "," or ".":
LNG_SN=${LNG//,/__COMMA__}
LNG_SN=${LNG_SN//./__PERIOD__}
DOMAIN_SN=${DOMAIN//,/__COMMA__}
DOMAIN_SN=${DOMAIN_SN//./__PERIOD__}
echo -n "$LNG_SN,$DOMAIN_SN,"
PO=$DOMAIN/$LNG.po
if test -f "$PO" ; then
msgfmt --statistics -o /dev/null $PO 2>&1
else
msgfmt --statistics -o /dev/null ../pot/$DOMAIN.pot 2>&1
fi
done
done |
#tee ../check-translation-completeness-DBG1.log |
(
# "F1 translated messages, F2 fuzzy translations, F3 untranslated messages." Some fields can be missing
IFS=,.
while read LNG DOMAIN F1 F2 F3 F4 ; do
LNG=${LNG//__COMMA__/,}
LNG=${LNG//__PERIOD__/.}
DOMAIN=${DOMAIN//__COMMA__/,}
DOMAIN=${DOMAIN//__PERIOD__/.}
TRANSLATED=0
UNTRANSLATED=0
FUZZY=0
if test -n "$F4" ; then
echo >&2 "$0: Too long output of \"msgfmt --statistics -o /dev/null po-full/$DOMAIN/$LNG.po\": \"$F4\""
exit 1
fi
for STRING in "$F1" "$F2" "$F3" "$F4" ; do
STRING=${STRING# }
case "$STRING" in
*" translated message" )
TRANSLATED=${STRING% translated message}
;;
*" translated messages" )
TRANSLATED=${STRING% translated messages}
;;
*" fuzzy translation" )
FUZZY=${STRING% fuzzy translation}
;;
*" fuzzy translations" )
FUZZY=${STRING% fuzzy translations}
;;
*" untranslated message" )
UNTRANSLATED=${STRING% untranslated message}
;;
*" untranslated messages" )
UNTRANSLATED=${STRING% untranslated messages}
;;
"" )
;;
* )
echo >&2 "$0: Unknown format of \"msgfmt --statistics -o /dev/null po-full/$DOMAIN/$LNG.po\": \"$STRING\""
exit 1
;;
esac
done
#echo >&2 -n "$0 DBG: LNG=$LNG DOMAIN=$DOMAIN F1=\"$F1\" F2=\"$F2\" F3=\"$F3\" F4=\"$F4\" TRANSLATED=$TRANSLATED UNTRANSLATED=$UNTRANSLATED FUZZY=$FUZZY"
let UNTRANSLATED+=FUZZY || :
let ALL=TRANSLATED+UNTRANSLATED || :
#echo >&2 " DBG: ALL=$ALL all_UNTRANSLATED=$UNTRANSLATED"
let PERCENTAGE=100"*"TRANSLATED/ALL || :
echo "\"$LNG\",\"$DOMAIN\",$PERCENTAGE,$UNTRANSLATED,$ALL"
done
) |
#tee ../check-translation-completeness-DBG2.log |
(
echo >../check-translation-completeness-by-domain.csv "\"Language\",\"Domain\",\"Translated %\",\"Untranslated #\",\"All #\""
tee -a ../check-translation-completeness-by-domain.csv
) |
sort |
(
echo >../check-translation-completeness-by-language.csv "\"Language\",\"Domain\",\"Translated %\",\"Untranslated #\",\"All #\""
tee -a ../check-translation-completeness-by-language.csv
) |
(
IFS=","
while read LNG DOMAIN PERCENTAGE UNTRANSLATED ALL ; do
LNG=${LNG//\"}
case $LNG in
ar )
LNG_NAME="Arabic"
;;
pt_BR )
LNG_NAME="Brazilian Portuguese"
;;
zh_CN )
LNG_NAME="Chinese Simplified"
;;
zh_TW )
LNG_NAME="Chinese Traditional"
;;
cs )
LNG_NAME="Czech"
;;
nl )
LNG_NAME="Dutch"
;;
fr )
LNG_NAME="French"
;;
de )
LNG_NAME="German"
;;
hu )
LNG_NAME="Hungarian"
;;
it )
LNG_NAME="Italian"
;;
ja )
LNG_NAME="Japanese"
;;
ko )
LNG_NAME="Korean"
;;
pl )
LNG_NAME="Polish"
;;
ru )
LNG_NAME="Russian"
;;
es )
LNG_NAME="Spanish"
;;
sv )
LNG_NAME="Swedish"
;;
* )
continue
;;
esac
echo "\"$LNG_NAME\",$DOMAIN,$PERCENTAGE,$UNTRANSLATED,$ALL"
done
) |
sort |
(
echo >../check-translation-completeness-supported.csv "\"Language\",\"Domain\",\"Translated %\",\"Untranslated #\",\"All #\""
cat >../check-translation-completeness-supported.csv
)
cd ..
zip check-translation-completeness.zip check-translation-completeness*.csv

View File

@ -17,19 +17,19 @@ for REPOSITORY in ${OSC_REPOSITORIES[@]} ; do
done | sort -u >create-tlst-temp-osc-projects.lst
# branches tried for all apps:
KNOWN_BRANCHES="gnome-3-4"
KNOWN_BRANCHES="gnome-3-10"
# branches tried apps with the same name base:
# Do not forget hardcoded strings in the code below!
APP_BRANCHES="|gimp-2-8|gtk-3-6|gtk-2-24|glib-2-34"
APP_BRANCHES="|gimp-2-8|gtk-3-10|gtk-2-24|glib-2-38|glib-2-40"
# FIXME: support for libgda:release-3-0-branch gnome-background:gnome-2-22
echo "# This file was generated $(LANG=C LC_ALL=C date) by create-tlst-step2-create-gnome_gtp.sh." >upstream-gnome_gtp.tlst
echo "# package domain method repository dir branch" >>upstream-gnome_gtp.tlst
echo "# package domain method repository dir branch" >>upstream-gnome_gtp.tlst
SPACES=' '
# listing of all GNOME GTP projects
curl http://l10n.gnome.org/POT/ | sed -n 's:^.*href="\([^"]*\)/".*$:\1:p' | sed '/^$/d' |
curl https://l10n.gnome.org/POT/ | sed -n 's:^.*href="\([^"]*\)/".*$:\1:p' | sed '/^$/d' |
(
while read ; do
BRANCH=${REPLY##*.}
@ -46,12 +46,19 @@ curl http://l10n.gnome.org/POT/ | sed -n 's:^.*href="\([^"]*\)/".*$:\1:p' | sed
for LBRANCH in $KNOWN_BRANCHES master ; do
echo gconf gconf2 GConf2 $LBRANCH
done
echo glib glib2 glib20 glib-2-38
echo glib glib2 glib20 master
echo gtk+ gtk2 gtk20 gtk-2-38
echo gtk+ gtk2 gtk20 master
echo gtk+ gtk2 gtk20-properties gtk-2-38
echo gtk+ gtk2 gtk20-properties master
echo gtk+ gtk3 gtk30 gtk-3-10
echo gtk+ gtk3 gtk30 master
echo gtk+ gtk3 gtk30-properties gtk-3-10
echo gtk+ gtk3 gtk30-properties master
echo libgweather libgweather libgweather-locations gnome-3-10
echo libgweather libgweather libgweather-locations master
echo gnome-phone-manager phonemgr gnome-phone-manager gnome-3-10
echo gnome-phone-manager phonemgr gnome-phone-manager master
echo network-manager-applet NetworkManager-gnome nm-applet master
# For other versions than sles10:
@ -120,7 +127,7 @@ curl http://l10n.gnome.org/POT/ | sed -n 's:^.*href="\([^"]*\)/".*$:\1:p' | sed
esac"
if $USE_IT ; then
BRANCH=${BRANCH/master/zzzz_master}
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:47-${#DOMAIN}}gtp l10n.gnome.org/POT $PROJECT/$PO_DIR${SPACES:0:36-${#PROJECT}-${#PO_DIR}}$BRANCH"
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:47-${#DOMAIN}}gtp l10n.gnome.org/POT $PROJECT/$PO_DIR${SPACES:0:26-${#PROJECT}-${#PO_DIR}}$BRANCH"
fi
# Disabled for now. Final merge will happen in spec file.

View File

@ -14,12 +14,19 @@ if ! test -f upstream-collect.domain-map ; then
exit 1
fi
if ! test -d gnome-patch-translation ; then
echo "Please provide directory gnome-patch-translation with contents of"
echo "/usr/share/gnome-patch-translation from gnome-patch-translation RPM"
echo "on the target system."
exit 1
fi
source ${0%translation-update-upstream-to-translation-update.sh}upstream-collect.conf
mkdir\
TRANSLATION_UPDATE TRANSLATION_UPDATE/translation-update TRANSLATION_UPDATE/TUU\
TRANSLATION_UPDATE/NOT_UPDATED TRANSLATION_UPDATE/NOT_UPDATED/po TRANSLATION_UPDATE/NOT_UPDATED/po-mandatory\
TRANSLATION_UPDATE/UPDATED TRANSLATION_UPDATE/UPDATED/po TRANSLATION_UPDATE/UPDATED/po-mandatory\
TRANSLATION_UPDATE/NOT_UPDATED \
TRANSLATION_UPDATE/UPDATED \
TRANSLATION_UPDATE/complete TRANSLATION_UPDATE/rebuilt
# more tarballs are available => use the latest one
@ -40,11 +47,105 @@ if [[ "$MSNAPSHOT" > "$SNAPSHOT" ]] ; then
SNAPSHOT=$MSNAPSHOT
fi
cd TRANSLATION_UPDATE/TUU
cp -a ../../po-mandatory-full po-mandatory
cp -a ../../po-full po
# FIXME: It should list all gnome-patch-translation references, not only the first on the line.
# But there is a bug in the gnome-patch-translation: Only first reference contain domain.
# Hopefully, the output is complete even with it.
sed -n 's%^#: \([^/]*\).*$%\1%p' gnome-patch-translation/gnome-patch-translation.pot | sort -u >${0%.sh}-gpt.lst
# Process translations to get complete sets of strings.
cd po-full
for DOMAIN in * ; do
if grep -q "^$DOMAIN\$" ../${0%.sh}-gpt.lst ; then
SUPPORTS_GPT=true
else
SUPPORTS_GPT=false
fi
for PO in $DOMAIN/*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
mkdir -p "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG"
if test -f "../po-mandatory-full/$PO" ; then
if $SUPPORTS_GPT && test -f "../gnome-patch-translation/$LNG.po" ; then
# mandatory strings take precedence over gnome-patch-translation, but gnome-patch-translation takes precedence over upstream.
msgcat --use-first "../po-mandatory-full/$PO" "../gnome-patch-translation/$LNG.po" "$PO" -o "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po.p1"
# There are mandatory strings. We must update.
mkdir -p "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN"
echo "po-mandatory-full/$PO" >"../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN/$LNG"
else
msgcat --use-first "../po-mandatory-full/$PO" "$PO" -o "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po"
# There are mandatory strings. We must update.
mkdir -p "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN"
touch "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN/$LNG"
fi
else
if $SUPPORTS_GPT && test -f "../gnome-patch-translation/$LNG.po" ; then
msgcat --use-first "../gnome-patch-translation/$LNG.po" "$PO" -o "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po.p1"
# We don't know, whether strings from gnome-patch-translation were updated. There is no check yet. We must update.
mkdir -p "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN"
echo "po-full/$PO" >"../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN/$LNG"
else
ln "$PO" "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po"
fi
fi
done
done
cd ../po-mandatory-full
for DOMAIN in * ; do
if grep -q "^$DOMAIN\$" ../${0%.sh}-gpt.lst ; then
SUPPORTS_GPT=true
else
SUPPORTS_GPT=false
fi
for PO in $DOMAIN/*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
# There are mandatory strings. We must update.
mkdir -p "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG"
# Handle only po files not processed above.
if ! test -f "../po-full/$PO" ; then
mkdir -p "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN"
if $SUPPORTS_GPT -a -f "../gnome-patch-translation/$LNG.po" ; then
# mandatory strings take precedence over gnome-patch-translation, but gnome-patch-translation takes precedence over upstream.
msgcat --use-first "$PO" "../gnome-patch-translation/$LNG.po" -o "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po.p1"
echo "po-mandatory-full/$PO" >"../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN/$LNG"
else
ln "$PO" "../TRANSLATION_UPDATE/complete/translation-update/$DOMAIN/$LNG/$LNG.po"
touch "../TRANSLATION_UPDATE/complete/stamp-force/$DOMAIN/$LNG"
fi
fi
done
done
# Finish processing of po files that included strings from gnome-patch-translation.
cd ../TRANSLATION_UPDATE/complete/translation-update
for POP1 in */*/*.po.p1 ; do
PO=${POP1%.p1}
DOMAIN=${PO%%/*}
LNG=${PO%/*}
LNG=${LNG#*/}
# Include only gnome-patch-translation strings from particular domain.
msgmerge --no-fuzzy-matching "$POP1" ../../../pot/$DOMAIN.pot -o "$PO.p2"
msgattrib --no-obsolete "$PO.p2" -o "$PO.p3"
# Put header from the most important source stored into stamp-force.
# Extract header. Broken pipe is an expected behavior. Redirect stderr to /dev/null.
msgmerge --quiet --force-po ../../../$(<"../stamp-force/$DOMAIN/$LNG") ../../../msgheadermerge-empty.pot -o "$PO.p4"
msgattrib --no-obsolete --force-po "$PO.p4" -o "$PO.p5"
msgcat --use-first --force-po "$PO.p5" "$PO.p3" -o "$PO"
rm "$PO.p"*
done
cd ../..
# Now create a copy of all files to TUU (they will be moved later to particular directories).
cp -al complete/translation-update/* TUU/
cd ..
osc ${OSC_APIURL:+--apiurl=$OSC_APIURL} ls "${OSC_REPOSITORIES[OSC_MAIN_INDEX]}" >${0%.sh}-rebuilt.lst
if test -n "$OSC_PROPOSED_INDEX" ; then
osc ${OSC_APIURL:+--apiurl=$OSC_APIURL} ls "${OSC_REPOSITORIES[OSC_PROPOSED_INDEX]}" >${0%.sh}-outdated.lst
@ -52,7 +153,6 @@ else
echo -n '' >${0%.sh}-outdated.lst
fi
SERIAL=0
for TLST in *.tlst ; do
exec <$WORK_DIR/$TLST
@ -86,20 +186,14 @@ for TLST in *.tlst ; do
case $STATUS in
OK*)
echo " domain $REAL_DOMAIN is correctly updated, OK"
if test -d TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN TRANSLATION_UPDATE/UPDATED/po/
fi
if test -d TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN TRANSLATION_UPDATE/UPDATED/po-mandatory/
if test -d TRANSLATION_UPDATE/TUU/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/$REAL_DOMAIN TRANSLATION_UPDATE/UPDATED/
fi
;;
*)
echo " domain $REAL_DOMAIN is not correctly updated, needs to be added"
if test -d TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/po/
fi
if test -d TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/po-mandatory/
if test -d TRANSLATION_UPDATE/TUU/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/
fi
;;
esac
@ -109,11 +203,8 @@ for TLST in *.tlst ; do
cat ${0%translation-update-upstream-to-translation-update.sh}upstream-collect.domain-map |
while read PACKAGE_ REAL_DOMAIN STATUS ; do
if test "$PACKAGE" = "$PACKAGE_" ; then
if test -d TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/po/
fi
if test -d TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/po-mandatory/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/po-mandatory/
if test -d TRANSLATION_UPDATE/TUU/$REAL_DOMAIN ; then
mv TRANSLATION_UPDATE/TUU/$REAL_DOMAIN TRANSLATION_UPDATE/NOT_UPDATED/
fi
fi
done
@ -125,81 +216,48 @@ done
# If files remain in TUU, there is something wrong. Move them to NOT_UPDATED and hope that domain is correct.
# It can happen when domain mapping process failed.
cd TRANSLATION_UPDATE/TUU
for DIR in */* ; do
if test "${DIR%/*}" = "po" ; then
MANDATORY=false
else
MANDATORY=true
fi
echo "$(tput setf 4)Something went wrong, domain=${DIR#*/} mandatory=$MANDATORY was not listed and processed$(tput init)"
for DIR in * ; do
echo "$(tput setf 4)Something went wrong, domain=${DIR#*/} was not listed and processed$(tput init)"
echo " assuming that it was not updated"
mv $DIR ../NOT_UPDATED/$DIR
done
cd ../../TRANSLATION_UPDATE/NOT_UPDATED/po
for PO in */*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
mkdir -p "../../complete/translation-update/${PO%/*}/$LNG"
if test -f "../po-mandatory/$PO" ; then
msgcat --use-first "../po-mandatory/$PO" "$PO" -o "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
else
ln "$PO" "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
fi
cd ../NOT_UPDATED
for PO in */*/*.po ; do
DOMAIN=${PO%%/*}
LNG=${PO%/*}
LNG=${LNG#*/}
# Standard update: Pick only files with changes.
if grep -q "^po/$PO\$" ../../../${0%.sh}-updates.lst ; then
mkdir -p "../../translation-update/${PO%/*}/$LNG"
ln "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" "../../translation-update/${PO%/*}/$LNG/${PO##*/}"
if grep -q "^po/$DOMAIN/$LNG.po\$" ../../${0%.sh}-updates.lst ; then
mkdir -p "../translation-update/$DOMAIN/$LNG"
ln "../complete/translation-update/$PO" "../translation-update/$PO"
fi
done
cd ../po-mandatory
for PO in */*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
# Mandatory update: Pick all files.
if ! test -f "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" ; then
mkdir -p "../../complete/translation-update/${PO%/*}/$LNG"
ln "$PO" "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
fi
if ! test -f "../../translation-update/${PO%/*}/$LNG/${PO##*/}" ; then
mkdir -p "../../translation-update/${PO%/*}/$LNG"
ln "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" "../../translation-update/${PO%/*}/$LNG/${PO##*/}"
if test -f "../complete/stamp-force/$DOMAIN/$LNG" ; then
mkdir -p "../translation-update/$DOMAIN/$LNG"
ln -f "../complete/translation-update/$PO" "../translation-update/$PO"
fi
done
cd ../../../TRANSLATION_UPDATE/UPDATED/po
for PO in */*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
mkdir -p "../../complete/translation-update/${PO%/*}/$LNG"
if test -f "../po-mandatory/$PO" ; then
msgcat --use-first "../po-mandatory/$PO" "$PO" -o "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
else
ln "$PO" "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
fi
cd ../UPDATED
for PO in */*/*.po ; do
DOMAIN=${PO%%/*}
LNG=${PO%/*}
LNG=${LNG#*/}
# Standard update: Pick only files with changes.
if grep -q "^po/$PO\$" ../../../${0%.sh}-updates.lst ; then
mkdir -p "../../rebuilt/translation-update/${PO%/*}/$LNG"
ln "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" "../../rebuilt/translation-update/${PO%/*}/$LNG/${PO##*/}"
if grep -q "^po/$DOMAIN/$LNG.po\$" ../../${0%.sh}-updates.lst ; then
mkdir -p "../rebuilt/translation-update/$DOMAIN/$LNG"
ln "../complete/translation-update/$PO" "../rebuilt/translation-update/$PO"
fi
done
cd ../po-mandatory
for PO in */*.po ; do
LNG=${PO##*/}
LNG=${LNG%.po}
# Mandatory update: Pick all files.
if ! test -f "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" ; then
mkdir -p "../../complete/translation-update/${PO%/*}/$LNG"
ln "$PO" "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}"
fi
if ! test -f "../../rebuilt/translation-update/${PO%/*}/$LNG/${PO##*/}" ; then
mkdir -p "../../rebuilt/translation-update/${PO%/*}/$LNG"
ln "../../complete/translation-update/${PO%/*}/$LNG/${PO##*/}" "../../rebuilt/translation-update/${PO%/*}/$LNG/${PO##*/}"
if test -f "../complete/stamp-force/$DOMAIN/$LNG" ; then
mkdir -p "../rebuilt/translation-update/$DOMAIN/$LNG"
ln -f "../complete/translation-update/$PO" "../rebuilt/translation-update/$PO"
fi
done
cd ../..
cd ..
tar -jcf ../translation-update-from-translation-update-upstream-$SNAPSHOT.tar.bz2 translation-update
echo "Generated translation-update-from-translation-update-upstream-$SNAPSHOT.tar.bz2
Please add it to the package translation-update"

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Tue May 6 23:37:37 CEST 2014 - sbrabec@suse.cz
- New supplementary script: check-translation-completeness.sh
that creates statistics of translation completeness.
- Merge latest upstream-collect.sh fixes from SLE11 SP3:
* Re-add all strings lost after removal from upstream
(bnc#807817#c15).
* Do incremental update by default to prevent loss of strings
removed from upstream (bnc#807817#c15).
* Fix errors in debug mode.
- Merge latest translation-update-upstream-to-translation-update.sh
fixes from SLE11 SP3:
* rewrote to include strings from gnome-patch-translation
(bnc#807817, bnc#811265).
-------------------------------------------------------------------
Fri Apr 25 09:58:27 UTC 2014 - schwab@linux-m68k.org

View File

@ -47,6 +47,7 @@ Source54: create-tlst-step2-create-gnome_gtp.sh
Source55: create-tlst.conf
Source56: translation-update-upstream-to-translation-update.sh
Source57: translation-update-static.tar.bz2
Source58: check-translation-completeness.sh
# Configuration files for package maintainer tools:
Source60: upstream-gnome_gtp.tlst
Source61: upstream-gnome_gtp.hook
@ -132,7 +133,7 @@ echo translation*/*/*.po | sed 's:.*/::;s:\.po$::' | sort -u
for LOCALE in $(set +x ; cd $RPM_BUILD_ROOT%{_datadir} ; ls -1 translation*/*/*/*.po | sed 's:.*/::;s:\.po$::' | sort -u) ; do
if ! test -d /usr/share/locale/$LOCALE ; then
for file in $RPM_BUILD_ROOT%{_datadir}/translation*/*/*/$LOCALE.po; do
# fake it so it looks like removed from %find_lang
# fake it so it looks like removed from %%find_lang
package=$(echo $file | sed -e 's,.*translation[^/]*/po/,,; s,/[^/]*.po,,')
echo -n "removing translation /usr/share/locale/$LOCALE/LC_MESSAGES/$package.mo: "
msgfmt -o - $file | msgunfmt -o - -| msgfmt --statistics -o /dev/null -

View File

@ -8,6 +8,11 @@
# Debug mode. Set to true if you want to keep working directories.
DEBUG=false
# Incremental mode. With exception of bootstrapping or resetting the memory, it should be true.
# Non-incremental update cannot process a single package.
# FIXME: The incremental mode does not drop obsolete packages. You
# need to delete them manually afterwards using time stamp.
INCREMENTAL=true
# Set to false to generate only pot files, true to collect po files.
COLLECT_UPSTREAM=true
# Number of CPUs. When > 1, then parallel processing of more po files is possible.
@ -100,7 +105,7 @@ esac
rm -rf UPSTREAM
mkdir UPSTREAM
if ! test -d STAMPS ; then
mkdir -p pot pot-tuu pot-diff po-full po-mandatory-full
mkdir -p pot pot-tuu pot-diff
mkdir OSC PACKAGES UPDATE STAMPS
rm -f upstream-collect.log
rm -f upstream-collect.domain-map.tmp
@ -144,7 +149,7 @@ done
export PATH=~/.upstream-collect.tmp:$PATH
if ! $FULL_PROCESS ; then
if $INCREMENTAL ; then
# more tarballs are available => use the latest one
# FIXME: Fix 20090213.10 < 20090213.9
# (but it should not happen for people who update and submit)
@ -153,44 +158,50 @@ if ! $FULL_PROCESS ; then
done
if ! test -f STAMPS/UPDATE_old_tarball ; then
cd UPDATE
echo "$(tput setf 3)Unpacking: $ARCHIVE$(tput init)"
tar -jxf ../$ARCHIVE
# If it is not a full process, increment only release
# SNAPSHOT 20090213 -> 20090213.1, 20090213.1 -> 20090213.2
cd ..
touch STAMPS/UPDATE_old_tarball
fi
SNAPSHOT=${ARCHIVE#translation-update-upstream-}
SNAPSHOT=${SNAPSHOT%.tar.bz2}
SNAPSHOT_PART1=${SNAPSHOT%.*}
SNAPSHOT_PART2=${SNAPSHOT#*.}
if test "$SNAPSHOT_PART1" = "$SNAPSHOT" ; then
SNAPSHOT_PART2=1
SNAPSHOT_RELEASE=${ARCHIVE#translation-update-upstream-}
SNAPSHOT_RELEASE=${SNAPSHOT_RELEASE%.tar.bz2}
SNAPSHOT_RELEASE_PART1=${SNAPSHOT_RELEASE%.*}
SNAPSHOT_RELEASE_PART2=${SNAPSHOT_RELEASE#*.}
if test "$SNAPSHOT_RELEASE_PART1" = "$SNAPSHOT_RELEASE" ; then
SNAPSHOT_RELEASE_PART2=1
else
let SNAPSHOT_PART2++
let SNAPSHOT_RELEASE_PART2++
fi
SNAPSHOT=$SNAPSHOT_PART1.$SNAPSHOT_PART2
SNAPSHOT_RELEASE=$SNAPSHOT_RELEASE_PART1.$SNAPSHOT_RELEASE_PART2
for ARCHIVE_ in translation-update-mandatory-*.tar.bz2 ; do
ARCHIVE=$ARCHIVE_
done
if ! test -f STAMPS/UPDATE_old_mtarball ; then
cd UPDATE
echo "$(tput setf 3)Unpacking: $ARCHIVE$(tput init)"
tar -jxf ../$ARCHIVE
# If it is not a full process, increment only release
# SNAPSHOT 20090213 -> 20090213.1, 20090213.1 -> 20090213.2
cd ..
touch STAMPS/UPDATE_old_mtarball
fi
MSNAPSHOT=${ARCHIVE#translation-update-mandatory-}
MSNAPSHOT=${MSNAPSHOT%.tar.bz2}
SNAPSHOT_PART1=${MSNAPSHOT%.*}
SNAPSHOT_PART2=${MSNAPSHOT#*.}
if test "$SNAPSHOT_PART1" = "$MSNAPSHOT" ; then
SNAPSHOT_PART2=1
MSNAPSHOT_RELEASE=${ARCHIVE#translation-update-mandatory-}
MSNAPSHOT_RELEASE=${MSNAPSHOT_RELEASE%.tar.bz2}
SNAPSHOT_RELEASE_PART1=${MSNAPSHOT_RELEASE%.*}
SNAPSHOT_RELEASE_PART2=${MSNAPSHOT_RELEASE#*.}
if test "$SNAPSHOT_RELEASE_PART1" = "$MSNAPSHOT_RELEASE" ; then
SNAPSHOT_RELEASE_PART2=1
else
let SNAPSHOT_PART2++
let SNAPSHOT_RELEASE_PART2++
fi
MSNAPSHOT=$SNAPSHOT_PART1.$SNAPSHOT_PART2
MSNAPSHOT_RELEASE=$SNAPSHOT_RELEASE_PART1.$SNAPSHOT_RELEASE_PART2
fi
if ! $FULL_PROCESS ; then
SNAPSHOT=$SNAPSHOT_RELEASE
MSNAPSHOT=$MSNAPSHOT_RELEASE
fi
SERIAL=0
@ -322,6 +333,8 @@ for TLST in *.tlst ; do
echo >>$WORK_DIR/upstream-collect.log "package=$PACKAGE domain=$DOMAIN method=$METHOD repository=$REPO directory=$DIR branch=${BRANCH:(default)}: pot file update error, no way to update"
STATUS=POT_ERROR
mkdir -p $WORK_DIR/STAMPS/$PACKAGE/$DOMAIN/$METHOD/${REPO//[\/:.]/_}/$REPODIR/${BRANCH:-__HEAD__}
# However we cannot do anything, build dir is successfully processed.
touch $WORK_DIR/STAMPS/$PACKAGE/.builddir_ok
continue
fi
fi
@ -338,6 +351,8 @@ for TLST in *.tlst ; do
echo >>$WORK_DIR/upstream-collect.log "package=$PACKAGE domain=$DOMAIN method=$METHOD repository=$REPO directory=$DIR branch=${BRANCH:(default)}: packaging error, package does not call translation-update-upstream properly and intltool-update fails, no way to update"
STATUS=TUU_BROKEN
mkdir -p $WORK_DIR/STAMPS/$PACKAGE/$DOMAIN/$METHOD/${REPO//[\/:.]/_}/$REPODIR/${BRANCH:-__HEAD__}
# However we cannot do anything, build dir is successfully processed.
touch $WORK_DIR/STAMPS/$PACKAGE/.builddir_ok
continue
fi
fi
@ -388,7 +403,7 @@ for TLST in *.tlst ; do
CGIT_BRANCH=${BRANCH:+?id=$BRANCH}
CGIT_SERVER=${CGIT_URI#http://}
CGIT_SERVER=${CGIT_SERVER%%/*}
curl $CGIT_URI/tree/${REPODIR#*/}$CGIT_BRANCH | sed -n 's:^.*src="/icons/text\.gif" .* href="\([^"]*\)".*$:\1:p' |
curl $CGIT_URI/tree/${REPODIR#*/}$CGIT_BRANCH | sed -n 's:^.*class='\''ls-blob[^'\'']*'\'' href='\''\([^'\'']*\)'\''.*$:\1:p' |
while read ; do
wget -N http://$CGIT_SERVER${REPLY/\/tree\///plain/}
done