Updates
This fixes the repo being hardcoded to baseos Adds sorting Adds additional error catching
This commit is contained in:
@@ -15,6 +15,8 @@ from jinja2 import Environment, FileSystemLoader
|
||||
sitemap = {}
|
||||
|
||||
class Package:
|
||||
def __lt__(self, other):
|
||||
return self.name < other.name
|
||||
def __init__(self, name: str, repo_type: str, chksum: str, location: str, baseurl: str, license: str, download_path: Path = None, extract_dir: Path = None):
|
||||
self.name = name
|
||||
self.repo_type = repo_type
|
||||
@@ -185,7 +187,7 @@ class RepoManager:
|
||||
self._configure_repo()
|
||||
|
||||
def generate_repo_url(self):
|
||||
repo_url = urljoin(self.base_url, f"{self.contentdir}/{self.releasever}/BaseOS/{self.basearch}/os/")
|
||||
repo_url = urljoin(self.base_url, f"{self.contentdir}/{self.releasever}/{self.repo_type}/{self.basearch}/os/")
|
||||
return repo_url
|
||||
|
||||
def print_repo_url(self):
|
||||
@@ -261,8 +263,11 @@ class RepoManager:
|
||||
f.write(response.content)
|
||||
|
||||
def download_package(self, package_name: str, man_maker: ManMaker) -> Package:
|
||||
try:
|
||||
packages = self.list_package_object(package_name)
|
||||
|
||||
except ValueError as e:
|
||||
print(f"Error downloading package: {e}")
|
||||
return
|
||||
for package in packages:
|
||||
download_url = urljoin(package.baseurl, package.location)
|
||||
download_path = self.download_dir / f"{package.filename}"
|
||||
|
||||
Reference in New Issue
Block a user