Updated for repo name

This commit is contained in:
Dimitris Zlatanidis 2023-04-18 16:37:30 +03:00
parent 0aba34bbbb
commit 2d9f67a2df
5 changed files with 18 additions and 14 deletions

View file

@ -23,7 +23,7 @@ class Required:
self.repos.slint_repo_name
]
self.repo = self.utils.get_the_repo_name(self.data)
self.repo = self.utils.repository_name(self.data)
def resolve(self) -> list:
""" Resolve the dependencies. """

View file

@ -1,6 +1,7 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import shutil
from typing import Union
from pathlib import Path
from urllib.parse import unquote
@ -45,17 +46,20 @@ class Downloader(Configs):
command: str = ''
filename: str = url.split('/')[-1]
if self.downloader in ['wget', 'wget2']:
command: str = f'{self.downloader} {self.wget_options} --directory-prefix={self.path} "{url}"'
elif self.downloader == 'curl':
command: str = f'{self.downloader} {self.curl_options} "{url}" --output {self.path}/{filename}'
elif self.downloader == 'lftp':
command: str = f'{self.downloader} {self.lftp_get_options} {url} -o {self.path}'
if url.startswith('file'):
shutil.copy2(url[7:], self.tmp_slpkg)
else:
self.utils.raise_error_message(f"Downloader '{self.downloader}' not supported")
if self.downloader in ['wget', 'wget2']:
command: str = f'{self.downloader} {self.wget_options} --directory-prefix={self.path} "{url}"'
elif self.downloader == 'curl':
command: str = f'{self.downloader} {self.curl_options} "{url}" --output {self.path}/{filename}'
elif self.downloader == 'lftp':
command: str = f'{self.downloader} {self.lftp_get_options} {url} -o {self.path}'
else:
self.utils.raise_error_message(f"Downloader '{self.downloader}' not supported")
self.utils.process(command)
self.check_if_downloaded(url)

View file

@ -25,7 +25,7 @@ class Upgrade(Configs):
self.option_for_binaries: bool = self.utils.is_option(
['-B', '--bin-repo='], self.flags)
self.repo: str = self.utils.get_the_repo_name(self.data)
self.repo: str = self.utils.repository_name(self.data)
logging.basicConfig(filename=str(LoggingConfig.log_file),
filemode='w',

View file

@ -193,7 +193,7 @@ class Utilities:
if [black for black in self.black.packages() if fnmatch.fnmatch(name, black)]:
return True
def get_the_repo_name(self, data):
def repository_name(self, data):
""" Get the binary repository name from the repository data. """
try:
# Binary repository name

View file

@ -53,7 +53,7 @@ class ViewMessage(Configs):
self.option_for_binaries: bool = self.utils.is_option(
['-B', '--bin-repo='], self.flags)
self.repo: str = self.utils.get_the_repo_name(self.data)
self.repo: str = self.utils.repository_name(self.data)
def view_packages(self, package: str, mode: str) -> None:
""" Printing the main packages. """