ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically
- Review comments
This commit is contained in:
parent
596c5c0b7f
commit
004fc4382f
@ -152,10 +152,9 @@ class PackageSetBase(kobo.log.LoggingBase):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def nvr_formatter(package_info):
|
def nvr_formatter(package_info):
|
||||||
|
epoch_suffix = ''
|
||||||
if package_info['epoch'] is not None:
|
if package_info['epoch'] is not None:
|
||||||
epoch_suffix = ':' + package_info['epoch']
|
epoch_suffix = ':' + package_info['epoch']
|
||||||
else:
|
|
||||||
epoch_suffix = ''
|
|
||||||
return (
|
return (
|
||||||
f"{package_info['name']}"
|
f"{package_info['name']}"
|
||||||
f"{epoch_suffix}-"
|
f"{epoch_suffix}-"
|
||||||
|
@ -130,16 +130,16 @@ class PackagesGenerator:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_full_repo_path(repo_info: RepoInfo):
|
def _get_full_repo_path(repo_info: RepoInfo):
|
||||||
|
result = os.path.join(
|
||||||
|
repo_info.path,
|
||||||
|
repo_info.folder
|
||||||
|
)
|
||||||
if repo_info.is_remote:
|
if repo_info.is_remote:
|
||||||
return urljoin(
|
result = urljoin(
|
||||||
repo_info.path + '/',
|
repo_info.path + '/',
|
||||||
repo_info.folder,
|
repo_info.folder,
|
||||||
)
|
)
|
||||||
else:
|
return result
|
||||||
return os.path.join(
|
|
||||||
repo_info.path,
|
|
||||||
repo_info.folder
|
|
||||||
)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _warning_callback(warning_type, message):
|
def _warning_callback(warning_type, message):
|
||||||
@ -205,6 +205,12 @@ class PackagesGenerator:
|
|||||||
:param repo_info: structure which contains info about a current repo
|
:param repo_info: structure which contains info about a current repo
|
||||||
:return: list with repomd records
|
:return: list with repomd records
|
||||||
"""
|
"""
|
||||||
|
repomd_file_path = os.path.join(
|
||||||
|
repo_info.path,
|
||||||
|
repo_info.folder,
|
||||||
|
'repodata',
|
||||||
|
'repomd.xml',
|
||||||
|
)
|
||||||
if repo_info.is_remote:
|
if repo_info.is_remote:
|
||||||
repomd_file_path = urljoin(
|
repomd_file_path = urljoin(
|
||||||
urljoin(
|
urljoin(
|
||||||
@ -214,13 +220,7 @@ class PackagesGenerator:
|
|||||||
'repodata/repomd.xml'
|
'repodata/repomd.xml'
|
||||||
)
|
)
|
||||||
repomd_file_path = self.get_remote_file_content(repomd_file_path)
|
repomd_file_path = self.get_remote_file_content(repomd_file_path)
|
||||||
else:
|
|
||||||
repomd_file_path = os.path.join(
|
|
||||||
repo_info.path,
|
|
||||||
repo_info.folder,
|
|
||||||
'repodata',
|
|
||||||
'repomd.xml',
|
|
||||||
)
|
|
||||||
repomd_object = self._parse_repomd(repomd_file_path)
|
repomd_object = self._parse_repomd(repomd_file_path)
|
||||||
if repo_info.is_remote:
|
if repo_info.is_remote:
|
||||||
os.remove(repomd_file_path)
|
os.remove(repomd_file_path)
|
||||||
@ -301,9 +301,8 @@ class PackagesGenerator:
|
|||||||
repo_info: RepoInfo,
|
repo_info: RepoInfo,
|
||||||
) -> Union[PackageIterator, Iterator]:
|
) -> Union[PackageIterator, Iterator]:
|
||||||
full_repo_path = self._get_full_repo_path(repo_info)
|
full_repo_path = self._get_full_repo_path(repo_info)
|
||||||
if full_repo_path in self.pkgs:
|
pkgs_iterator = self.pkgs.get(full_repo_path)
|
||||||
return self.pkgs[full_repo_path]
|
if pkgs_iterator is None:
|
||||||
else:
|
|
||||||
repomd_records = self._get_repomd_records(
|
repomd_records = self._get_repomd_records(
|
||||||
repo_info=repo_info,
|
repo_info=repo_info,
|
||||||
)
|
)
|
||||||
@ -320,17 +319,17 @@ class PackagesGenerator:
|
|||||||
warningcb=self._warning_callback,
|
warningcb=self._warning_callback,
|
||||||
)
|
)
|
||||||
pkgs_iterator, self.pkgs[full_repo_path] = tee(pkgs_iterator)
|
pkgs_iterator, self.pkgs[full_repo_path] = tee(pkgs_iterator)
|
||||||
return pkgs_iterator
|
return pkgs_iterator
|
||||||
|
|
||||||
def get_package_arch(
|
def get_package_arch(
|
||||||
self,
|
self,
|
||||||
package: Package,
|
package: Package,
|
||||||
variant_arch: str,
|
variant_arch: str,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
result = variant_arch
|
||||||
if package.arch in self.repo_arches[variant_arch]:
|
if package.arch in self.repo_arches[variant_arch]:
|
||||||
return package.arch
|
result = package.arch
|
||||||
else:
|
return result
|
||||||
return variant_arch
|
|
||||||
|
|
||||||
def is_skipped_module_package(self, package: Package) -> bool:
|
def is_skipped_module_package(self, package: Package) -> bool:
|
||||||
# Even a module package will be added to packages.json if
|
# Even a module package will be added to packages.json if
|
||||||
|
Loading…
Reference in New Issue
Block a user