mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 13:18:57 +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
|
default=pathlib.Path(__file__).parent.parent.parent.parent
|
||||||
)
|
)
|
||||||
def main(repo_metadata: pathlib.Path, nixpkgs: pathlib.Path):
|
@click.option(
|
||||||
metadata = utils.KDERepoMetadata.from_repo_metadata_checkout(repo_metadata)
|
"--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"
|
out_dir = nixpkgs / "pkgs/kde/generated"
|
||||||
metadata.write_json(out_dir)
|
metadata.write_json(out_dir)
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ class KDERepoMetadata:
|
||||||
return project
|
return project
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_repo_metadata_checkout(cls, repo_metadata: pathlib.Path):
|
def from_repo_metadata_checkout(cls, repo_metadata: pathlib.Path, unstable=False):
|
||||||
projects = [
|
projects = [
|
||||||
Project.from_yaml(metadata_file)
|
Project.from_yaml(metadata_file)
|
||||||
for metadata_file in repo_metadata.glob("projects-invent/**/metadata.yaml")
|
for metadata_file in repo_metadata.glob("projects-invent/**/metadata.yaml")
|
||||||
|
@ -122,11 +122,14 @@ class KDERepoMetadata:
|
||||||
dep_graph={},
|
dep_graph={},
|
||||||
)
|
)
|
||||||
|
|
||||||
dep_specs = ["dependency-data-stable-kf6-qt6"]
|
|
||||||
dep_graph = collections.defaultdict(set)
|
dep_graph = collections.defaultdict(set)
|
||||||
|
|
||||||
for spec in dep_specs:
|
if unstable:
|
||||||
spec_path = repo_metadata / "dependencies" / spec
|
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():
|
for line in spec_path.open():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line.startswith("#"):
|
if line.startswith("#"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue