mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-06-28 03:05:36 -04:00
Unbreak some of the things!
Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
parent
f6678181b8
commit
dad46d3655
1 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ def resolve_url(url_template, repo_name: str, arch: str):
|
||||||
result = url_template
|
result = url_template
|
||||||
for template, replacement in {'$repo': repo_name, '$arch': config.runtime['arch']}.items():
|
for template, replacement in {'$repo': repo_name, '$arch': config.runtime['arch']}.items():
|
||||||
result = result.replace(template, replacement)
|
result = result.replace(template, replacement)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
class PackageInfo:
|
class PackageInfo:
|
||||||
|
@ -60,8 +61,8 @@ class Repo(RepoInfo):
|
||||||
self.scan()
|
self.scan()
|
||||||
|
|
||||||
def config_snippet(self) -> str:
|
def config_snippet(self) -> str:
|
||||||
options = {'Server': self.url_template} | self.options.items()
|
options = {'Server': self.url_template} | self.options
|
||||||
return ('[%s]\n' % self.name) + '\n'.join([f"{key} = {value}" for key, value in options])
|
return ('[%s]\n' % self.name) + '\n'.join([f"{key} = {value}" for key, value in options.items()])
|
||||||
|
|
||||||
def get_RepoInfo(self):
|
def get_RepoInfo(self):
|
||||||
return RepoInfo(url_template=self.url_template, options=self.options)
|
return RepoInfo(url_template=self.url_template, options=self.options)
|
||||||
|
@ -93,8 +94,8 @@ class Distro:
|
||||||
results[package.name] = package
|
results[package.name] = package
|
||||||
|
|
||||||
def _repos_config_snippet(self, extra_repos: dict[str, RepoInfo] = {}) -> str:
|
def _repos_config_snippet(self, extra_repos: dict[str, RepoInfo] = {}) -> str:
|
||||||
extras = [Repo(name, url_template=info.url_template, options=info.options, scan=False) for name, info in extra_repos.items()]
|
extras = [Repo(name, url_template=info.url_template, arch=self.arch, options=info.options, scan=False) for name, info in extra_repos.items()]
|
||||||
return '\n'.join(repo.config_snippet() for repo in (self.repos.values + extras))
|
return '\n'.join(repo.config_snippet() for repo in (list(self.repos.values()) + extras))
|
||||||
|
|
||||||
def get_pacman_conf(self, extra_repos: dict[str, RepoInfo] = []):
|
def get_pacman_conf(self, extra_repos: dict[str, RepoInfo] = []):
|
||||||
header = f'''
|
header = f'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue