def CheckInstallable(self): if self.DISABLED: raise DisabledError('%s: package is disabled' % self.NAME) if self.LIBC is not None and self.LIBC != self.config.libc: raise DisabledError('%s: cannot be built with %s' % (self.NAME, self.config.libc)) 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.CheckSDKVersion(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.IsInstalled(conflicting_package, self.config): raise PkgConflictError( "%s: conflicts with installed package: %s" % (self.NAME, conflicting_package)) for dep in self.Dependencies(): try: dep.CheckInstallable() except DisabledError as e: raise DisabledError('%s depends on %s; %s' % (self.NAME, dep.NAME, e))
def IsInstalled(self): return util.IsInstalled(self.NAME, self.config, self.InstalledInfoContents())
def IsAnyVersionInstalled(self): return util.IsInstalled(self.NAME, self.config)