mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
added config option on/off resolve deps
This commit is contained in:
parent
a46cdc0b50
commit
521d47f45a
5 changed files with 57 additions and 42 deletions
|
@ -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.
|
||||
|
|
|
@ -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']
|
||||
|
|
|
@ -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 []
|
||||
|
|
|
@ -51,6 +51,7 @@ class Config(object):
|
|||
'DEFAULT_ANSWER',
|
||||
'REMOVE_DEPS_ANSWER',
|
||||
'SKIP_UNST',
|
||||
'RSL_DEPS',
|
||||
'DEL_DEPS',
|
||||
'USE_COLORS',
|
||||
'WGET_OPTIONS',
|
||||
|
|
|
@ -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 []
|
||||
|
|
Loading…
Reference in a new issue