mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-20 13:37:38 +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:
|
if args.debug:
|
||||||
print("DEBUG: ", *objs, file=sys.stderr)
|
print("DEBUG: ", *objs, file=sys.stderr)
|
||||||
|
|
||||||
|
def err(*objs):
|
||||||
|
print("ERR: ", *objs, file=sys.stderr)
|
||||||
|
|
||||||
def proj_dir(name):
|
def proj_dir(name):
|
||||||
return projs_root + '/' + name
|
return projs_root + '/' + name
|
||||||
|
|
||||||
|
|
@ -30,6 +33,19 @@ def re_section(name):
|
||||||
'(?=[)',
|
'(?=[)',
|
||||||
re.DOTALL)
|
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
|
# TODO: add support for customizing this in project.conf
|
||||||
def htdocs_dir(name):
|
def htdocs_dir(name):
|
||||||
pd = proj_dir(name)
|
pd = proj_dir(name)
|
||||||
|
|
@ -39,8 +55,11 @@ def htdocs_dir(name):
|
||||||
return r
|
return r
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def required_cascade():
|
def pkg_required_os_cascade():
|
||||||
return []
|
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):
|
def strip_module_from_spec(mod):
|
||||||
return re.sub(r'-devel$|-run$', '', re.split('([=><]+)', mod)[0].strip())
|
return re.sub(r'-devel$|-run$', '', re.split('([=><]+)', mod)[0].strip())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue