Ejemplo n.º 1
0
    def massage_manifests(self):
        """
        For each device in config['devices'], we'll strip projects mentioned in
        'ignore_projects', or that have group attribute mentioned in
        'filter_groups'.
        We'll also map remote urls
        Finally, we'll resolve absolute refs for projects that aren't fully
        specified.
        """
        for device, device_config in self.query_devices().items():
            self.info("Massaging manifests for %s" % device)
            manifest = self.query_manifest(device)
            self.filter_projects(device_config, manifest)
            self.filter_groups(device_config, manifest)
            self.map_remotes(manifest)
            self.resolve_refs(manifest)
            repo_manifest.cleanup(manifest)
            self.device_manifests[device] = manifest

            manifest_path = self.query_manifest_path(device)
            manifest_xml = manifest.toxml()
            if not manifest_xml.endswith("\n"):
                manifest_xml += "\n"

            if self.config['do_write']:
                self.mkdir_p(os.path.dirname(manifest_path))
                self.write_to_file(manifest_path, manifest_xml)
Ejemplo n.º 2
0
    def massage_manifests(self):
        """
        For each device in config['devices'], we'll strip projects mentioned in
        'ignore_projects', or that have group attribute mentioned in
        'filter_groups'.
        We'll also map remote urls
        Finally, we'll resolve absolute refs for projects that aren't fully
        specified.
        """
        for device, device_config in self.query_devices().items():
            self.info("Massaging manifests for %s" % device)
            manifest = self.query_manifest(device)
            self.filter_projects(device_config, manifest)
            self.filter_groups(device_config, manifest)
            self.map_remotes(manifest)
            self.resolve_refs(manifest)
            repo_manifest.cleanup(manifest)
            self.device_manifests[device] = manifest

            manifest_path = self.query_manifest_path(device)
            manifest_xml = manifest.toxml()
            if not manifest_xml.endswith("\n"):
                manifest_xml += "\n"

            if self.config['do_write']:
                self.mkdir_p(os.path.dirname(manifest_path))
                self.write_to_file(manifest_path, manifest_xml)
Ejemplo n.º 3
0
 def write_manifest(self):
     manifest = self.query_manifest()
     default = repo_manifest.get_default(manifest)
     for p in manifest.getElementsByTagName('project'):
         if not p.hasAttribute('remote'):
             p.setAttribute('remote', default.getAttribute('remote'))
     repo_manifest.cleanup(manifest)
     c = self.config
     self.write_to_file(c['output'], manifest.toxml())
 def write_manifest(self):
     manifest = self.query_manifest()
     default = repo_manifest.get_default(manifest)
     for p in manifest.getElementsByTagName('project'):
         if not p.hasAttribute('remote'):
             p.setAttribute('remote', default.getAttribute('remote'))
     repo_manifest.cleanup(manifest)
     c = self.config
     self.write_to_file(c['output'], manifest.toxml())