mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
scripts/kde/collect-metadata: option to use unstable version
This commit is contained in:
parent
2e1ed6a230
commit
818c7c2111
2 changed files with 28 additions and 20 deletions
|
@ -27,8 +27,13 @@ import utils
|
|||
),
|
||||
default=pathlib.Path(__file__).parent.parent.parent.parent
|
||||
)
|
||||
def main(repo_metadata: pathlib.Path, nixpkgs: pathlib.Path):
|
||||
metadata = utils.KDERepoMetadata.from_repo_metadata_checkout(repo_metadata)
|
||||
@click.option(
|
||||
"--unstable",
|
||||
default=False,
|
||||
is_flag=True
|
||||
)
|
||||
def main(repo_metadata: pathlib.Path, nixpkgs: pathlib.Path, unstable: bool):
|
||||
metadata = utils.KDERepoMetadata.from_repo_metadata_checkout(repo_metadata, unstable)
|
||||
out_dir = nixpkgs / "pkgs/kde/generated"
|
||||
metadata.write_json(out_dir)
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ class KDERepoMetadata:
|
|||
return project
|
||||
|
||||
@classmethod
|
||||
def from_repo_metadata_checkout(cls, repo_metadata: pathlib.Path):
|
||||
def from_repo_metadata_checkout(cls, repo_metadata: pathlib.Path, unstable=False):
|
||||
projects = [
|
||||
Project.from_yaml(metadata_file)
|
||||
for metadata_file in repo_metadata.glob("projects-invent/**/metadata.yaml")
|
||||
|
@ -122,11 +122,14 @@ class KDERepoMetadata:
|
|||
dep_graph={},
|
||||
)
|
||||
|
||||
dep_specs = ["dependency-data-stable-kf6-qt6"]
|
||||
dep_graph = collections.defaultdict(set)
|
||||
|
||||
for spec in dep_specs:
|
||||
spec_path = repo_metadata / "dependencies" / spec
|
||||
if unstable:
|
||||
spec_name = "dependency-data-kf6-qt6"
|
||||
else:
|
||||
spec_name = "dependency-data-stable-kf6-qt6"
|
||||
|
||||
spec_path = repo_metadata / "dependencies" / spec_name
|
||||
for line in spec_path.open():
|
||||
line = line.strip()
|
||||
if line.startswith("#"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue