mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
defs.mk, projects.py: Add command htdocs-dir
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
aacb3ffc0f
commit
c426a3748c
2 changed files with 20 additions and 0 deletions
|
|
@ -721,6 +721,7 @@ endef
|
|||
|
||||
proj_query = $(shell python $(MOD_SCRIPT_DIR)/projects.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(1))
|
||||
proj_dir = $(call proj_query,proj-dir $(1))
|
||||
htdocs_dir = $(call proj_query,htdocs-dir $(1))
|
||||
|
||||
# ----- local.mk
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from __future__ import print_function
|
|||
import sys
|
||||
import argparse
|
||||
from sets import Set
|
||||
from os.path import isdir
|
||||
from os.path import expanduser
|
||||
from os.path import basename
|
||||
from os.path import realpath
|
||||
|
|
@ -23,6 +24,15 @@ def debug(*objs):
|
|||
def proj_dir(name):
|
||||
return projs_root + '/' + name
|
||||
|
||||
# TODO: add support for customizing this in project.conf
|
||||
def htdocs_dir(name):
|
||||
pd = proj_dir(name)
|
||||
for r in [ pd + "/tools/html/htdocs", pd + "/htdocs", "/srv/www/proj/" + name
|
||||
]:
|
||||
if isdir(r):
|
||||
return r
|
||||
return None
|
||||
|
||||
def strip_module_from_spec(mod):
|
||||
return re.sub(r'-devel$|-run$', '', re.split('([=><]+)', mod)[0].strip())
|
||||
|
||||
|
|
@ -266,6 +276,15 @@ def cmd_proj_dir(args_):
|
|||
r.append(proj_dir(m))
|
||||
print(' '.join(r))
|
||||
|
||||
def cmd_htdocs_dir(args_):
|
||||
parser = argparse.ArgumentParser(description='htdocs-dir')
|
||||
parser.add_argument('module', nargs='*', help='Modules')
|
||||
args=parser.parse_args(args_)
|
||||
r = []
|
||||
for m in args.module:
|
||||
r.append(htdocs_dir(m))
|
||||
print(' '.join(r))
|
||||
|
||||
# -------------------------------------------------------------------- here we go
|
||||
|
||||
global_args = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue