- Supplementary scripts improvements:

* Support for pot-only run (COLLECT_UPSTREAM=false).
  * Implemented check for possible strings in patches.

OBS-URL: https://build.opensuse.org/package/show/Base:System/translation-update-upstream?expand=0&rev=27
This commit is contained in:
Stanislav Brabec 2011-08-18 16:28:05 +00:00 committed by Git OBS Bridge
parent 6293a4f0f4
commit 53262446b9
4 changed files with 320 additions and 276 deletions

View File

@ -12,16 +12,15 @@ set -o errexit
source ${0%create-tlst-step2-create-gnome_gtp.sh}upstream-collect.conf
rm -f create-tlst-temp-osc-projects.lst
for REPOSITORY in ${OSC_REPOSITORIES[@]} ; do
osc ${OSC_APIURL:+--apiurl=$OSC_APIURL} list $REPOSITORY >create-tlst-temp-osc-projects.lst
done
osc ${OSC_APIURL:+--apiurl=$OSC_APIURL} list $REPOSITORY
done | sort -u >create-tlst-temp-osc-projects.lst
# branches tried for all apps:
KNOWN_BRANCHES="gnome-2-32"
KNOWN_BRANCHES="gnome-3-0"
# branches tried apps with the same name base:
# Do not forget hardcoded strings in the code below!
APP_BRANCHES="|gimp-2-6"
APP_BRANCHES="|gimp-2-6|gtk-3-0|glib-2-28"
# 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

View File

@ -1,6 +1,5 @@
# package domain method repository dir branch
# PAM CVS is currently broken:
#pam Linux-PAM cvs pam.cvs.sourceforge.net:/cvsroot/pam Linux-PAM/po
pam Linux-PAM cvs pam.cvs.sourceforge.net:/cvsroot/pam Linux-PAM/po
# No update available yet:
#pidgin pidgin tbz http://downloads.sourceforge.net/pidgin/pidgin-2.7.10.tar.bz2 pidgin-2.7.10/po
#pidgin pidgin tbz http://downloads.sourceforge.net/pidgin/pidgin-2.7.11.tar.bz2 pidgin-2.7.11/po
gtkspell gtkspell tgz http://downloads.sourceforge.net/gtkspell/gtkspell-2.0.16.tar.gz gtkspell-2.0.16/po

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Aug 18 18:27:20 CEST 2011 - sbrabec@suse.cz
- Supplementary scripts improvements:
* Support for pot-only run (COLLECT_UPSTREAM=false).
* Implemented check for possible strings in patches.
-------------------------------------------------------------------
Thu Jul 7 20:57:26 CEST 2011 - sbrabec@suse.cz

View File

@ -8,6 +8,9 @@
# Debug mode. Set to true if you want to keep working directories.
DEBUG=false
# Set to false to generate only pot files, true to collect po files.
COLLECT_UPSTREAM=true
# FIXME: false has problems with stamps!!!
# Number of CPUs. When > 1, then parallel processing of more po files is possible.
CPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
WORK_DIR=$PWD
@ -28,8 +31,20 @@ function rpmprep {
%_builddir $PWD/BUILD
EOF
# remove <RELEASE> tag from Release and delete shell escape comments.
sed -i '/^Release:/s/[<>]//g;/#%(bash/d' *.spec
sed -i '
# Remove <RELEASE> tag from Release and delete shell escape comments.
/^Release:/s/[<>]//g
# Remove bash shell escape comments (gstreamer, calls autoreconf that can fail).
/#%(bash/d
# Remove negative expressions in BuildRequires.
:1
s/^\(BuildRequires:.*[[:space:]]\)-[^[:space:]]*/\1/
t1
/^BuildRequires:[[:space:]]*$/d
# Modify some requirements to work without relevant packages installed.
s/%{xulrunner_version}/dummy/g
s/%{mozilla_ver}/dummy/g
' *.spec
eval rpmbuild --macros=/usr/lib/rpm/macros:/usr/lib/rpm/suse_macros:/usr/lib/rpm/platform/$(uname -i)-linux/macros:/etc/rpm/\\\*:$RPMDIR/macros --nodeps -bp ${*:-*.spec}
rm -rf $RPMDIR
trap - 0
@ -56,7 +71,7 @@ esac
rm -rf UPSTREAM
mkdir UPSTREAM
if ! test -d STAMPS ; then
mkdir -p pot
mkdir -p pot pot-tuu pot-diff
mkdir OSC PACKAGES UPDATE STAMPS
rm -f upstream-collect.log
fi
@ -67,6 +82,10 @@ cat >~/.upstream-collect.tmp/translation-update-upstream <<EOF
#!/bin/sh
echo "Dummy translation-update-upstream for upstream-collect.sh. Skipping merge of old translations."
echo \${3:-intltool-update --gettext-package=\${2:-\$T_U_U_DOMAIN} --pot} >\${1:-po}/.translation-update-upstream-implemented
cd ${1:-po}
# Generate and save a copy of the pot file now and compare later.
\${3:-intltool-update --gettext-package=\${2:-\$T_U_U_DOMAIN} --pot}
mv \${2:-\$T_U_U_DOMAIN}.pot \${2:-\$T_U_U_DOMAIN}-t-u-u.pot
EOF
chmod +x ~/.upstream-collect.tmp/translation-update-upstream
@ -79,8 +98,13 @@ chmod +x msgheadermerge msgheadermerge-compose msgheadermerge-parse upstream-col
for FILE in gnome-patch-translation-prepare gnome-patch-translation-update ; do
cat >~/.upstream-collect.tmp/$FILE <<EOF
#!/bin/sh
set -x
echo "Dummy $FILE for upstream-collect.sh. Skipping gnome-patch-translation."
# gnome-patch-translation may be a symlink (libgweather), that is why we have to check even with mkdir -p.
if ! test -L gnome-patch-translation ; then
mkdir -p gnome-patch-translation
fi
touch po/.gnome-patch-translation-implemented
EOF
chmod +x ~/.upstream-collect.tmp/$FILE
done
@ -226,9 +250,20 @@ for TLST in *.tlst ; do
fi
cd $RPMPODIR
if test -f .gnome-patch-translation-implemented ; then
echo $PACKAGE >>$WORK_DIR/gnome-patch-translation.lst
fi
if test -f .translation-update-upstream-implemented ; then
if bash ./.translation-update-upstream-implemented ; then
cp -a $DOMAIN.pot $WORK_DIR/pot/
cp -a $DOMAIN-t-u-u.pot $WORK_DIR/pot-tuu/$DOMAIN.pot
# Verify that patches don't introduce new strings.
msgcomm --uniq $DOMAIN.pot $DOMAIN-t-u-u.pot -o $WORK_DIR/pot-diff/$DOMAIN.pot
if ! test -f .gnome-patch-translation-implemented ; then
if test -f $WORK_DIR/pot-diff/$DOMAIN.pot ; then
echo >>$WORK_DIR/upstream-collect.log "package=$PACKAGE gettext-package=$DOMAIN method=$METHOD repository=$REPO directory=$DIR branch=${BRANCH:(default)}: new pot file contains unique strings, please check gnome-patch-translation"
fi
fi
else
# translation-update-upstream is implemented but fails:
if test -f $DOMAIN.pot ; then
@ -253,6 +288,7 @@ for TLST in *.tlst ; do
fi
fi
if $COLLECT_UPSTREAM ; then
cd $WORK_DIR/UPSTREAM
let SERIAL++ || :
mkdir $SERIAL
@ -543,15 +579,16 @@ for TLST in *.tlst ; do
cp -a $POX $WORK_DIR/UPDATE/po/$DOMAIN/$PO
done
mkdir -p $WORK_DIR/STAMPS/$PACKAGE/$DOMAIN/$METHOD/${REPO//[\/:.]/_}/$DIR/${BRANCH:-__HEAD__}
touch $WORK_DIR/STAMPS/$PACKAGE/.builddir_ok
if ! $DEBUG ; then
rm -rf $WORK_DIR/UPSTREAM/$SERIAL
fi
done
fi
mkdir -p $WORK_DIR/STAMPS/$PACKAGE/$DOMAIN/$METHOD/${REPO//[\/:.]/_}/$DIR/${BRANCH:-__HEAD__}
touch $WORK_DIR/STAMPS/$PACKAGE/.builddir_ok
done
done
if ! $DEBUG ; then
@ -560,6 +597,7 @@ if ! $DEBUG ; then
fi
fi
if $COLLECT_UPSTREAM ; then
cd $WORK_DIR/UPDATE
if test -d po ; then
tar -j -c -f $WORK_DIR/translation-update-upstream-$SNAPSHOT.tar.bz2 po
@ -567,6 +605,7 @@ fi
if test -d po-mandatory ; then
tar -j -c -f $WORK_DIR/translation-update-mandatory-$SNAPSHOT.tar.bz2 po-mandatory
fi
fi
cd $WORK_DIR
if ! $DEBUG ; then