From 6483de1a8fecc40383a77310a2316bb254109411 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 2 Mar 2026 09:50:50 +0100 Subject: [PATCH] jw.pkg.App.get_os(): Don't use get-os.sh Remove get-os.sh from App.py to reduce redunancy. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/App.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/python/jw/pkg/App.py b/src/python/jw/pkg/App.py index 3dc7fa8a..89321f2f 100644 --- a/src/python/jw/pkg/App.py +++ b/src/python/jw/pkg/App.py @@ -351,22 +351,8 @@ class App(Base): return self.__find_dir(name, search_subdirs, search_absdirs, pretty) @lru_cache(maxsize=None) - def get_os(self, args="") -> str: - import subprocess - for d in [ self.__projs_root + '/jw-pkg/scripts', '/opt/jw-pkg/bin' ]: - script = d + '/get-os.sh' - if os.path.isfile(script): - cmd = '/bin/bash ' + script - if args: - cmd = cmd + ' ' + args - p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - (out, rr) = p.communicate() - if rr: - log(ERR, "failed to run ", cmd) - continue - out = re.sub('\n', '', out.decode('utf-8')) - return out - return "linux" + def get_os(self) -> str: + return self.distro_id + '-' + self.distro_codename # TODO: add support for customizing this in project.conf def htdocs_dir(self, project: str) -> str: