diff options
author | Scriptkiddi <fritz@otlinghaus.it> | 2019-12-18 22:24:26 +0100 |
---|---|---|
committer | Scriptkiddi <fritz@otlinghaus.it> | 2019-12-18 22:24:26 +0100 |
commit | 2293669674ee7881ff3cfc84cfcbcf2e34de2144 (patch) | |
tree | 4d31a3c9f12bd8fb59593e79dcfe67cd65011694 /pkgs/servers | |
parent | 6fd5a4383b5d4102f32d019bdc4379af64ba65c4 (diff) | |
download | nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar.gz nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar.bz2 nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar.lz nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar.xz nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.tar.zst nixlib-2293669674ee7881ff3cfc84cfcbcf2e34de2144.zip |
home-assistant: Add error output for missing deps
Print missing dependencies to the console when running the parse requirements script. This allows to spot missing packages that could be added to nixpkgs
Diffstat (limited to 'pkgs/servers')
-rwxr-xr-x | pkgs/servers/home-assistant/parse-requirements.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 647e4513de44..96cf1d86050e 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -105,7 +105,9 @@ components = parse_components(version=version) build_inputs = {} for component in sorted(components.keys()): attr_paths = [] - for req in sorted(get_reqs(components, component)): + missing_reqs = [] + reqs = sorted(get_reqs(components, component)) + for req in reqs: # Some requirements are specified by url, e.g. https://example.org/foobar#xyz==1.0.0 # Therefore, if there's a "#" in the line, only take the part after it req = req[req.find('#') + 1:] @@ -114,8 +116,14 @@ for component in sorted(components.keys()): if attr_path is not None: # Add attribute path without "python3Packages." prefix attr_paths.append(attr_path[len(PKG_SET + '.'):]) + else: + missing_reqs.append(name) else: build_inputs[component] = attr_paths + n_diff = len(reqs) > len(build_inputs[component]) + if n_diff > 0: + print("Component {} is missing {} dependencies".format(component, n_diff)) + print("missing requirements: {}".format(missing_reqs)) with open(os.path.dirname(sys.argv[0]) + '/component-packages.nix', 'w') as f: f.write('# Generated by parse-requirements.py\n') |