Start printing before all descriptions are loaded

This commit is contained in:
Midgard 2020-07-12 12:42:12 +02:00
parent ef51e93127
commit de5ba7a533
Signed by untrusted user who does not match committer: midgard
GPG Key ID: 511C112F1331BBB4
1 changed files with 12 additions and 6 deletions

View File

@ -115,8 +115,7 @@ def description_from_ebuild(path):
def ebuild_info(path, repos):
m = re.fullmatch(r"(.+)/([^/]+)/([^/]+)/\3-([^/]+)\.ebuild", path)
if not m:
print(path)
assert m, path
PN = f"{m.group(2)}/{m.group(3)}"
PV = f"{m.group(4)}"
@ -129,9 +128,15 @@ def ebuild_info(path, repos):
"repo": first((name for name, path in repos if path == m.group(1))),
"repo_path": m.group(1),
"ebuild_path": path,
"description": description_from_ebuild(path),
"installed": os.path.exists(f"/var/db/pkg/{PN}-{PV}"),
} if m else None
}
def ebuild_extra_info(info):
return {
**info,
"description": description_from_ebuild(info["ebuild_path"]),
"installed": os.path.exists(f"/var/db/pkg/{info['P']}"),
}
# Formatting
@ -187,7 +192,8 @@ def main(argv):
for x in data:
print(format_item(
x, longest_cat=longest_cat, longest_namever=longest_namever, default_repo=default
ebuild_extra_info(x),
longest_cat=longest_cat, longest_namever=longest_namever, default_repo=default
))
return 0