From 5b10ea339662d1161de1d170325ad770a70e9d38 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 6 Jun 2019 02:31:11 +0300 Subject: [PATCH] waifulib: deps: remove it, as it functionality was moved to fwgslib --- scripts/waifulib/deps.py | 65 ---------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 scripts/waifulib/deps.py diff --git a/scripts/waifulib/deps.py b/scripts/waifulib/deps.py deleted file mode 100644 index 7e33e7d..0000000 --- a/scripts/waifulib/deps.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -*- encoding: utf-8 -*- -# Michel Mooij, michel.mooij7@gmail.com - -from waflib import Utils -from waflib import Errors - - -def get_deps(bld, target): - '''Returns a list of (nested) targets on which this target depends. - - :param bld: a *waf* build instance from the top level *wscript* - :type bld: waflib.Build.BuildContext - :param target: task name for which the dependencies should be returned - :type target: str - :returns: a list of task names on which the given target depends - ''' - try: - tgen = bld.get_tgen_by_name(target) - except Errors.WafError: - return [] - else: - uses = Utils.to_list(getattr(tgen, 'use', [])) - deps = uses[:] - for use in uses: - deps += get_deps(bld, use) - return list(set(deps)) - - -def get_tgens(bld, names): - '''Returns a list of task generators based on the given list of task - generator names. - - :param bld: a *waf* build instance from the top level *wscript* - :type bld: waflib.Build.BuildContext - :param names: list of task generator names - :type names: list of str - :returns: list of task generators - ''' - tgens=[] - for name in names: - try: - tgen = bld.get_tgen_by_name(name) - except Errors.WafError: - pass - else: - tgens.append(tgen) - return list(set(tgens)) - - -def get_targets(bld): - '''Returns a list of user specified build targets or None if no specific - build targets has been selected using the *--targets=* command line option. - - :param bld: a *waf* build instance from the top level *wscript*. - :type bld: waflib.Build.BuildContext - :returns: a list of user specified target names (using --targets=x,y,z) or None - ''' - if bld.targets == '': - return None - targets = bld.targets.split(',') - for target in targets: - targets += get_deps(bld, target) - return targets -