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 <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-02 09:50:50 +01:00
commit 6483de1a8f

View file

@ -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: