diff --git a/conf/slpkg.conf b/conf/slpkg.conf index b7fc1e8a..ee824610 100644 --- a/conf/slpkg.conf +++ b/conf/slpkg.conf @@ -66,6 +66,9 @@ REMOVE_DEPS_ANSWER=n # If you want build UNSUPPORTED or UNTESTED packages choose 'y'. SKIP_UNST=n +# If you want to disable resovle dependencies choose 'off'. +RSL_DEPS=on + # Delete package dependencies if DEL_DEPS is on. # You must be careful if you enable this option because it can remove # packages related to distribution. diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index bca1b2cf..7ae7688c 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -122,6 +122,7 @@ class MetaData(object): 'DEFAULT_ANSWER': 'n', 'REMOVE_DEPS_ANSWER': 'n', 'SKIP_UNST': 'n', + 'RSL_DEPS': 'on', 'DEL_DEPS': 'off', 'USE_COLORS': 'on', 'WGET_OPTIONS': '-c -N', @@ -159,6 +160,7 @@ class MetaData(object): default_answer = _conf_slpkg['DEFAULT_ANSWER'] remove_deps_answer = _conf_slpkg['REMOVE_DEPS_ANSWER'] skip_unst = _conf_slpkg['SKIP_UNST'] + rsl_deps = _conf_slpkg['RSL_DEPS'] del_deps = _conf_slpkg['DEL_DEPS'] use_colors = _conf_slpkg['USE_COLORS'] wget_options = _conf_slpkg['WGET_OPTIONS'] diff --git a/slpkg/binary/dependency.py b/slpkg/binary/dependency.py index 497a80fa..7b8b3508 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binary/dependency.py @@ -27,6 +27,7 @@ import sys from slpkg.utils import Utils from slpkg.toolbar import status from slpkg.blacklist import BlackList +from slpkg.__metadata__ import MetaData as _m from greps import Requires @@ -42,23 +43,27 @@ class Dependencies(object): ''' Build all dependencies of a package ''' - try: - sys.setrecursionlimit(10000) - dependencies = [] - blacklist = BlackList().packages() - requires = Requires(name, self.repo).get_deps() - toolbar_width, index = 2, 0 - if requires: - for req in requires: - index += 1 - toolbar_width = status(index, toolbar_width, 7) - if (req and req in self.packages and req not in blacklist): - dependencies.append(req) - if dependencies: - self.dep_results.append(dependencies) - for dep in dependencies: - self.binary(dep) - return self.dep_results - except KeyboardInterrupt: - print("") # new line at exit - sys.exit(0) + if _m.rsl_deps in ['on', 'ON']: + try: + sys.setrecursionlimit(10000) + dependencies = [] + blacklist = BlackList().packages() + requires = Requires(name, self.repo).get_deps() + toolbar_width, index = 2, 0 + if requires: + for req in requires: + index += 1 + toolbar_width = status(index, toolbar_width, 7) + if (req and req in self.packages and + req not in blacklist): + dependencies.append(req) + if dependencies: + self.dep_results.append(dependencies) + for dep in dependencies: + self.binary(dep) + return self.dep_results + except KeyboardInterrupt: + print("") # new line at exit + sys.exit(0) + else: + return [] diff --git a/slpkg/config.py b/slpkg/config.py index aa68e9ed..25d77355 100644 --- a/slpkg/config.py +++ b/slpkg/config.py @@ -51,6 +51,7 @@ class Config(object): 'DEFAULT_ANSWER', 'REMOVE_DEPS_ANSWER', 'SKIP_UNST', + 'RSL_DEPS', 'DEL_DEPS', 'USE_COLORS', 'WGET_OPTIONS', diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index 62bbaea8..011ea638 100644 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -26,6 +26,7 @@ import sys from slpkg.toolbar import status from slpkg.blacklist import BlackList +from slpkg.__metadata__ import MetaData as _m from greps import SBoGrep @@ -39,25 +40,28 @@ class Requires(object): ''' Build all dependencies of a package ''' - try: - sys.setrecursionlimit(10000) - dependencies = [] - blacklist = BlackList().packages() - requires = SBoGrep(name).requires() - toolbar_width, index = 2, 0 - if requires: - for req in requires: - index += 1 - toolbar_width = status(index, toolbar_width, 1) - # avoid to add %README% as dependency and - # if require in blacklist - if "%README%" not in req and req not in blacklist: - dependencies.append(req) - if dependencies: - self.dep_results.append(dependencies) - for dep in dependencies: - self.sbo(dep) - return self.dep_results - except KeyboardInterrupt: - print("") # new line at exit - sys.exit(0) + if _m.rsl_deps in ['on', 'ON']: + try: + sys.setrecursionlimit(10000) + dependencies = [] + blacklist = BlackList().packages() + requires = SBoGrep(name).requires() + toolbar_width, index = 2, 0 + if requires: + for req in requires: + index += 1 + toolbar_width = status(index, toolbar_width, 1) + # avoid to add %README% as dependency and + # if require in blacklist + if "%README%" not in req and req not in blacklist: + dependencies.append(req) + if dependencies: + self.dep_results.append(dependencies) + for dep in dependencies: + self.sbo(dep) + return self.dep_results + except KeyboardInterrupt: + print("") # new line at exit + sys.exit(0) + else: + return []