1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00

helpers: hide channels.cfg and git remote log (MR 2252)

Add a new output=null option to run_core and use it for some git
commands.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-10 04:34:06 +02:00 committed by Oliver Smith
parent 15ffc2f370
commit e087e7c665
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 11 additions and 9 deletions

View file

@ -100,7 +100,7 @@ def get_upstream_remote(aports: Path):
name_repo = aports.parts[-1]
urls = pmb.config.git_repos[name_repo]
command = ["git", "remote", "-v"]
output = pmb.helpers.run.user_output(command, aports)
output = pmb.helpers.run.user_output(command, aports, output="null")
for line in output.split("\n"):
if any(u in line for u in urls):
return line.split("\t", 1)[0]
@ -125,8 +125,7 @@ def parse_channels_cfg(aports: Path):
cfg = configparser.ConfigParser()
remote = get_upstream_remote(aports)
command = ["git", "show", f"{remote}/master:channels.cfg"]
stdout = pmb.helpers.run.user_output(command, aports,
check=False)
stdout = pmb.helpers.run.user_output(command, aports, output="null", check=False)
try:
cfg.read_string(stdout)
except configparser.MissingSectionHeaderError: