~mterry/ubiquity/refresh-timezones

« back to all changes in this revision

Viewing changes to scripts/install.py

  • Committer: Colin Watson
  • Date: 2009-10-23 23:00:04 UTC
  • Revision ID: cjwatson@canonical.com-20091023230004-ni0m5x5kk72b4ojv
* Keep language-support-$LL installed if it happens to be in the live
filesystem, since there's no point spending time removing it; but don't
install it if it isn't in the live filesystem (LP: #458333).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1336
1336
        except debconf.DebconfError:
1337
1337
            return
1338
1338
 
 
1339
        cache = Cache()
 
1340
 
1339
1341
        to_install = []
 
1342
        checker = osextras.find_on_path('check-language-support')
1340
1343
        for lp in langpacks:
1341
1344
            # Basic language packs, required to get localisation working at
1342
1345
            # all. We install these almost unconditionally; if you want to
1349
1352
            # More extensive language support packages.
1350
1353
            # If pkgsel/language-packs is ALL, then speed things up by
1351
1354
            # calling check-language-support just once.
1352
 
            if (not all_langpacks and
1353
 
                osextras.find_on_path('check-language-support')):
 
1355
            if not all_langpacks and checker:
1354
1356
                check_lang = subprocess.Popen(
1355
1357
                    ['check-language-support', '-l', lp, '--show-installed'],
1356
1358
                    stdout=subprocess.PIPE)
1357
1359
                to_install.extend(check_lang.communicate()[0].strip().split())
1358
1360
            else:
1359
1361
                to_install.append('language-support-%s' % lp)
 
1362
            if checker:
 
1363
                # Keep language-support-$LL installed if it happens to be in
 
1364
                # the live filesystem, since there's no point spending time
 
1365
                # removing it; but don't install it if it isn't in the live
 
1366
                # filesystem.
 
1367
                toplevel = 'language-support-%s' % lp
 
1368
                toplevel_pkg = self.get_cache_pkg(cache, toplevel)
 
1369
                if toplevel_pkg and toplevel_pkg.isInstalled:
 
1370
                    to_install.append(toplevel)
1360
1371
        if all_langpacks and osextras.find_on_path('check-language-support'):
1361
1372
            check_lang = subprocess.Popen(
1362
1373
                ['check-language-support', '-a', '--show-installed'],
1367
1378
        # that exist in the live filesystem's apt cache, so that we can tell
1368
1379
        # the difference between "no such language pack" and "language pack
1369
1380
        # not retrievable given apt configuration in /target" later on.
1370
 
        cache = Cache()
1371
1381
        to_install = [lp for lp in to_install
1372
1382
                         if self.get_cache_pkg(cache, lp) is not None]
 
1383
 
1373
1384
        del cache
1374
1385
 
1375
1386
        self.record_installed(to_install)