← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/bug-609107 into lp:launchpad/devel

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/bug-609107 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code
Related bugs:
  #609107 Filter more paths from Soyuz uploads
  https://bugs.launchpad.net/bugs/609107


= Bug 609107 =

The Ubuntu guys (Arne & David to be specific) have asked that for Ubuntu translations uploads generated by Soyuz, we ignore files in several extra directories.

This upload extends an existing filtering function that we have for this purpose to match on the extra patterns.

Not much to see...  To test:
{{{
./bin/test -vvc -m lp.translations -t sourcepackagerelease
}}}


Jeroen
-- 
https://code.launchpad.net/~jtv/launchpad/bug-609107/+merge/30755
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/bug-609107 into lp:launchpad/devel.
=== modified file 'lib/lp/soyuz/model/sourcepackagerelease.py'
--- lib/lp/soyuz/model/sourcepackagerelease.py	2010-05-11 09:35:33 +0000
+++ lib/lp/soyuz/model/sourcepackagerelease.py	2010-07-23 11:26:00 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0611,W0212
@@ -71,10 +71,20 @@
 
     filename = filename[len(source_prefix):]
 
-    if filename.startswith('debian/po/'):
-        # Skip filenames in debian/po/*.  They're from debconf
-        # translations, which are treated separately in Ubuntu.
-        return None
+    blocked_prefixes = [
+        # Translations for use by debconf--not used in Ubuntu.
+        'debian/po/',
+        # Debian Installer translations--treated separately.
+        'd-i/',
+        # Documentation--not translatable in Launchpad.
+        'help/',
+        'man/po/',
+        'man/po4a/',
+        ]
+
+    for prefix in blocked_prefixes:
+        if filename.startswith(prefix):
+            return None
 
     return filename
 

=== modified file 'lib/lp/translations/doc/sourcepackagerelease-translations.txt'
--- lib/lp/translations/doc/sourcepackagerelease-translations.txt	2010-04-01 04:29:46 +0000
+++ lib/lp/translations/doc/sourcepackagerelease-translations.txt	2010-07-23 11:26:00 +0000
@@ -132,10 +132,37 @@
     >>> print _filter_ubuntu_translation_file('source/bar.po')
     bar.po
 
-Files in source/debian/po/* are ignored.  They are generally debconf
-translations, unused in Ubuntu.
+Files in source/debian/po/* and a few other paths are ignored.
+
+Ones in debian/po are generally debconf translations, unused in Ubuntu.
 
     >>> print _filter_ubuntu_translation_file('source/debian/po/bar.po')
     None
 
-
+Ones in d-i are Debian Installer translations.  Ubuntu builds those
+translations very differently from how Debian does it, so we don't need
+these uploads.
+
+    >>> print _filter_ubuntu_translation_file('source/d-i/foo.po')
+    None
+
+Then there are some documentation directories whose contents we can't
+translate in Launchpad.
+
+    >>> print _filter_ubuntu_translation_file('source/help/xx.pot')
+    None
+    >>> print _filter_ubuntu_translation_file('source/man/po/yy.po')
+    None
+    >>> print _filter_ubuntu_translation_file('source/man/po4a/zz.pot')
+    None
+
+The match is on a path component boundary, so we don't filter other
+uploads whose paths happen to begin with the same words as a directory
+we filter.
+
+    >>> print _filter_ubuntu_translation_file('source/debian/pool.pot')
+    debian/pool.pot
+    >>> print _filter_ubuntu_translation_file('source/d-input.pot')
+    d-input.pot
+    >>> print _filter_ubuntu_translation_file('source/man/positive/nl.po')
+    man/positive/nl.po


Follow ups