コード例 #1
0
    def self_update(self):
        '''Update this instance of cerbero git repository'''

        if not self.args.self_update:
            return

        try:
            manifest = Manifest(self.args.self_update)
            manifest.parse()
            project = manifest.find_project('cerbero')
            git_dir = os.path.dirname(sys.argv[0])
            git.add_remote(git_dir, project.remote, project.fetch_uri)
            run_until_complete(git.fetch(git_dir))
            run_until_complete(git.checkout(git_dir, project.revision))
        except FatalError as ex:
            self.log_error(
                _("ERROR: Failed to proceed with self update %s") % ex)
        sys.exit(0)
コード例 #2
0
ファイル: cookbook.py プロジェクト: lrtxpra/cerbero
    def _load_manifest(self):
        manifest_path = self._config.manifest

        if not manifest_path:
         return

        manifest = Manifest(manifest_path)
        manifest.parse()

        for project in manifest.projects.values():
            for recipe in self.recipes.values():
                if recipe.stype not in [SourceType.GIT,
                                        SourceType.GIT_TARBALL]:
                    continue;

                default_fetch = manifest.get_fetch_uri(project, manifest.default_remote)
                if recipe.remotes['origin'] in [default_fetch,
                                                default_fetch[:-4]]:
                    recipe.remotes['origin'] = project.fetch_uri
                    recipe.commit = project.revision