mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-26 09:58:31 +01:00
Added to support custom repos
This commit is contained in:
parent
fd69e18685
commit
6e1bc0c921
3 changed files with 35 additions and 16 deletions
|
@ -4,6 +4,9 @@
|
|||
- Update:
|
||||
* Updated to read configuration values even they are lower or uppercase
|
||||
|
||||
- Added:
|
||||
* Added to support custom repositories
|
||||
|
||||
### 5.0.5 - 12/04/2024
|
||||
- Added:
|
||||
* Added maximum parallel for downloading in the config file
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# This is the general repositories configuration file of slpkg:
|
||||
# /etc/slpkg/repositories.toml
|
||||
# Updated: 12/04/2024, Version: 5.0.5
|
||||
# Updated: 15/04/2024, Version: 5.0.5
|
||||
|
||||
# Set 'true' or 'false' to enable or disable the repository you want.
|
||||
|
||||
|
@ -9,6 +9,20 @@
|
|||
# if it is necessary. The mirror or every part of the mirror
|
||||
# should end with a slash '/'.
|
||||
|
||||
# Template to define a binary custom repository. [NAME], ENABLE,
|
||||
# MIRROR and TAG options are required as a minimum. MIRROR should
|
||||
# include ChangeLog.txt, PACKAGES.TXT and CHECKSUMS.md5 files.
|
||||
# If the files PACKAGES.TXT and CHECKSUMS.md5 are located in
|
||||
# a different branch with the ChangeLog.txt file, it should be
|
||||
# set a variable BRANCH.
|
||||
|
||||
# Example:
|
||||
# [NAME]
|
||||
# ENABLE = true
|
||||
# MIRROR = "http://mirror.nl.leaseweb.net/slackware/slackware64-15.0/"
|
||||
# BRANCH = "extra"
|
||||
# TAG = ""
|
||||
|
||||
# This is the DEFAULT REPOSITORY.
|
||||
# You can change it with one that you see below.
|
||||
# Make sure you have enabled it before.
|
||||
|
|
|
@ -447,30 +447,32 @@ class Repositories:
|
|||
'repo_tag': pprkut_repo_tag}
|
||||
}
|
||||
|
||||
defaults = list(repositories.keys())
|
||||
customs = list(repos_config.keys())
|
||||
all_repos = list(repos_config.keys())
|
||||
defaults_repos = list(repositories.keys())
|
||||
|
||||
diff_repos = list(set(customs) - set(defaults))
|
||||
diff_repos = list(set(all_repos) - set(defaults_repos))
|
||||
diff_repos.remove('default')
|
||||
|
||||
if diff_repos:
|
||||
for repo, config in repos_config.items():
|
||||
for repo, data in repos_config.items():
|
||||
|
||||
if repo in diff_repos:
|
||||
changelog_mirror: str = config['mirror']
|
||||
|
||||
if config['branch']:
|
||||
changelog_mirror: str = config['branch']
|
||||
mirror_packages: str = data.get('mirror', '')
|
||||
mirror_changelog: str = data.get('mirror', '')
|
||||
if data.get('branch'):
|
||||
mirror_changelog: str = data.get('mirror', '')
|
||||
branch: str = data.get('branch', '')
|
||||
mirror_packages: str = f'{mirror_changelog}{branch}/'
|
||||
|
||||
values = {
|
||||
'enable': config['enable'],
|
||||
'enable': data.get('enable', ''),
|
||||
'path': Path(repositories_path, repo),
|
||||
'mirror_packages': config['mirror'],
|
||||
'mirror_changelog': changelog_mirror,
|
||||
'packages_txt': 'PACKAGES.TXT',
|
||||
'checksums_md5': 'CHECKSUMS.md5',
|
||||
'changelog_txt': 'ChangeLog.txt',
|
||||
'repo_tag': config['tag']
|
||||
'mirror_packages': mirror_packages,
|
||||
'mirror_changelog': mirror_changelog,
|
||||
'packages_txt': packages_txt,
|
||||
'checksums_md5': checksums_md5,
|
||||
'changelog_txt': changelog_txt,
|
||||
'repo_tag': data.get('tag', '')
|
||||
}
|
||||
|
||||
repositories[repo] = values
|
||||
|
|
Loading…
Reference in a new issue