mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Fixed for patch repo tag
This commit is contained in:
parent
d3e9379589
commit
78fc810726
4 changed files with 24 additions and 11 deletions
|
@ -3,6 +3,7 @@ Updated:
|
|||
- Packaging parse versions
|
||||
Fixed:
|
||||
- Upgrade dependencies without -r option
|
||||
- Patch slackbuild repo tag
|
||||
|
||||
4.7.1 - 02/04/2023
|
||||
Fixed:
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
SBO_REPO_SLACKBUILDS = "SLACKBUILDS.TXT"
|
||||
SBO_REPO_CHANGELOG = "ChangeLog.txt"
|
||||
SBO_REPO_TAR_SUFFIX = ".tar.gz"
|
||||
SBO_REPO_TAG = "_SBo"
|
||||
SBO_REPO_TAG = "_SBo" # Deafult repo TAG.
|
||||
SBO_REPO_PATCH_TAG = "" # Patch the TAG.
|
||||
|
||||
# Repository for Slackware -current.
|
||||
PONCE_REPO = false
|
||||
|
@ -29,7 +30,8 @@
|
|||
PONCE_REPO_MIRROR = "https://cgit.ponce.cc/slackbuilds/plain/"
|
||||
PONCE_REPO_SLACKBUILDS = "SLACKBUILDS.TXT"
|
||||
PONCE_REPO_CHANGELOG = "ChangeLog.txt"
|
||||
PONCE_REPO_TAG = "_SBo"
|
||||
PONCE_REPO_TAG = "_SBo" # Deafult repo TAG.
|
||||
PONCE_REPO_PATCH_TAG = "" # Patch the TAG.
|
||||
|
||||
# Official repository for Slackware x86_64 15.0 stable.
|
||||
# For Slackware x86_64 -current:
|
||||
|
|
|
@ -34,6 +34,7 @@ class Repositories:
|
|||
sbo_repo_changelog: str = 'ChangeLog.txt'
|
||||
sbo_repo_tar_suffix: str = '.tar.gz'
|
||||
sbo_repo_tag: str = '_SBo'
|
||||
sbo_repo_patch_tag: str = ''
|
||||
|
||||
ponce_repo: bool = False
|
||||
ponce_repo_name: str = 'ponce'
|
||||
|
@ -42,6 +43,7 @@ class Repositories:
|
|||
ponce_repo_slackbuilds: str = 'SLACKBUILDS.TXT'
|
||||
ponce_repo_changelog: str = 'ChangeLog.txt'
|
||||
ponce_repo_tag: str = '_SBo'
|
||||
ponce_repo_patch_tag: str = ''
|
||||
|
||||
slack_repo: bool = False
|
||||
slack_repo_name: str = 'slack'
|
||||
|
@ -180,12 +182,6 @@ class Repositories:
|
|||
slint_repo_checksums: str = 'CHECKSUMS.md5'
|
||||
slint_repo_changelog: str = 'ChangeLog.txt'
|
||||
|
||||
# Default repository tag.
|
||||
repo_tag: str = sbo_repo_tag
|
||||
|
||||
# The default enabled sbo repository.
|
||||
sbo_enabled_repository: str = sbo_repo_name
|
||||
|
||||
try:
|
||||
if repositories_file_toml.is_file():
|
||||
with open(repositories_file_toml, 'rb') as repo:
|
||||
|
@ -197,6 +193,7 @@ class Repositories:
|
|||
sbo_repo_changelog: str = repos_config['SBO_REPO_CHANGELOG']
|
||||
sbo_repo_tar_suffix: str = repos_config['SBO_REPO_TAR_SUFFIX']
|
||||
sbo_repo_tag: str = repos_config['SBO_REPO_TAG']
|
||||
sbo_repo_patch_tag: str = repos_config['SBO_REPO_PATCH_TAG']
|
||||
|
||||
ponce_repo: bool = repos_config['PONCE_REPO']
|
||||
ponce_repo_name: str = repos_config['PONCE_REPO_NAME']
|
||||
|
@ -204,6 +201,7 @@ class Repositories:
|
|||
ponce_repo_slackbuilds: str = repos_config['PONCE_REPO_SLACKBUILDS']
|
||||
ponce_repo_changelog: str = repos_config['PONCE_REPO_CHANGELOG']
|
||||
ponce_repo_tag: str = repos_config['PONCE_REPO_TAG']
|
||||
ponce_repo_patch_tag: str = repos_config['PONCE_REPO_PATCH_TAG']
|
||||
|
||||
slack_repo: bool = repos_config['SLACK_REPO']
|
||||
slack_repo_name: str = repos_config['SLACK_REPO_NAME']
|
||||
|
@ -333,10 +331,14 @@ class Repositories:
|
|||
f"'mv {repositories_file_toml}.new {repositories_file_toml}'.\n"
|
||||
f"or '{cyan}slpkg_new-configs{endc}' command.\n")
|
||||
|
||||
# Switch to ponce repository if is true.
|
||||
# Default sbo repository configs.
|
||||
repo_tag: str = sbo_repo_tag
|
||||
patch_repo_tag: str = sbo_repo_patch_tag
|
||||
sbo_enabled_repository: str = sbo_repo_name
|
||||
if ponce_repo:
|
||||
sbo_enabled_repository: str = ponce_repo_name
|
||||
repo_tag: str = ponce_repo_tag
|
||||
patch_repo_tag: str = ponce_repo_patch_tag
|
||||
sbo_enabled_repo: bool = False
|
||||
|
||||
# List of repositories.
|
||||
|
|
|
@ -64,6 +64,10 @@ class Slackbuilds(Configs):
|
|||
|
||||
self.slackbuilds: list = self.utils.apply_package_pattern(self.flags, self.slackbuilds)
|
||||
|
||||
# Patch the TAG from configs.
|
||||
if self.repos.patch_repo_tag:
|
||||
self.repos.repo_tag = self.repos.patch_repo_tag
|
||||
|
||||
def execute(self) -> None:
|
||||
""" Starting build or install the slackbuilds. """
|
||||
self.creating_dictionary()
|
||||
|
@ -208,6 +212,9 @@ class Slackbuilds(Configs):
|
|||
for sbo in self.install_order:
|
||||
|
||||
if self.continue_build_or_install(sbo):
|
||||
|
||||
self.patch_sbo_tag(sbo)
|
||||
|
||||
self.build_the_script(self.build_path, sbo)
|
||||
|
||||
if self.mode in ['install', 'upgrade']:
|
||||
|
@ -226,14 +233,15 @@ class Slackbuilds(Configs):
|
|||
""" Patching SBo TAG from the configuration file. """
|
||||
sbo_script = Path(self.build_path, sbo, f'{sbo}.SlackBuild')
|
||||
|
||||
if sbo_script.is_file():
|
||||
if sbo_script.is_file() and self.repos.patch_repo_tag:
|
||||
|
||||
with open(sbo_script, 'r', encoding='utf-8') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
with open(sbo_script, 'w') as script:
|
||||
for line in lines:
|
||||
if line.startswith('TAG=$'):
|
||||
line: str = f'TAG=${{TAG:-{self.repos.repo_tag}}}\n'
|
||||
line: str = f'TAG=${{TAG:-{self.repos.patch_repo_tag}}}\n'
|
||||
script.write(line)
|
||||
|
||||
def logging_installed_dependencies(self, name: str) -> None:
|
||||
|
|
Loading…
Reference in a new issue