source: ubiquity/trunk/fuentes/debian/patches/nolangpacksinatall.patch @ 1056

Last change on this file since 1056 was 1056, checked in by kbut, 5 years ago

add lliurex files

File size: 1.4 KB
  • ubiquity/install_misc.py

    diff -Nuar ubiquity.old/ubiquity/install_misc.py ubiquity/ubiquity/install_misc.py
    old new  
    10901090        langpacks_file = '/var/lib/ubiquity/langpacks'
    10911091        if os.path.exists(langpacks_file):
    10921092            osextras.unlink_force(langpacks_file)
     1093        p1 = subprocess.Popen(['dpkg','-l'],stdout=subprocess.PIPE).communicate()[0]
     1094        p1 = p1.decode('utf-8')
     1095        list_packages = p1.split('\n')
     1096        installed_language_pack = []
     1097        for package in list_packages:
     1098            try:
     1099                package_name = package.split(' ')[2]
     1100                if package_name.startswith('language-pack-'):
     1101                    installed_language_pack.append(package_name)
     1102            except:
     1103                pass
     1104
    10931105        if install_new:
    10941106            if save:
    10951107                if not os.path.exists(os.path.dirname(langpacks_file)):
     
    10961108                    os.makedirs(os.path.dirname(langpacks_file))
    10971109                with open(langpacks_file, 'w') as langpacks:
    10981110                    for pkg in to_install:
    1099                         print(pkg, file=langpacks)
     1111                        if pkg not in installed_language_pack:
     1112                            print(pkg, file=langpacks)
    11001113                return []
    11011114            else:
    11021115                return to_install
Note: See TracBrowser for help on using the repository browser.