mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-05 08:46:20 +01:00
Improve blacklist
This commit is contained in:
parent
4d2a73f101
commit
1ef8f7bb03
3 changed files with 14 additions and 9 deletions
|
@ -28,11 +28,11 @@ from distutils.version import LooseVersion
|
|||
|
||||
from slpkg.messages import Msg
|
||||
from slpkg.toolbar import status
|
||||
from slpkg.blacklist import BlackList
|
||||
from slpkg.splitting import split_package
|
||||
from slpkg.__metadata__ import MetaData as _meta_
|
||||
|
||||
from greps import SBoGrep
|
||||
from search import sbo_search_pkg
|
||||
|
||||
|
||||
def sbo_upgrade(skip):
|
||||
|
@ -43,12 +43,14 @@ def sbo_upgrade(skip):
|
|||
Msg().checking()
|
||||
upgrade_names = []
|
||||
index, toolbar_width = 0, 3
|
||||
data = SBoGrep(name="").names()
|
||||
blacklist = BlackList().packages(pkgs=data, repo="sbo")
|
||||
for pkg in sbo_list():
|
||||
index += 1
|
||||
toolbar_width = status(index, toolbar_width, 4)
|
||||
name = split_package(pkg)[0]
|
||||
ver = split_package(pkg)[1]
|
||||
if sbo_search_pkg(name) and name not in skip:
|
||||
if (name in data and name not in skip and name not in blacklist):
|
||||
sbo_package = ("{0}-{1}".format(name, SBoGrep(name).version()))
|
||||
package = ("{0}-{1}".format(name, ver))
|
||||
if LooseVersion(sbo_package) > LooseVersion(package):
|
||||
|
|
|
@ -26,12 +26,12 @@ import sys
|
|||
|
||||
from slpkg.utils import Utils
|
||||
from slpkg.repositories import Repo
|
||||
from slpkg.blacklist import BlackList
|
||||
# from slpkg.blacklist import BlackList
|
||||
from slpkg.__metadata__ import MetaData as _meta_
|
||||
|
||||
from slpkg.slack.slack_version import slack_ver
|
||||
|
||||
from greps import SBoGrep
|
||||
# from greps import SBoGrep
|
||||
|
||||
|
||||
def sbo_search_pkg(name):
|
||||
|
@ -40,15 +40,15 @@ def sbo_search_pkg(name):
|
|||
"""
|
||||
try:
|
||||
repo = Repo().sbo()
|
||||
SLACKBUILDS_TXT = SBoGrep(name="").names()
|
||||
blacklist = BlackList().packages(pkgs=SLACKBUILDS_TXT, repo="sbo")
|
||||
# SLACKBUILDS_TXT = SBoGrep(name="").names()
|
||||
# blacklist = BlackList().packages(pkgs=SLACKBUILDS_TXT, repo="sbo")
|
||||
sbo_url = "{0}{1}/".format(repo, slack_ver())
|
||||
SLACKBUILDS_TXT = Utils().read_file(
|
||||
_meta_.lib_path + "sbo_repo/SLACKBUILDS.TXT")
|
||||
for line in SLACKBUILDS_TXT.splitlines():
|
||||
if line.startswith("SLACKBUILD LOCATION"):
|
||||
sbo_name = (line[23:].split("/")[-1].replace("\n", "")).strip()
|
||||
if name == sbo_name and name not in blacklist:
|
||||
if name == sbo_name: # and name not in blacklist:
|
||||
return (sbo_url + line[23:].strip() + "/")
|
||||
return ""
|
||||
except KeyboardInterrupt:
|
||||
|
|
|
@ -27,6 +27,7 @@ import sys
|
|||
import pydoc
|
||||
|
||||
from slpkg.messages import Msg
|
||||
from slpkg.blacklist import BlackList
|
||||
from slpkg.downloader import Download
|
||||
from slpkg.__metadata__ import MetaData as _meta_
|
||||
|
||||
|
@ -49,6 +50,8 @@ class SBoNetwork(object):
|
|||
self.build_folder = self.meta.build_path
|
||||
Msg().reading()
|
||||
grep = SBoGrep(self.name)
|
||||
self.data = SBoGrep(name="").names()
|
||||
self.blacklist = BlackList().packages(pkgs=self.data, repo="sbo")
|
||||
self.sbo_url = sbo_search_pkg(self.name)
|
||||
if self.sbo_url:
|
||||
self.sbo_desc = grep.description()[len(self.name) + 2:-1]
|
||||
|
@ -65,7 +68,7 @@ class SBoNetwork(object):
|
|||
View SlackBuild package, read or install them
|
||||
from slackbuilds.org
|
||||
"""
|
||||
if self.sbo_url:
|
||||
if self.sbo_url and self.name not in self.blacklist:
|
||||
prgnam = ("{0}-{1}".format(self.name, self.sbo_version))
|
||||
self.view_sbo(
|
||||
self.name, self.sbo_url, self.sbo_desc,
|
||||
|
@ -76,7 +79,7 @@ class SBoNetwork(object):
|
|||
while True:
|
||||
choice = self.read_choice()
|
||||
if choice in ["D", "d"]:
|
||||
Download("", self.dwn_srcs, repo="sbo").start()
|
||||
Download(path="", url=self.dwn_srcs, repo="sbo").start()
|
||||
break
|
||||
elif choice in ["R", "r"]:
|
||||
README = Read(self.sbo_url).readme("README")
|
||||
|
|
Loading…
Add table
Reference in a new issue