mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed blacklist
This commit is contained in:
parent
a62fef31d3
commit
1531b7d6dc
9 changed files with 21 additions and 17 deletions
|
@ -35,7 +35,7 @@ class Dependencies:
|
|||
"""
|
||||
def __init__(self, repo):
|
||||
self.repo = repo
|
||||
self.black = BlackList().get_black()
|
||||
self.black = BlackList().get()
|
||||
self.dep_results = []
|
||||
self.meta = _meta_
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ from slpkg.binary.repo_init import RepoInit
|
|||
from slpkg.binary.dependency import Dependencies
|
||||
|
||||
|
||||
class BinaryInstall(BlackList, Utils):
|
||||
class BinaryInstall(Utils):
|
||||
"""Installs binaries packages with all dependencies from
|
||||
repository
|
||||
"""
|
||||
|
@ -83,7 +83,7 @@ class BinaryInstall(BlackList, Utils):
|
|||
for name in self.data[0]:
|
||||
self.repo_pkg_names.append(split_package(name)[0])
|
||||
|
||||
self.blacklist = list(self.get_black())
|
||||
self.blacklist = BlackList().get()
|
||||
self.matching = False
|
||||
|
||||
def init_flags(self):
|
||||
|
|
|
@ -37,7 +37,7 @@ def search_pkg(name, repo):
|
|||
text = utils.read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT")
|
||||
|
||||
PACKAGES_TXT = list(utils.package_name(text))
|
||||
blacklist = list(black.get_black())
|
||||
blacklist = black.get()
|
||||
|
||||
if name in PACKAGES_TXT and name not in blacklist:
|
||||
return name
|
||||
|
|
|
@ -66,13 +66,14 @@ from slpkg.binary.check import pkg_upgrade
|
|||
from slpkg.binary.install import BinaryInstall
|
||||
|
||||
|
||||
class ArgParse(BlackList):
|
||||
class ArgParse:
|
||||
|
||||
def __init__(self, args):
|
||||
super().__init__()
|
||||
self.args = args
|
||||
self.meta = _meta_
|
||||
self.msg = Msg()
|
||||
self.blacklist = BlackList().get()
|
||||
self.commands = [
|
||||
"update",
|
||||
"upgrade",
|
||||
|
@ -584,7 +585,7 @@ class ArgParse(BlackList):
|
|||
elif (len(self.args) == 2 and self.args[0] in options and
|
||||
flag[1] in self.args):
|
||||
self.args.remove(flag[1])
|
||||
self.black_remove(list(self.get_black()))
|
||||
self.black_remove(self.blacklist)
|
||||
|
||||
elif (len(self.args) > 2 and self.args[0] in options and
|
||||
flag[1] in self.args):
|
||||
|
|
|
@ -42,7 +42,7 @@ def sbo_upgrade(skip, flag):
|
|||
msg.checking()
|
||||
upgrade_names = []
|
||||
data = SboQuery(name="").names()
|
||||
blacklist = list(black.get_black())
|
||||
blacklist = black.get()
|
||||
|
||||
for pkg in sbo_list():
|
||||
name = split_package(pkg)[0]
|
||||
|
|
|
@ -48,7 +48,7 @@ from slpkg.sbo.slack_find import slack_package
|
|||
from slpkg.slack.slack_version import slack_ver
|
||||
|
||||
|
||||
class SBoNetwork(BlackList, Utils):
|
||||
class SBoNetwork(Utils):
|
||||
"""View SBo site in the terminal and also read, build or
|
||||
install packages
|
||||
"""
|
||||
|
@ -103,7 +103,7 @@ class SBoNetwork(BlackList, Utils):
|
|||
"""View SlackBuild package, read or install them
|
||||
from slackbuilds.org
|
||||
"""
|
||||
if self.sbo_url and self.name not in self.get_black():
|
||||
if self.sbo_url and self.name not in BlackList().get():
|
||||
self.prgnam = f"{self.name}-{self.sbo_version}"
|
||||
self.view_sbo()
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ from slpkg.sbo.dependencies import Requires
|
|||
from slpkg.sbo.slack_find import slack_package
|
||||
|
||||
|
||||
class SBoInstall(BlackList, Utils):
|
||||
class SBoInstall(Utils):
|
||||
"""Build and install SBo packages with all dependencies
|
||||
"""
|
||||
def __init__(self, slackbuilds, flag):
|
||||
|
@ -80,7 +80,7 @@ class SBoInstall(BlackList, Utils):
|
|||
self.count_uni = 0
|
||||
self.msg.reading()
|
||||
self.data = SboQuery(name="").names()
|
||||
self.blacklist = list(self.get())
|
||||
self.blacklist = BlackList().get()
|
||||
|
||||
def init_flags(self):
|
||||
"""Flags initialization
|
||||
|
|
|
@ -52,7 +52,7 @@ from slpkg.slack.mirrors import mirrors
|
|||
from slpkg.slack.slack_version import slack_ver
|
||||
|
||||
|
||||
class Patches(BlackList, Utils):
|
||||
class Patches(Utils):
|
||||
"""Upgrades distribution from the official Slackware mirrors
|
||||
"""
|
||||
def __init__(self, skip, flag):
|
||||
|
@ -78,6 +78,7 @@ class Patches(BlackList, Utils):
|
|||
self.comp_sum = []
|
||||
self.uncomp_sum = []
|
||||
self.msg.checking()
|
||||
self.blacklist = BlackList().get()
|
||||
|
||||
if self.version == "stable":
|
||||
self.PACKAGES_TXT = URL(mirrors("PACKAGES.TXT",
|
||||
|
@ -153,7 +154,7 @@ class Patches(BlackList, Utils):
|
|||
"""Stores and returns packages for upgrading
|
||||
"""
|
||||
data = repo_data(self.PACKAGES_TXT, "slack", self.flag)
|
||||
black = list(self.get_black())
|
||||
|
||||
for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]):
|
||||
repo_pkg_name = split_package(name)[0]
|
||||
|
||||
|
@ -162,7 +163,7 @@ class Patches(BlackList, Utils):
|
|||
pkg_ver = split_package(name)[1]
|
||||
|
||||
if (GetFromInstalled(pkg_name).name() and
|
||||
repo_pkg_name not in black and
|
||||
repo_pkg_name not in self.blacklist and
|
||||
repo_pkg_name not in self.skip and
|
||||
parse_version(pkg_ver) > parse_version(
|
||||
GetFromInstalled(pkg_name).version())):
|
||||
|
@ -178,7 +179,7 @@ class Patches(BlackList, Utils):
|
|||
self.count_upg -= 1
|
||||
|
||||
elif (not os.path.isfile(self.meta.pkg_path + name[:-4]) and
|
||||
repo_pkg_name not in black and
|
||||
repo_pkg_name not in self.blacklist and
|
||||
repo_pkg_name not in self.skip):
|
||||
self.dwn_links.append(f"{mirrors('', '')}{loc}/{name}")
|
||||
self.comp_sum.append(comp)
|
||||
|
|
|
@ -37,12 +37,13 @@ from slpkg.binary.search import search_pkg
|
|||
from slpkg.binary.dependency import Dependencies
|
||||
|
||||
|
||||
class TrackingDeps(BlackList):
|
||||
class TrackingDeps:
|
||||
"""Views tree of dependencies and also
|
||||
highlights packages with the colour green
|
||||
if already installed and the colour red
|
||||
if not installed.
|
||||
"""
|
||||
|
||||
def __init__(self, name, repo, flag):
|
||||
super().__init__()
|
||||
self.name = name
|
||||
|
@ -57,6 +58,7 @@ class TrackingDeps(BlackList):
|
|||
self.endc = self.meta.color["ENDC"]
|
||||
self.requires = []
|
||||
self.deps_dict = {}
|
||||
self.blacklist = BlackList()
|
||||
self.init_flags()
|
||||
|
||||
def init_flags(self):
|
||||
|
@ -156,7 +158,7 @@ class TrackingDeps(BlackList):
|
|||
self.find_pkg = search_pkg(self.name, self.repo)
|
||||
|
||||
if self.find_pkg:
|
||||
self.black = list(self.get_black())
|
||||
self.black = list(self.blacklist.get())
|
||||
self.dependencies = Dependencies(
|
||||
self.repo, self.black).binary(self.name, self.flag)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue