mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
0b05eb4c37
commit
8280327602
1 changed files with 8 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ from enum import Enum, auto
|
||||||
from .lib.App import App as Base
|
from .lib.App import App as Base
|
||||||
from .lib.log import *
|
from .lib.log import *
|
||||||
from .lib.Distro import Distro
|
from .lib.Distro import Distro
|
||||||
|
from .lib.ExecContext import InputMode
|
||||||
|
|
||||||
# Meaning of pkg.requires.xxx variables
|
# Meaning of pkg.requires.xxx variables
|
||||||
# build: needs to be built and installed before this can be built
|
# build: needs to be built and installed before this can be built
|
||||||
|
|
@ -299,7 +300,13 @@ class App(Base):
|
||||||
@property
|
@property
|
||||||
def os_release(self) -> str:
|
def os_release(self) -> str:
|
||||||
if self.__os_release is None:
|
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
|
assert result.status == 0
|
||||||
self.__os_release = result.decode().stdout.strip()
|
self.__os_release = result.decode().stdout.strip()
|
||||||
return self.__os_release
|
return self.__os_release
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue