added config option on/off resolve deps

This commit is contained in:
Dimitris Zlatanidis 2015-06-04 00:40:54 +03:00
parent a46cdc0b50
commit 521d47f45a
5 changed files with 57 additions and 42 deletions

View file

@ -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.

View file

@ -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']

View file

@ -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,6 +43,7 @@ class Dependencies(object):
'''
Build all dependencies of a package
'''
if _m.rsl_deps in ['on', 'ON']:
try:
sys.setrecursionlimit(10000)
dependencies = []
@ -52,7 +54,8 @@ class Dependencies(object):
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):
if (req and req in self.packages and
req not in blacklist):
dependencies.append(req)
if dependencies:
self.dep_results.append(dependencies)
@ -62,3 +65,5 @@ class Dependencies(object):
except KeyboardInterrupt:
print("") # new line at exit
sys.exit(0)
else:
return []

View file

@ -51,6 +51,7 @@ class Config(object):
'DEFAULT_ANSWER',
'REMOVE_DEPS_ANSWER',
'SKIP_UNST',
'RSL_DEPS',
'DEL_DEPS',
'USE_COLORS',
'WGET_OPTIONS',

View file

@ -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,6 +40,7 @@ class Requires(object):
'''
Build all dependencies of a package
'''
if _m.rsl_deps in ['on', 'ON']:
try:
sys.setrecursionlimit(10000)
dependencies = []
@ -61,3 +63,5 @@ class Requires(object):
except KeyboardInterrupt:
print("") # new line at exit
sys.exit(0)
else:
return []