projects.py: Rename command requires-pkg to required-os-pkg

Rename command requires-pkg to required-os-pkg to avoid confusion with
pkg-reqires. The command could be merged into pkg-requires at a later time.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-06-11 10:46:23 +00:00
commit 7abbf1d044
3 changed files with 37 additions and 37 deletions

View file

@ -166,13 +166,13 @@ build-order-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
build-order: build-order-all
echo-prereq-build:
@$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS)
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS)
echo-prereq-install:
@$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS)
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS)
echo-prereq-release:
@$(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS)
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS)
echo-os:
@$(GET_OS_SH)
@ -221,10 +221,10 @@ pkg-manager-refresh:
$(PKG_MANAGER_SH) refresh $(DASH_Y)
pkg-install-prereq-build:
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS))
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS))
pkg-install-prereq-release:
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS))
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS))
pkg-exclude-built-today:
touch $(EXCLUDES_FILE)

View file

@ -187,7 +187,7 @@ prefix.done:
touch $@
echo-prereq-build:
@echo $(call proj_query, requires-pkg --flavours "build" $(PROJECT))
@echo $(call proj_query, required-os-pkg --flavours "build" $(PROJECT))
git-ssh-%:
bash -c "`git remote get-url --push $* | sed 's|ssh://||; s|\([^/]\+\)/\(.*\)|LC_CDPATH=/\2 ssh -o SendEnv=LC_CDPATH \1|'`"

View file

@ -626,37 +626,6 @@ def cmd_test(args_):
args=parser.parse_args(args_)
print("blah = " + args.blah)
# TODO: seems at least partly redundant to cmd_pkg_requires / pkg_relations
def cmd_requires_pkg(args_):
parser = argparse.ArgumentParser(description='requires-pkg')
parser.add_argument('module', nargs='*', help='Modules')
parser.add_argument('--flavours', help='Dependency flavours', default='build')
parser.add_argument('--skip-excluded', action='store_true', default=False,
help='Output empty prerequisite list if module is excluded')
args = parser.parse_args(args_)
modules = args.module
flavours = args.flavours.split()
debug("flavours = " + args.flavours)
deps = get_modules_from_project_txt(modules, 'pkg.requires.jw', flavours,
scope = 2, add_self=True, names_only=True)
if args.skip_excluded:
for d in deps:
if is_excluded_from_build(d) is not None:
deps.remove(d)
subsecs = os_cascade()
debug("subsecs = ", subsecs)
requires = []
for s in subsecs:
for f in flavours:
vals = collect_values(deps, 'pkg.requires.' + s, f)
if vals:
requires = requires + vals
# TODO: add all not in build tree as -devel
r = ''
for m in requires:
r = r + ' ' + m
print(r[1:])
def cmd_os_cascade(args_):
print(' '.join(os_cascade()))
@ -745,6 +714,37 @@ def cmd_prereq(args_):
args.flavour, scope = 2, add_self=False, names_only=True)
print(' '.join(deps))
# TODO: seems at least partly redundant to cmd_pkg_requires / pkg_relations
def cmd_required_os_pkg(args_):
parser = argparse.ArgumentParser(description='required-os-pkg')
parser.add_argument('module', nargs='*', help='Modules')
parser.add_argument('--flavours', help='Dependency flavours', default='build')
parser.add_argument('--skip-excluded', action='store_true', default=False,
help='Output empty prerequisite list if module is excluded')
args = parser.parse_args(args_)
modules = args.module
flavours = args.flavours.split()
debug("flavours = " + args.flavours)
deps = get_modules_from_project_txt(modules, 'pkg.requires.jw', flavours,
scope = 2, add_self=True, names_only=True)
if args.skip_excluded:
for d in deps:
if is_excluded_from_build(d) is not None:
deps.remove(d)
subsecs = os_cascade()
debug("subsecs = ", subsecs)
requires = []
for s in subsecs:
for f in flavours:
vals = collect_values(deps, 'pkg.requires.' + s, f)
if vals:
requires = requires + vals
# TODO: add all not in build tree as -devel
r = ''
for m in requires:
r = r + ' ' + m
print(r[1:])
def cmd_pkg_requires(args_):
return pkg_relations("requires", args_)