Exemple #1
0
    def _pkg(self,package):

        

        t = DistTarball(self.config,package,self.store)
        tarball={}

        for ptype in [PackageType.DEVEL,PackageType.RUNTIME]:
            TNAME={PackageType.DEVEL:'devel',PackageType.RUNTIME:'runtime'}
            tarball[TNAME[ptype]]={
                'filename':t._get_name(ptype)
            }
        profile = {
            'name':package.name,
            'version':package.version,
            'platform':self.config.target_platform,
            'arch':self.config.target_arch,
            'recipes': self.get_recipes(package),
            'dependencies': self.get_packages_deps(package),

            #'deps': [p.name for p in self.store.get_package_deps(package.name, True)],
            #'direct.deps': [p.name for p in self.store.get_package_deps(package.name, False)],
            'tarball': tarball
        }

        if self.config.build_type == 'debug':
            profile['debug'] = True
        return profile
Exemple #2
0
    def dump(self, name, output_dir='.'):
        sdk = self.sdk(name)
        desc = {
            'name': name,
            'version': sdk.version,
            'platform': self.config.target_platform,
            'arch': self.config.target_arch,
            'recipes': {},
            'commit': self.commit()
        }

        for rname in self.recipes_of_sdk(name):
            recipe = self.recipe(rname)
            desc['recipes'][rname] = recipe.version

        tarball = DistTarball(self.config, sdk, self.store)

        files = []
        for ptype in [PackageType.DEVEL, PackageType.RUNTIME]:
            TNAME = {
                PackageType.DEVEL: 'devel',
                PackageType.RUNTIME: 'runtime'
            }

            filename = tarball._get_name(ptype)
            path = os.path.join(output_dir, filename)
            if os.path.exists(path):
                files.append(
                    {filename: {
                        'type': TNAME[ptype],
                        'MD5Sum': MD5(path)
                    }})
            else:
                if (name == 'build-tools') and (ptype == PackageType.DEVEL):
                    continue  # build-tools has no devel package

                reason = "abstract %s, but no %s package at %s" % (
                    name, TNAME[ptype], path)
                m.error(reason)
                raise FatalError(reason)

        desc['packages'] = files
        if name == 'build-tools':
            desc['prefix'] = self.config.build_tools_prefix
        else:
            desc['prefix'] = self.config.prefix

        return desc