Esempio n. 1
0
def layers_gen(args):
    """ Collect data from repos in src_dir to generate the LAYERS file.
    """
    paths = PathSanity(args.top_dir)
    paths["src_dir"] = args.src_dir
    paths["bblayers_file"] = args.bblayers_file
    paths["layers_file"] = args.layers_file

    # create list of Repo objects
    repos = Repo.repos_from_state(paths["bblayers_file"],
                                  top_dir=paths._top_dir,
                                  src_dir=paths["src_dir"])

    # create LAYERS file
    layers = LayerSerializer(repos)
    with open(paths["layers_file"], 'w') as layers_fd:
        layers.write(fd=layers_fd)
Esempio n. 2
0
def layers_gen(args):
    """ Collect data from repos in src_dir to generate the LAYERS file.
    """
    paths = PathSanity(args.top_dir)
    paths["src_dir"] = args.src_dir
    paths["bblayers_file"] = args.bblayers_file
    paths["layers_file"] = args.layers_file

    # create list of Repo objects
    repos = Repo.repos_from_state(paths["bblayers_file"],
                                  top_dir=paths._top_dir,
                                  src_dir=paths["src_dir"])

    # create LAYERS file
    layers = LayerSerializer(repos)
    with open(paths["layers_file"], 'w') as layers_fd:
        layers.write(fd=layers_fd)
Esempio n. 3
0
def json_gen(args):
    """ Parse bblayers.conf and collect data from repos in src_dir to generate
        a json file representing their state.
    """
    paths = PathSanity(args.top_dir)
    paths["conf_dir"] = "conf"
    paths["bblayers_file"] = os.path.join(paths["conf_dir"], "bblayers.conf")
    paths["src_dir"] = args.src_dir
    paths["json_out"] = args.json_out

    # build a list of Repo objects and create a fetcher for them
    repos = Repo.repos_from_state(paths["bblayers_file"],
                                  top_dir=paths._top_dir,
                                  src_dir=paths["src_dir"])
    fetcher = RepoFetcher(paths["src_dir"], repos=repos)
    # Serialize Repo objects to JSON manifest
    with open(paths["json_out"], 'w') as repo_json_fd:
        json.dump(fetcher, repo_json_fd, indent=4, cls=FetcherEncoder)
Esempio n. 4
0
def json_gen(args):
    """ Parse bblayers.conf and collect data from repos in src_dir to generate
        a json file representing their state.
    """
    paths = PathSanity(args.top_dir)
    paths["conf_dir"] = "conf"
    paths["bblayers_file"] = os.path.join(paths["conf_dir"], "bblayers.conf")
    paths["src_dir"] = args.src_dir
    paths["json_out"] = args.json_out

    # build a list of Repo objects and create a fetcher for them
    repos = Repo.repos_from_state(paths["bblayers_file"],
                                  top_dir=paths._top_dir,
                                  src_dir=paths["src_dir"])
    fetcher = RepoFetcher(paths["src_dir"], repos=repos)
    # Serialize Repo objects to JSON manifest
    with open(paths["json_out"], 'w') as repo_json_fd:
        json.dump(fetcher, repo_json_fd, indent=4, cls=FetcherEncoder)