mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-05 08:46:20 +01:00
Updated for build tag
This commit is contained in:
parent
0878fe38fd
commit
3fdaa9f745
5 changed files with 13 additions and 6 deletions
|
@ -465,7 +465,9 @@ class Argparse(Configs):
|
|||
else:
|
||||
repo_ver: str = self.data[package][2]
|
||||
repo_location: str = self.data[package][0]
|
||||
repo_build_tag: str = self.utils.read_sbo_build_tag(package, repo_location)
|
||||
repo_build_tag: str = self.utils.read_slackbuild_build_tag(
|
||||
package, repo_location, self.repository
|
||||
)
|
||||
|
||||
choices.extend([(package, f'{split_inst_pkg[1]} -> {repo_ver}', True,
|
||||
f'Installed: {package}-{split_inst_pkg[1]} Build: {split_inst_pkg[3]} -> '
|
||||
|
|
|
@ -57,7 +57,9 @@ class Upgrade(Configs):
|
|||
else:
|
||||
repo_version: str = self.data[name][2]
|
||||
repo_location: str = self.data[name][0]
|
||||
repo_build: str = self.utils.read_sbo_build_tag(name, repo_location)
|
||||
repo_build: str = self.utils.read_slackbuild_build_tag(
|
||||
name, repo_location, self.repository
|
||||
)
|
||||
|
||||
repo_pkg: str = f'{name}-{repo_version}'
|
||||
inst_pkg: str = f'{name}-{inst_version}'
|
||||
|
|
|
@ -20,6 +20,8 @@ from slpkg.logging_config import LoggingConfig
|
|||
class Utilities(Configs):
|
||||
|
||||
def __init__(self):
|
||||
super(Configs, self).__init__()
|
||||
|
||||
self.black = Blacklist()
|
||||
self.errors = Errors()
|
||||
self.repos = Repositories()
|
||||
|
@ -83,11 +85,12 @@ class Utilities(Configs):
|
|||
time.strftime(f'{self.cyan}%H:%M:%S{self.endc}',
|
||||
time.gmtime(elapsed_time)))
|
||||
|
||||
def read_sbo_build_tag(self, sbo: str, location: str) -> str:
|
||||
def read_slackbuild_build_tag(self, sbo: str, location: str, repository: str) -> str:
|
||||
""" Returns build tag from .SlackBuild file. """
|
||||
build: str = ''
|
||||
|
||||
sbo_script = Path(self.repos.sbo_repo_path, location, sbo, f'{sbo}.SlackBuild')
|
||||
sbo_script = Path(self.repos.repositories[repository][1], location, sbo, f'{sbo}.SlackBuild')
|
||||
# sbo_script = Path(self.repos.sbo_repo_path, location, sbo, f'{sbo}.SlackBuild')
|
||||
|
||||
if sbo_script.is_file():
|
||||
lines = self.read_file(sbo_script)
|
||||
|
|
|
@ -49,7 +49,7 @@ class ViewPackage(Configs):
|
|||
path = Path(self.repos.repositories[self.repository][1], location, name, f'{name}.info')
|
||||
info_file = self.utils.read_file(path)
|
||||
|
||||
repo_build_tag = self.utils.read_sbo_build_tag(name, location, self.repository)
|
||||
repo_build_tag = self.utils.read_slackbuild_build_tag(name, location, self.repository)
|
||||
mirror: str = self.repos.repositories[self.repository][2][0]
|
||||
|
||||
maintainer, email, homepage = '', '', ''
|
||||
|
|
|
@ -37,7 +37,7 @@ class TestUtilities(unittest.TestCase):
|
|||
self.assertIn(self.package, self.utils.installed_packages.values())
|
||||
|
||||
def test_read_build_tag(self):
|
||||
self.assertEqual('1', self.utils.read_sbo_build_tag('slpkg', 'system'))
|
||||
self.assertEqual('1', self.utils.read_slackbuild_build_tag('slpkg', 'system'))
|
||||
|
||||
def test_is_option(self):
|
||||
self.assertTrue(True, self.utils.is_option(['-P', '--parallel'],
|
||||
|
|
Loading…
Add table
Reference in a new issue