Exemplo n.º 1
0
 def get_module_state(self, modules):
     installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
     
     module_state = {}
     for module in modules:
         # only consider SystemModules or modules with <pkg-config>
         if (isinstance(module, SystemModule) or
             (isinstance(module.branch, TarballBranch) and
              module.pkg_config is not None)):
             required_version = module.branch.version
             installed_version = None
             new_enough = False
             systemmodule = isinstance(module, SystemModule)
             if module.pkg_config is not None:
                 # strip off the .pc
                 module_pkg = module.pkg_config[:-3]
                 if module_pkg in installed_pkgconfig:
                     installed_version = installed_pkgconfig[module_pkg]
                     if required_version is None:
                         new_enough = True
                     else:
                         new_enough = compare_version(installed_version,
                                                      required_version)
             elif systemmodule:
                 new_enough = systeminstall.systemdependencies_met \
                                  (module.name, module.systemdependencies,
                                   self.config)
                 if new_enough:
                     installed_version = 'unknown'
             module_state[module] = (required_version, installed_version,
                                     new_enough, systemmodule)
     return module_state
Exemplo n.º 2
0
 def get_module_state(self, modules):
     installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
     
     module_state = {}
     for module in modules:
         # only consider SystemModules or modules with <pkg-config>
         if (isinstance(module, SystemModule) or
             (isinstance(module.branch, TarballBranch) and
              module.pkg_config is not None)):
             required_version = module.branch.version
             installed_version = None
             new_enough = False
             systemmodule = isinstance(module, SystemModule)
             if module.pkg_config is not None:
                 # strip off the .pc
                 module_pkg = module.pkg_config[:-3]
                 if module_pkg in installed_pkgconfig:
                     installed_version = installed_pkgconfig[module_pkg]
                     if required_version is None:
                         new_enough = True
                     else:
                         new_enough = compare_version(installed_version,
                                                      required_version)
             elif systemmodule:
                 new_enough = systeminstall.systemdependencies_met \
                                  (module.name, module.systemdependencies,
                                   self.config)
                 if new_enough:
                     installed_version = 'unknown'
             module_state[module] = (required_version, installed_version,
                                     new_enough, systemmodule)
     return module_state
Exemplo n.º 3
0
    def remove_system_modules(self, modules):
        if not self.config.partial_build:
            return [module for module in modules \
                    if not isinstance(module, SystemModule)]

        return_list = []

        installed_pkgconfig = systeminstall.get_installed_pkgconfigs(
            self.config)

        for module in modules:
            if isinstance(module, SystemModule):
                continue
            skip = False
            if module.pkg_config is not None and \
            isinstance(module.branch, TarballBranch):
                # Strip off the .pc
                module_pkg = module.pkg_config[:-3]
                required_version = module.branch.version
                if module_pkg in installed_pkgconfig:
                    installed_version = installed_pkgconfig[module_pkg]
                    skip = compare_version(installed_version, required_version)
            if not skip:
                return_list.append(module)
        return return_list
Exemplo n.º 4
0
    def get_system_modules(self, modules):

        installed_pkgconfig = systeminstall.get_installed_pkgconfigs(
            self.config)

        # pkgconfig -> (required_version, installed_verison)
        module_state = {}
        for module in modules:
            if module.pkg_config is None:
                continue
            if (isinstance(module.branch, TarballBranch)
                    or isinstance(module, SystemModule)):
                # Strip off the .pc
                module_pkg = module.pkg_config[:-3]
                required_version = module.branch.version
                if not module_pkg in installed_pkgconfig:
                    module_state[module_pkg] = (module, required_version, None,
                                                False,
                                                isinstance(
                                                    module, SystemModule))
                else:
                    installed_version = installed_pkgconfig[module_pkg]
                    new_enough = compare_version(installed_version,
                                                 required_version)
                    module_state[module_pkg] = (module, required_version,
                                                installed_version, new_enough,
                                                isinstance(
                                                    module, SystemModule))
        return module_state
Exemplo n.º 5
0
    def get_system_modules(self, modules):

        installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
        
        # pkgconfig -> (required_version, installed_verison)
        module_state = {}
        for module in modules:
            if module.pkg_config is None:
                continue
            if (isinstance(module.branch, TarballBranch)
                or isinstance(module, SystemModule)):
                # Strip off the .pc
                module_pkg = module.pkg_config[:-3]
                required_version = module.branch.version
                if not module_pkg in installed_pkgconfig:
                    module_state[module_pkg] = (module, required_version, None, False, isinstance(module, SystemModule))
                else:
                    installed_version = installed_pkgconfig[module_pkg]
                    new_enough = compare_version(installed_version, required_version)
                    module_state[module_pkg] = (module, required_version, installed_version, new_enough, isinstance(module, SystemModule))
        return module_state