Exemplo n.º 1
0
    def check_installable(self):
        if self.DISABLED:
            raise DisabledError('%s: package is disabled' % self.NAME)

        if self.config.libc in self.DISABLED_LIBC:
            raise DisabledError('%s: cannot be built with %s' %
                                (self.NAME, self.config.libc))

        for disabled_toolchain in self.DISABLED_TOOLCHAIN:
            if '/' in disabled_toolchain:
                disabled_toolchain, arch = disabled_toolchain.split('/')
                if (self.config.arch == arch
                        and self.config.toolchain == disabled_toolchain):
                    raise DisabledError(
                        '%s: cannot be built with %s for %s' %
                        (self.NAME, self.config.toolchain, arch))
            else:
                if self.config.toolchain == disabled_toolchain:
                    raise DisabledError('%s: cannot be built with %s' %
                                        (self.NAME, self.config.toolchain))

        if self.config.arch in self.DISABLED_ARCH:
            raise DisabledError('%s: disabled for architecture: %s' %
                                (self.NAME, self.config.arch))

        if self.MIN_SDK_VERSION is not None:
            if not util.check_sdk_version(self.MIN_SDK_VERSION):
                raise DisabledError('%s: requires SDK version %s or above' %
                                    (self.NAME, self.MIN_SDK_VERSION))

        if self.ARCH is not None:
            if self.config.arch not in self.ARCH:
                raise DisabledError('%s: disabled for architecture: %s' %
                                    (self.NAME, self.config.arch))

        for conflicting_package in self.CONFLICTS:
            if util.is_installed(conflicting_package, self.config):
                raise PkgConflictError(
                    "%s: conflicts with installed package: %s" %
                    (self.NAME, conflicting_package))

        for dep in self.dependencies():
            try:
                dep.check_installable()
            except DisabledError as e:
                raise DisabledError('%s depends on %s; %s' %
                                    (self.NAME, dep.NAME, e))
Exemplo n.º 2
0
  def check_installable(self):
    if self.DISABLED:
      raise DisabledError('%s: package is disabled' % self.NAME)

    if self.config.libc in self.DISABLED_LIBC:
      raise DisabledError('%s: cannot be built with %s' %
                          (self.NAME, self.config.libc))

    for disabled_toolchain in self.DISABLED_TOOLCHAIN:
      if '/' in disabled_toolchain:
        disabled_toolchain, arch = disabled_toolchain.split('/')
        if (self.config.arch == arch and
            self.config.toolchain == disabled_toolchain):
          raise DisabledError('%s: cannot be built with %s for %s' %
                              (self.NAME, self.config.toolchain, arch))
      else:
        if self.config.toolchain == disabled_toolchain:
          raise DisabledError('%s: cannot be built with %s' %
                              (self.NAME, self.config.toolchain))

    if self.config.arch in self.DISABLED_ARCH:
      raise DisabledError('%s: disabled for architecture: %s' %
                          (self.NAME, self.config.arch))

    if self.MIN_SDK_VERSION is not None:
      if not util.check_sdk_version(self.MIN_SDK_VERSION):
        raise DisabledError('%s: requires SDK version %s or above' %
                            (self.NAME, self.MIN_SDK_VERSION))

    if self.ARCH is not None:
      if self.config.arch not in self.ARCH:
        raise DisabledError('%s: disabled for architecture: %s' %
                            (self.NAME, self.config.arch))

    for conflicting_package in self.CONFLICTS:
      if util.is_installed(conflicting_package, self.config):
        raise PkgConflictError("%s: conflicts with installed package: %s" %
                               (self.NAME, conflicting_package))

    for dep in self.dependencies():
      try:
        dep.check_installable()
      except DisabledError as e:
        raise DisabledError('%s depends on %s; %s' % (self.NAME, dep.NAME, e))
Exemplo n.º 3
0
 def is_installed(self):
     return util.is_installed(self.NAME, self.config,
                              self.installed_info_contents())
Exemplo n.º 4
0
 def is_any_version_installed(self):
   return util.is_installed(self.NAME, self.config)
Exemplo n.º 5
0
 def is_any_version_installed(self):
     return util.is_installed(self.NAME, self.config)
Exemplo n.º 6
0
 def is_installed(self):
   return util.is_installed(self.NAME, self.config,
                            self.installed_info_contents())