Ejemplo n.º 1
0
def migrate_repository(apt_file, old_repo, new_repo):
    try:
        sed(old_repo, new_repo, apt_file, use_regexp=False)
    except IOError as exc:
        logger.warn("Changing repository URL failed ({})".format(exc))
        return

    # TODO: track progress of this
    apt_handle.clear_cache()
    apt_handle.update(DummyProgress())
Ejemplo n.º 2
0
def migrate_repository(apt_file, old_repo, new_repo):
    try:
        sed(old_repo, new_repo, apt_file, use_regexp=False)
    except IOError as exc:
        logger.warn("Changing repository URL failed ({})".format(exc))
        return

    # TODO: track progress of this
    apt_handle.clear_cache()
    apt_handle.update(DummyProgress())
Ejemplo n.º 3
0
def install_locale(locale):
    locale = ensure_utf_locale(locale)

    if not is_locale_valid(locale):
        print 'locale not valid', locale
        return False

    enforce_root(_('You need to be root to change install a locale'))

    genfile_locale = standard_locale_to_genfile_entry(locale)
    sed(r'^# ({})'.format(genfile_locale), r'\1', LOCALE_GEN_FILE)
    run_cmd('locale-gen')
Ejemplo n.º 4
0
def install_locale(locale):
    locale = ensure_utf_locale(locale)

    if not is_locale_valid(locale):
        print 'locale not valid', locale
        return False

    enforce_root(_('You need to be root to change install a locale'))

    genfile_locale = standard_locale_to_genfile_entry(locale)
    sed(r'^# ({})'.format(genfile_locale), r'\1', LOCALE_GEN_FILE)
    run_cmd('locale-gen')