def index_json(self): for varname in 'name', 'version', 'build': if self.info[varname] != getattr(self, varname): raise PackageError( "info/index.json for %s: %r != %r" % (varname, self.info[varname], getattr(self, varname))) lst = [ check_name(self.info['name']), check_version(self.info['version']), check_build_number(self.info['build_number']), ] if PEDANTIC: lst.append(check_build_string(self.info['build'])) for res in lst: if res: raise PackageError("info/index.json: %s" % res) depends = self.info.get('depends') if depends is None: raise PackageError("info/index.json: key 'depends' missing") res = check_specs(depends) if res: raise PackageError("info/index.json: %s" % res) if PEDANTIC: lf = self.info.get('license_family', self.info.get('license')) if lf not in LICENSE_FAMILIES: raise PackageError("wrong license family: %s" % lf)
def index_json(self): for varname in 'name', 'version', 'build': if self.info[varname] != getattr(self, varname): raise PackageError("info/index.json for %s: %r != %r" % (varname, self.info[varname], getattr(self, varname))) lst = [ check_name(self.info['name']), check_version(self.info['version']), check_build_number(self.info['build_number']), ] if PEDANTIC: lst.append(check_build_string(self.info['build'])) for res in lst: if res: raise PackageError("info/index.json: %s" % res) depends = self.info.get('depends') if depends is None: raise PackageError("info/index.json: key 'depends' missing") res = check_specs(depends) if res: raise PackageError("info/index.json: %s" % res) if PEDANTIC: lf = self.info.get('license_family', self.info.get('license')) if lf not in LICENSE_FAMILIES: raise PackageError("wrong license family: %s" % lf)
def check_requirements(meta): for field in 'requirements/build', 'requirements/run': specs = get_field(meta, field, []) res = check_specs(specs) if res: raise RecipeError(res)