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