mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Update configs for sbo repository
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
477a9691b8
commit
7061252688
9 changed files with 27 additions and 29 deletions
|
@ -13,9 +13,9 @@ configs:
|
|||
repo_version: 15.0
|
||||
sbo_url: http://slackbuilds.org/slackbuilds/15.0
|
||||
sbo_txt: SLACKBUILDS.TXT
|
||||
tar_suffix: .tar.gz
|
||||
pkg_suffix: .tgz
|
||||
repo_tag: _SBo
|
||||
sbo_tar_suffix: .tar.gz
|
||||
sbo_pkg_suffix: .tgz
|
||||
sbo_repo_tag: _SBo
|
||||
installpkg: upgradepkg --install-new
|
||||
reinstall: upgradepkg --reinstall
|
||||
removepkg: removepkg
|
||||
|
|
|
@ -13,7 +13,7 @@ from slpkg.blacklist import Blacklist
|
|||
class Check:
|
||||
''' Some checks before proceed. '''
|
||||
log_packages: str = Configs.log_packages
|
||||
repo_tag: str = Configs.repo_tag
|
||||
sbo_repo_tag: str = Configs.sbo_repo_tag
|
||||
|
||||
def exists(self, slackbuilds: list):
|
||||
''' Checking if the slackbuild exists in the repository. '''
|
||||
|
@ -42,7 +42,7 @@ class Check:
|
|||
for package in os.listdir(self.log_packages):
|
||||
for sbo in slackbuilds:
|
||||
|
||||
if sbo + '-' in package and self.repo_tag in package:
|
||||
if sbo + '-' in package and self.sbo_repo_tag in package:
|
||||
return
|
||||
|
||||
raise SystemExit('\nNot found installed packages.\n')
|
||||
|
|
|
@ -36,9 +36,9 @@ class Configs:
|
|||
repo_version: str = '15.0'
|
||||
sbo_url: str = f'http://slackbuilds.org/slackbuilds/{repo_version}'
|
||||
sbo_txt: str = 'SLACKBUILDS.TXT'
|
||||
tar_suffix: str = '.tar.gz'
|
||||
pkg_suffix: str = '.tgz'
|
||||
repo_tag: str = '_SBo'
|
||||
sbo_tar_suffix: str = '.tar.gz'
|
||||
sbo_pkg_suffix: str = '.tgz'
|
||||
sbo_repo_tag: str = '_SBo'
|
||||
|
||||
# Slackware commands
|
||||
installpkg: str = 'upgradepkg --install-new'
|
||||
|
@ -83,9 +83,9 @@ class Configs:
|
|||
repo_version: str = config['repo_version']
|
||||
sbo_url: str = config['sbo_url']
|
||||
sbo_txt: str = config['sbo_txt']
|
||||
tar_suffix: str = config['tar_suffix']
|
||||
pkg_suffix: str = config['pkg_suffix']
|
||||
repo_tag: str = config['repo_tag']
|
||||
sbo_tar_suffix: str = config['tar_suffix']
|
||||
sbo_pkg_suffix: str = config['pkg_suffix']
|
||||
sbo_repo_tag: str = config['repo_tag']
|
||||
|
||||
# Slackware commands
|
||||
installpkg: str = config['installpkg']
|
||||
|
|
|
@ -17,7 +17,7 @@ class Download:
|
|||
session: str = Session
|
||||
download_only = Configs.download_only
|
||||
sbo_url: str = Configs.sbo_url
|
||||
tar_suffix: str = Configs.tar_suffix
|
||||
sbo_tar_suffix: str = Configs.sbo_tar_suffix
|
||||
|
||||
def packages(self, slackbuilds: list):
|
||||
|
||||
|
@ -27,7 +27,7 @@ class Download:
|
|||
wget = Wget()
|
||||
|
||||
for sbo in slackbuilds:
|
||||
file = f'{sbo}{self.tar_suffix}'
|
||||
file = f'{sbo}{self.sbo_tar_suffix}'
|
||||
location = SBoQueries(sbo).location()
|
||||
url = f'{self.sbo_url}/{location}/{file}'
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ from slpkg.configs import Configs
|
|||
class FindInstalled:
|
||||
log_packages: str = Configs.log_packages
|
||||
colors: dict = Configs.colour
|
||||
repo_tag: str = Configs.repo_tag
|
||||
sbo_repo_tag: str = Configs.sbo_repo_tag
|
||||
|
||||
def find(self, packages: list):
|
||||
matching = []
|
||||
for pkg in packages:
|
||||
for package in os.listdir(self.log_packages):
|
||||
if pkg in package and self.repo_tag in package:
|
||||
if pkg in package and self.sbo_repo_tag in package:
|
||||
matching.append(package)
|
||||
self.matched(matching)
|
||||
|
||||
|
|
|
@ -32,9 +32,7 @@ class Slackbuilds:
|
|||
build_path: str = Configs.build_path
|
||||
tmp_slpkg: str = Configs.tmp_slpkg
|
||||
tmp_path: str = Configs.tmp_path
|
||||
tar_suffix: str = Configs.tar_suffix
|
||||
repo_tag: str = Configs.repo_tag
|
||||
pkg_suffix: str = Configs.pkg_suffix
|
||||
sbo_tar_suffix: str = Configs.sbo_tar_suffix
|
||||
installpkg: str = Configs.installpkg
|
||||
reinstall: str = Configs.reinstall
|
||||
|
||||
|
@ -98,7 +96,7 @@ class Slackbuilds:
|
|||
wget = Wget()
|
||||
|
||||
for sbo in self.install_order:
|
||||
file = f'{sbo}{self.tar_suffix}'
|
||||
file = f'{sbo}{self.sbo_tar_suffix}'
|
||||
|
||||
self.utils.remove_file_if_exists(self.tmp_slpkg, file)
|
||||
self.utils.remove_folder_if_exists(self.build_path, sbo)
|
||||
|
|
|
@ -12,12 +12,12 @@ from slpkg.queries import SBoQueries
|
|||
@dataclass
|
||||
class Upgrade:
|
||||
log_packages: str = Configs.log_packages
|
||||
repo_tag: str = Configs.repo_tag
|
||||
sbo_repo_tag: str = Configs.sbo_repo_tag
|
||||
|
||||
def packages(self):
|
||||
''' Compares version of packages and returns the maximum. '''
|
||||
for pkg in os.listdir(self.log_packages):
|
||||
if pkg.endswith(self.repo_tag):
|
||||
if pkg.endswith(self.sbo_repo_tag):
|
||||
name = '-'.join(pkg.split('-')[:-3])
|
||||
installed_ver = pkg.replace(name + '-', '').split('-')[0]
|
||||
repo_ver = SBoQueries(name).version()
|
||||
|
|
|
@ -17,7 +17,7 @@ class ViewMessage:
|
|||
flags: list
|
||||
colors: dict = Configs.colour
|
||||
log_packages: str = Configs.log_packages
|
||||
repo_tag: str = Configs.repo_tag
|
||||
sbo_repo_tag: str = Configs.sbo_repo_tag
|
||||
arch: str = Configs.os_arch
|
||||
session: str = Session
|
||||
utils: str = Utilities()
|
||||
|
@ -131,7 +131,7 @@ class ViewMessage:
|
|||
|
||||
for package in installed:
|
||||
black = package.split('-')[0]
|
||||
if (package.startswith(name) and self.repo_tag in package and
|
||||
if (package.startswith(name) and self.sbo_repo_tag in package and
|
||||
black not in self.black.get()):
|
||||
self.installed_packages.append(package)
|
||||
print(f'[{color["RED"]} delete {color["ENDC"]}] -> {package}')
|
||||
|
|
|
@ -7,9 +7,9 @@ class TestConfigs(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.repo_version = Configs.repo_version
|
||||
self.sbo_txt = Configs.sbo_txt
|
||||
self.tar_suffix = Configs.tar_suffix
|
||||
self.pkg_suffix = Configs.pkg_suffix
|
||||
self.repo_tag = Configs.repo_tag
|
||||
self.sbo_tar_suffix = Configs.sbo_tar_suffix
|
||||
self.sbo_pkg_suffix = Configs.sbo_pkg_suffix
|
||||
self.sbo_repo_tag = Configs.sbo_repo_tag
|
||||
self.os_arch = Configs.os_arch
|
||||
|
||||
def test_repo_version(self):
|
||||
|
@ -19,13 +19,13 @@ class TestConfigs(unittest.TestCase):
|
|||
self.assertEqual('SLACKBUILDS.TXT', self.sbo_txt)
|
||||
|
||||
def test_tar_suffix(self):
|
||||
self.assertEqual('.tar.gz', self.tar_suffix)
|
||||
self.assertEqual('.tar.gz', self.sbo_tar_suffix)
|
||||
|
||||
def test_pkg_suffix(self):
|
||||
self.assertEqual('.tgz', self.pkg_suffix)
|
||||
self.assertEqual('.tgz', self.sbo_pkg_suffix)
|
||||
|
||||
def test_repo_tag(self):
|
||||
self.assertEqual('_SBo', self.repo_tag)
|
||||
self.assertEqual('_SBo', self.sbo_repo_tag)
|
||||
|
||||
def test_os_arch(self):
|
||||
self.assertEqual('x86_64', self.os_arch)
|
||||
|
|
Loading…
Reference in a new issue