__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# SPDX-License-Identifier: Apache-2.0
# Copyright 2019 Red Hat, Inc.
from __future__ import annotations
import typing as T
def parse(lines: T.Iterable[str]) -> T.List[T.Tuple[T.List[str], T.List[str]]]:
rules: T.List[T.Tuple[T.List[str], T.List[str]]] = []
targets: T.List[str] = []
deps: T.List[str] = []
in_deps = False
out = ''
for line in lines:
if not line.endswith('\n'):
line += '\n'
escape = None
for c in line:
if escape:
if escape == '$' and c != '$':
out += '$'
if escape == '\\' and c == '\n':
continue
out += c
escape = None
continue
if c in {'\\', '$'}:
escape = c
continue
elif c in {' ', '\n'}:
if out != '':
if in_deps:
deps.append(out)
else:
targets.append(out)
out = ''
if c == '\n':
rules.append((targets, deps))
targets = []
deps = []
in_deps = False
continue
elif c == ':':
targets.append(out)
out = ''
in_deps = True
continue
out += c
return rules
class Target(T.NamedTuple):
deps: T.Set[str]
class DepFile:
def __init__(self, lines: T.Iterable[str]):
rules = parse(lines)
depfile: T.Dict[str, Target] = {}
for (targets, deps) in rules:
for target in targets:
t = depfile.setdefault(target, Target(deps=set()))
for dep in deps:
t.deps.add(dep)
self.depfile = depfile
def get_all_dependencies(self, name: str, visited: T.Optional[T.Set[str]] = None) -> T.List[str]:
deps: T.Set[str] = set()
if not visited:
visited = set()
if name in visited:
return []
visited.add(name)
target = self.depfile.get(name)
if not target:
return []
deps.update(target.deps)
for dep in target.deps:
deps.update(self.get_all_dependencies(dep, visited))
return sorted(deps)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| ast | Folder | 0755 |
|
|
| backend | Folder | 0755 |
|
|
| cargo | Folder | 0755 |
|
|
| cmake | Folder | 0755 |
|
|
| compilers | Folder | 0755 |
|
|
| dependencies | Folder | 0755 |
|
|
| interpreter | Folder | 0755 |
|
|
| interpreterbase | Folder | 0755 |
|
|
| linkers | Folder | 0755 |
|
|
| modules | Folder | 0755 |
|
|
| scripts | Folder | 0755 |
|
|
| templates | Folder | 0755 |
|
|
| utils | Folder | 0755 |
|
|
| wrap | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| _pathlib.py | File | 1.87 KB | 0644 |
|
| _typing.py | File | 1.82 KB | 0644 |
|
| arglist.py | File | 12.49 KB | 0644 |
|
| build.py | File | 135.02 KB | 0644 |
|
| coredata.py | File | 41.23 KB | 0644 |
|
| depfile.py | File | 2.33 KB | 0644 |
|
| envconfig.py | File | 14.92 KB | 0644 |
|
| environment.py | File | 43.1 KB | 0644 |
|
| machinefile.py | File | 5.07 KB | 0644 |
|
| mcompile.py | File | 13.85 KB | 0644 |
|
| mconf.py | File | 17.16 KB | 0644 |
|
| mdevenv.py | File | 10.15 KB | 0644 |
|
| mdist.py | File | 17.75 KB | 0644 |
|
| mesondata.py | File | 1.23 KB | 0644 |
|
| mesonlib.py | File | 549 B | 0644 |
|
| mesonmain.py | File | 13.54 KB | 0644 |
|
| mformat.py | File | 38.94 KB | 0644 |
|
| minit.py | File | 8.1 KB | 0644 |
|
| minstall.py | File | 38.43 KB | 0644 |
|
| mintro.py | File | 30.25 KB | 0644 |
|
| mlog.py | File | 20.33 KB | 0644 |
|
| mparser.py | File | 40.07 KB | 0644 |
|
| msetup.py | File | 18.99 KB | 0644 |
|
| msubprojects.py | File | 32.55 KB | 0644 |
|
| mtest.py | File | 89.76 KB | 0644 |
|
| munstable_coredata.py | File | 4.16 KB | 0644 |
|
| optinterpreter.py | File | 11.58 KB | 0644 |
|
| options.py | File | 35.04 KB | 0644 |
|
| programs.py | File | 18.15 KB | 0644 |
|
| rewriter.py | File | 42.51 KB | 0644 |
|