updated search dependencies from local

This commit is contained in:
Dimitris Zlatanidis 2014-09-22 00:04:41 +03:00
parent d9b990ebff
commit a95d295ca0
3 changed files with 12 additions and 10 deletions

View file

@ -43,7 +43,7 @@ def sbo_dependencies_pkg(name):
dependencies = []
sbo_url = sbo_search_pkg(name)
if sbo_url:
requires = sbo_requires_pkg(sbo_url, name)
requires = sbo_requires_pkg(name)
for req in requires:
# avoid to add %README% as dependency
if "%README%" not in req:

View file

@ -47,14 +47,16 @@ def sbo_source_dwn(name):
if sbo_name == name:
return line[21:].strip()
def sbo_requires_pkg(sbo_url, name):
'''
Grab package requirements
'''
read_info = url_read(sbo_url + name + ".info")
for line in read_info.splitlines():
if line.startswith("REQUIRES=\""):
return line[10:-1].strip().split()
def sbo_requires_pkg(name):
'''
Grab package requirements
'''
for line in open(lib_path + "sbo_repo/SLACKBUILDS.TXT", "r"):
if line.startswith("SLACKBUILD NAME: "):
sbo_name = line[17:].strip()
if line.startswith("SLACKBUILD REQUIRES: "):
if sbo_name == name:
return line[21:].strip().split()
def sbo_build_tag(sbo_url, name):
# This feature is not yet used

View file

@ -52,7 +52,7 @@ def sbo_network(name):
initialization()
sbo_url = sbo_search_pkg(name)
if sbo_url:
sbo_req = sbo_requires_pkg(sbo_url, name)
sbo_req = sbo_requires_pkg(name)
sbo_dwn = sbo_slackbuild_dwn(sbo_url)
source_dwn = sbo_source_dwn(name).split()
sys.stdout.write("{0}Done{1}\n".format(colors.GREY, colors.ENDC))