mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
projects.py: Started implementation of required os cascade
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e82a0481b5
commit
bf056c61cc
1 changed files with 21 additions and 2 deletions
|
|
@ -21,6 +21,9 @@ def debug(*objs):
|
|||
if args.debug:
|
||||
print("DEBUG: ", *objs, file=sys.stderr)
|
||||
|
||||
def err(*objs):
|
||||
print("ERR: ", *objs, file=sys.stderr)
|
||||
|
||||
def proj_dir(name):
|
||||
return projs_root + '/' + name
|
||||
|
||||
|
|
@ -30,6 +33,19 @@ def re_section(name):
|
|||
'(?=[)',
|
||||
re.DOTALL)
|
||||
|
||||
def get_os():
|
||||
for d in [ projs_root + 'ytools/devutil/scripts', '/opt/ytools/bin' ]:
|
||||
script=d + '/get_os.sh'
|
||||
if os.path.isfile(script):
|
||||
cmd = '/bin/bash ' + script
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
(out, rr) = p.communicate()
|
||||
if rr:
|
||||
err("failed to run ", cmd)
|
||||
continue
|
||||
return out
|
||||
return "linux"
|
||||
|
||||
# TODO: add support for customizing this in project.conf
|
||||
def htdocs_dir(name):
|
||||
pd = proj_dir(name)
|
||||
|
|
@ -39,8 +55,11 @@ def htdocs_dir(name):
|
|||
return r
|
||||
return None
|
||||
|
||||
def required_cascade():
|
||||
return []
|
||||
def pkg_required_os_cascade():
|
||||
os = get_os()
|
||||
# TODO: implement this
|
||||
#return [ 'os', 'os.linux', 'os.linux.suse', 'os.linux.suse.tumbleweed' ] ?
|
||||
return [ 'os', 'linux', 'suse', 'suse-tumbleweed' ]
|
||||
|
||||
def strip_module_from_spec(mod):
|
||||
return re.sub(r'-devel$|-run$', '', re.split('([=><]+)', mod)[0].strip())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue