~ubuntu-branches/ubuntu/oneiric/language-selector/oneiric

« back to all changes in this revision

Viewing changes to LanguageSelector/CheckLanguageSupport.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-26 11:41:04 UTC
  • Revision ID: james.westby@ubuntu.com-20110526114104-yrxyuauhrcbm59ae
Tags: 0.38
* LanguageSelector/CheckLanguageSupport.py, LanguageSelector/LangCache.py:
  Allow pkg_depends to do language/locale suffix patterns for writing aids
  ('wa') as well. This will make it a lot easier and robust to add hyphen-*,
  mythes-* and friends.
* data/pkg_depends: Replace per-language mythes-*/hyphen-* lists with a
  pattern.
* LanguageSelector/CheckLanguageSupport.py, LanguageSelector/LangCache.py:
  Support empty dependencies, in which case install the package
  unconditionally for this language.
* LanguageSelector/CheckLanguageSupport.py, LanguageSelector/LangCache.py:
  Implement missing handling of fonts ("fn:") and input support ("im:") in
  pkg_depends.
* data/pkg_depends: Add all remaining dependencies which we previously
  carried in language-support-* (which will go away).
* data/blacklist: Remove all packages, none of them exist any more.
* Remove language-support-* handling, they will go away in oneiric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        This function is to be called from getMissingPackages().
27
27
        """
28
28
        if not packages:
29
 
            if (self.system_pkgcode and pkgcode == self.system_pkgcode):
30
 
                scanlist = ['language-pack', 'language-support-fonts', 'language-support-input', 'language-support-writing']
31
 
            else:
32
 
                scanlist = ['language-pack']
33
 
            for x in scanlist:
34
 
                pkg = '%s-%s' % (x, pkgcode)
35
 
                if pkg in self._cache:
36
 
                    if not self._cache[pkg].is_installed and \
37
 
                       not self._cache[pkg].marked_install:
38
 
                        self.missing.add(pkg)
39
 
                    else:
40
 
                        self.installed.add(pkg)
 
29
            pkg = 'language-pack-%s' % pkgcode
 
30
            if pkg in self._cache:
 
31
                if not self._cache[pkg].is_installed and \
 
32
                   not self._cache[pkg].marked_install:
 
33
                    self.missing.add(pkg)
 
34
                else:
 
35
                    self.installed.add(pkg)
41
36
                    
42
37
        if pkgcode in self.pkg_translations:
43
38
            for (pkg, translation) in self.pkg_translations[pkgcode]:
66
61
                        else:
67
62
                            self.installed.add(translation)
68
63
                    
69
 
        if pkgcode in self.pkg_writing and \
70
 
           (pkgcode == self.system_pkgcode or \
71
 
           ('language-support-writing-%s' % pkgcode in self._cache and \
72
 
           self._cache['language-support-writing-%s' % pkgcode].is_installed) or \
73
 
           ('language-support-writing-%s' % pkgcode in self._cache and \
74
 
           self._cache['language-support-writing-%s' % pkgcode].mark_install) or \
75
 
           ('language-support-writing-%s' % pkgcode in self._cache and \
76
 
           self._cache['language-support-writing-%s' % pkgcode].markUpgrade)):
 
64
        if pkgcode in self.pkg_writing and pkgcode == self.system_pkgcode:
77
65
            for (pkg, pull_pkg) in self.pkg_writing[pkgcode]:
78
66
                if '|' in pkg:
79
67
                    # multiple dependencies, if one of them is installed, pull the pull_pkg
117
105
                            else:
118
106
                                self.installed.add(pull_pkg)
119
107
                    else:
120
 
                        if pkg in self._cache and \
 
108
                        # pkg might be empty for installing unconditionally (i. e. no dependency)
 
109
                        if (pkg == '' or (pkg in self._cache and \
121
110
                           (self._cache[pkg].is_installed or \
122
111
                           self._cache[pkg].marked_install or \
123
 
                           self._cache[pkg].marked_upgrade) and \
 
112
                           self._cache[pkg].marked_upgrade))) and \
124
113
                           pull_pkg in self._cache:
125
114
                            if ((not self._cache[pull_pkg].is_installed and \
126
115
                               not self._cache[pull_pkg].marked_install and \
180
169
                (c, lc, k, v) = l.split(':')
181
170
            except ValueError:
182
171
                continue
183
 
            if (c == 'tr' and lc == ''):
 
172
            if (c in ['tr', 'wa'] and lc == ''):
184
173
                filter_list[v] = k
185
 
            elif (c == 'wa' and lc != ''):
 
174
            elif (c in ['wa', 'fn', 'im'] and lc != ''):
186
175
                if '|' in lc:
187
176
                    for l in lc.split('|'):
188
177
                        if not l in self.pkg_writing: