From 82803276020bf6efa53aed0a9240667ce001d1b2 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 23 Mar 2026 10:09:30 +0100 Subject: [PATCH] App.os_release: cat os-release non-interactively Even with --interactive=[true|auto], there's no point in trying to read /etc/os-release interactively, so don't do that. Most notably, this commit keeps the property method from spilling /etc/os-release's content over the terminal. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/App.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/python/jw/pkg/App.py b/src/python/jw/pkg/App.py index ad936133..5241b066 100644 --- a/src/python/jw/pkg/App.py +++ b/src/python/jw/pkg/App.py @@ -18,6 +18,7 @@ from enum import Enum, auto from .lib.App import App as Base from .lib.log import * from .lib.Distro import Distro +from .lib.ExecContext import InputMode # Meaning of pkg.requires.xxx variables # build: needs to be built and installed before this can be built @@ -299,7 +300,13 @@ class App(Base): @property def os_release(self) -> str: if self.__os_release is None: - result = self.call_async(self.exec_context.run(['/usr/bin/cat', '/etc/os-release'], throw=True)) + result = self.call_async( + self.exec_context.run( + ['/usr/bin/cat', '/etc/os-release'], + throw=True, + cmd_input=InputMode.NonInteractive + ) + ) assert result.status == 0 self.__os_release = result.decode().stdout.strip() return self.__os_release