mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
fix dependencies
This commit is contained in:
parent
57b62e07a4
commit
ff9583ef0e
4 changed files with 45 additions and 43 deletions
|
@ -48,7 +48,7 @@ from greps import SBoGrep
|
||||||
from remove import delete
|
from remove import delete
|
||||||
from compressed import SBoLink
|
from compressed import SBoLink
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from dependency import sbo_dependencies_pkg
|
from dependency import Requires
|
||||||
|
|
||||||
|
|
||||||
class SBoCheck(object):
|
class SBoCheck(object):
|
||||||
|
@ -175,7 +175,7 @@ def deps(upgrade_names):
|
||||||
file .info.
|
file .info.
|
||||||
'''
|
'''
|
||||||
for upg in upgrade_names:
|
for upg in upgrade_names:
|
||||||
dependencies = sbo_dependencies_pkg(upg)
|
dependencies = Requires().sbo(upg)
|
||||||
return dependencies
|
return dependencies
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,31 +28,34 @@ from slpkg.blacklist import BlackList
|
||||||
|
|
||||||
from greps import SBoGrep
|
from greps import SBoGrep
|
||||||
|
|
||||||
dep_results = []
|
|
||||||
|
|
||||||
|
class Requires(object):
|
||||||
|
|
||||||
def sbo_dependencies_pkg(name):
|
def __init__(self):
|
||||||
'''
|
self.dep_results = []
|
||||||
Build all dependencies of a package
|
|
||||||
'''
|
def sbo(self, name):
|
||||||
try:
|
'''
|
||||||
dependencies = []
|
Build all dependencies of a package
|
||||||
blacklist = BlackList().packages()
|
'''
|
||||||
requires = SBoGrep(name).requires()
|
try:
|
||||||
toolbar_width, index = 2, 0
|
dependencies = []
|
||||||
if requires:
|
blacklist = BlackList().packages()
|
||||||
for req in requires:
|
requires = SBoGrep(name).requires()
|
||||||
index += 1
|
toolbar_width, index = 2, 0
|
||||||
toolbar_width = status(index, toolbar_width, 1)
|
if requires:
|
||||||
# avoid to add %README% as dependency and
|
for req in requires:
|
||||||
# if require in blacklist
|
index += 1
|
||||||
if "%README%" not in req and req not in blacklist:
|
toolbar_width = status(index, toolbar_width, 1)
|
||||||
dependencies.append(req)
|
# avoid to add %README% as dependency and
|
||||||
if dependencies:
|
# if require in blacklist
|
||||||
dep_results.append(dependencies)
|
if "%README%" not in req and req not in blacklist:
|
||||||
for dep in dependencies:
|
dependencies.append(req)
|
||||||
sbo_dependencies_pkg(dep)
|
if dependencies:
|
||||||
return dep_results
|
self.dep_results.append(dependencies)
|
||||||
except KeyboardInterrupt:
|
for dep in dependencies:
|
||||||
print("") # new line at exit
|
self.sbo(dep)
|
||||||
sys.exit(0)
|
return self.dep_results
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("") # new line at exit
|
||||||
|
sys.exit(0)
|
||||||
|
|
|
@ -24,8 +24,15 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from downloader import Download
|
from slpkg.downloader import Download
|
||||||
from slpkg.toolbar import status
|
from slpkg.toolbar import status
|
||||||
|
from slpkg.splitting import split_package
|
||||||
|
from slpkg.messages import (
|
||||||
|
template,
|
||||||
|
pkg_found,
|
||||||
|
build_FAILED
|
||||||
|
)
|
||||||
|
|
||||||
from slpkg.__metadata__ import (
|
from slpkg.__metadata__ import (
|
||||||
tmp,
|
tmp,
|
||||||
color,
|
color,
|
||||||
|
@ -43,13 +50,7 @@ from greps import SBoGrep
|
||||||
from remove import delete
|
from remove import delete
|
||||||
from compressed import SBoLink
|
from compressed import SBoLink
|
||||||
from search import sbo_search_pkg
|
from search import sbo_search_pkg
|
||||||
from splitting import split_package
|
from dependency import Requires
|
||||||
from dependency import sbo_dependencies_pkg
|
|
||||||
from messages import (
|
|
||||||
template,
|
|
||||||
pkg_found,
|
|
||||||
build_FAILED
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class SBoInstall(object):
|
class SBoInstall(object):
|
||||||
|
@ -69,8 +70,7 @@ class SBoInstall(object):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.slackbuilds = ['brasero', 'pysed', 'Flask']
|
self.slackbuilds = ['Flask', 'pip']
|
||||||
|
|
||||||
dependencies, tagc = [], ''
|
dependencies, tagc = [], ''
|
||||||
count_ins = count_upg = count_uni = 0
|
count_ins = count_upg = count_uni = 0
|
||||||
for sbo in self.slackbuilds:
|
for sbo in self.slackbuilds:
|
||||||
|
@ -78,7 +78,7 @@ class SBoInstall(object):
|
||||||
self.index += 1
|
self.index += 1
|
||||||
self.toolbar_width = status(self.index, self.toolbar_width, 4)
|
self.toolbar_width = status(self.index, self.toolbar_width, 4)
|
||||||
if sbo_search_pkg(sbo):
|
if sbo_search_pkg(sbo):
|
||||||
sbo_deps = sbo_dependencies_pkg(sbo)
|
sbo_deps = Requires().sbo(sbo)
|
||||||
self.deps += sbo_deps
|
self.deps += sbo_deps
|
||||||
self.deps_dict[sbo] = self.one_for_all(sbo_deps)
|
self.deps_dict[sbo] = self.one_for_all(sbo_deps)
|
||||||
self.package_found.append(sbo)
|
self.package_found.append(sbo)
|
||||||
|
@ -345,8 +345,7 @@ class SBoInstall(object):
|
||||||
Write dependencies in a log file
|
Write dependencies in a log file
|
||||||
into directory `/var/log/slpkg/dep/`
|
into directory `/var/log/slpkg/dep/`
|
||||||
'''
|
'''
|
||||||
for name in self.master_packages:
|
for name, dependencies in self.deps_dict.iteritems():
|
||||||
dependencies = sbo_dependencies_pkg('-'.join(name.split('-')[:-1]))
|
|
||||||
if find_package(name + '-', pkg_path):
|
if find_package(name + '-', pkg_path):
|
||||||
dep_path = log_path + "dep/"
|
dep_path = log_path + "dep/"
|
||||||
if not os.path.exists(dep_path):
|
if not os.path.exists(dep_path):
|
||||||
|
|
|
@ -35,7 +35,7 @@ from __metadata__ import (
|
||||||
from pkg.find import find_package
|
from pkg.find import find_package
|
||||||
|
|
||||||
from sbo.search import sbo_search_pkg
|
from sbo.search import sbo_search_pkg
|
||||||
from sbo.dependency import sbo_dependencies_pkg
|
from sbo.dependency import Requires
|
||||||
|
|
||||||
from others.search import search_pkg
|
from others.search import search_pkg
|
||||||
from others.dependency import dependencies_pkg
|
from others.dependency import dependencies_pkg
|
||||||
|
@ -52,7 +52,7 @@ def track_dep(name, repo):
|
||||||
color['ENDC']))
|
color['ENDC']))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if repo == "sbo":
|
if repo == "sbo":
|
||||||
dependencies_list = sbo_dependencies_pkg(name)
|
dependencies_list = Requires().sbo(name)
|
||||||
find_pkg = sbo_search_pkg(name)
|
find_pkg = sbo_search_pkg(name)
|
||||||
else:
|
else:
|
||||||
dependencies_list = dependencies_pkg(name, repo)
|
dependencies_list = dependencies_pkg(name, repo)
|
||||||
|
|
Loading…
Reference in a new issue