[Debian-l10n-commits] r1219 - in /dl10n/trunk/pootle/sync-projects.d: 10debconf 20di cfg/10debconf cfg/20di cfg/common
bubulle at users.alioth.debian.org
bubulle at users.alioth.debian.org
Fri Aug 15 22:02:11 UTC 2008
Author: bubulle
Date: Fri Aug 15 22:02:11 2008
New Revision: 1219
URL: http://svn.debian.org/wsvn/?sc=1&rev=1219
Log:
Use a config file for 20di
Factorise the config files
Added:
dl10n/trunk/pootle/sync-projects.d/cfg/20di
dl10n/trunk/pootle/sync-projects.d/cfg/common (with props)
Modified:
dl10n/trunk/pootle/sync-projects.d/10debconf
dl10n/trunk/pootle/sync-projects.d/20di
dl10n/trunk/pootle/sync-projects.d/cfg/10debconf
Modified: dl10n/trunk/pootle/sync-projects.d/10debconf
URL: http://svn.debian.org/wsvn/dl10n/trunk/pootle/sync-projects.d/10debconf?rev=1219&op=diff
==============================================================================
--- dl10n/trunk/pootle/sync-projects.d/10debconf (original)
+++ dl10n/trunk/pootle/sync-projects.d/10debconf Fri Aug 15 22:02:11 2008
@@ -1,5 +1,6 @@
#!/bin/sh
+. `dirname $0`/cfg/common
. `dirname $0`/cfg/`basename $0`
echo "`basename $0`: Updating debconf translations..."
@@ -8,7 +9,7 @@
rm $TEMPDIR
-cd $PROJECTDIR
+cd $POOTLEDIR
svn -q up
[ -f $TARBALL ] || exit 1
@@ -65,29 +66,29 @@
# Of course, if the directory does not exist in Pootle (new
# package with debconf), we will just add it
# and copy files from the tarball
- if [ -d $PROJECTDIR/$pkg ] ; then
+ if [ -d $POOTLEDIR/$pkg ] ; then
# So, there's something in Pootle
# Cycle over all PO files
for pofile in `\ls -1 $pkg/*.po 2>/dev/null` ; do
filename=`basename $pofile`
- if [ -f $PROJECTDIR/$pkg/$filename ] ; then
+ if [ -f $POOTLEDIR/$pkg/$filename ] ; then
# Give priority to the file in Pootle
- msgcat --use-first $PROJECTDIR/$pkg/$filename $pofile >$TEMPFILE 2>/dev/null
+ msgcat --use-first $POOTLEDIR/$pkg/$filename $pofile >$TEMPFILE 2>/dev/null
# And merge with the POT file from the tarball
- msgmerge -U $TEMPFILE $PROJECTDIR/$pkg/templates.pot >/dev/null 2>&1
+ msgmerge -U $TEMPFILE $POOTLEDIR/$pkg/templates.pot >/dev/null 2>&1
# And overwrite the Pootle file
- cp $TEMPFILE $PROJECTDIR/$pkg/$filename
+ cp $TEMPFILE $POOTLEDIR/$pkg/$filename
else
# Maybe *that* file didn't exist in Pootle
# In such case, just copy it
- cp $pofile $PROJECTDIR/$pkg
- msgmerge -U $PROJECTDIR/$pkg/$filename $PROJECTDIR/$pkg/templates.pot >/dev/null 2>&1
+ cp $pofile $POOTLEDIR/$pkg
+ msgmerge -U $POOTLEDIR/$pkg/$filename $POOTLEDIR/$pkg/templates.pot >/dev/null 2>&1
fi
done
else
# There was no directory in Pootle yet, just copy
- mkdir -p $PROJECTDIR/$pkg
- cp -r $pkg/* $PROJECTDIR/$pkg
+ mkdir -p $POOTLEDIR/$pkg
+ cp -r $pkg/* $POOTLEDIR/$pkg
fi
rm $TEMPFILE 2>/dev/null || true
done
@@ -99,25 +100,25 @@
echo " Cleaning out broken files..."
for file in $BROKEN; do
echo " $file"
- rm $PROJECTDIR/$file
+ rm $POOTLEDIR/$file
done
# Some packages should be ignored for various reasons
echo " Cleaning out ignored packages..."
for pkg in $IGNORE; do
echo " $pkg"
- rm -rf `find $PROJECTDIR -mindepth 3 -maxdepth 3 -name $pkg` #2>/dev/null
+ rm -rf `find $POOTLEDIR -mindepth 3 -maxdepth 3 -name $pkg` #2>/dev/null
done
# And some packages provide useless garbage
echo " Cleaning out garbage..."
for dir in $GARBAGE; do
echo " $dir"
- rm -rf $PROJECTDIR/$dir
+ rm -rf $POOTLEDIR/$dir
done
# What languages are present?
-LANGUAGES=`find $PROJECTDIR -name \*.po | cut -f9 -d\/ | sort | uniq | cut -f1 -d\.`
+LANGUAGES=`find $POOTLEDIR -name \*.po | cut -f9 -d\/ | sort | uniq | cut -f1 -d\.`
# This will allow automatically adding a language as soon as *one* package
# provides a file for it
@@ -125,7 +126,7 @@
# That's slightly suboptimal but this is the only way to have correct
# statistics in Pootle
echo " Updating Pootle files..."
-for pkg in `find $PROJECTDIR -maxdepth 3 -mindepth 3 -type d | grep -v \\.svn` ; do
+for pkg in `find $POOTLEDIR -maxdepth 3 -mindepth 3 -type d | grep -v \\.svn` ; do
for lang in $LANGUAGES; do
if [ ! -f $pkg/$lang.po ] ; then
cp $pkg/templates.pot $pkg/$lang.po
@@ -138,7 +139,7 @@
# Now commit the whole stuff to SVN
echo " Committing to SVN..."
-cd $PROJECTDIR
+cd $POOTLEDIR
svn -q up
# echo " Committing updated files"
svn -q commit -m"[SILENT_COMMIT] Update existing files for `date +%Y%m%d%H%M`"
@@ -150,11 +151,11 @@
# echo " Adding POT files"
# find . -type f -name templates.pot | grep -v \\.svn | xargs svn add 2>/dev/null
-# Now we need to find out what directories are in $PROJECTDIR but
+# Now we need to find out what directories are in $POOTLEDIR but
# aren't anymore in the tarball. Most of the time, this will be
# packages that dropped po-debconf support
echo " Finding added/removed files/directories..."
-cd $PROJECTDIR
+cd $POOTLEDIR
find . -mindepth 3 -maxdepth 3 -type d | grep -v \\.svn | sort > /tmp/list-pootle
cd $TEMPDIR
find . -mindepth 3 -maxdepth 3 -type d | sort > /tmp/list-tarball
Modified: dl10n/trunk/pootle/sync-projects.d/20di
URL: http://svn.debian.org/wsvn/dl10n/trunk/pootle/sync-projects.d/20di?rev=1219&op=diff
==============================================================================
--- dl10n/trunk/pootle/sync-projects.d/20di (original)
+++ dl10n/trunk/pootle/sync-projects.d/20di Fri Aug 15 22:02:11 2008
@@ -1,6 +1,10 @@
#!/bin/sh
-DI=/var/lib/pootle/di
+. `dirname $0`/cfg/common
+. `dirname $0`/cfg/`basename $0`
+
+echo "`basename $0`: Updating debconf translations..."
+
echo "Updating Debian Installer..."
for i in `find $DI -maxdepth 2 -mindepth 2 -type d | grep -v "\.svn"`; do
Modified: dl10n/trunk/pootle/sync-projects.d/cfg/10debconf
URL: http://svn.debian.org/wsvn/dl10n/trunk/pootle/sync-projects.d/cfg/10debconf?rev=1219&op=diff
==============================================================================
--- dl10n/trunk/pootle/sync-projects.d/cfg/10debconf (original)
+++ dl10n/trunk/pootle/sync-projects.d/cfg/10debconf Fri Aug 15 22:02:11 2008
@@ -1,7 +1,4 @@
#!/bin/sh
-
-# The location of Pootle files
-PROJECTDIR=/var/lib/pootle/debconf
# Packages that are false positives: they don't really have po-debconf
# translations
Added: dl10n/trunk/pootle/sync-projects.d/cfg/20di
URL: http://svn.debian.org/wsvn/dl10n/trunk/pootle/sync-projects.d/cfg/20di?rev=1219&op=file
==============================================================================
--- dl10n/trunk/pootle/sync-projects.d/cfg/20di (added)
+++ dl10n/trunk/pootle/sync-projects.d/cfg/20di Fri Aug 15 22:02:11 2008
@@ -1,0 +1,2 @@
+# The directory holding all D-I files
+DI=${POOTLEDIR}/di
Added: dl10n/trunk/pootle/sync-projects.d/cfg/common
URL: http://svn.debian.org/wsvn/dl10n/trunk/pootle/sync-projects.d/cfg/common?rev=1219&op=file
==============================================================================
--- dl10n/trunk/pootle/sync-projects.d/cfg/common (added)
+++ dl10n/trunk/pootle/sync-projects.d/cfg/common Fri Aug 15 22:02:11 2008
@@ -1,0 +1,5 @@
+#!/bin/sh
+
+# The location of Pootle files
+POOTLEDIR=/var/lib/pootle/debconf
+
Propchange: dl10n/trunk/pootle/sync-projects.d/cfg/common
------------------------------------------------------------------------------
svn:executable = *
More information about the Debian-l10n-commits
mailing list