mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-11-21 20:51:26 +00:00
hotfix: some packages don't come with sources
This commit is contained in:
parent
843380bd98
commit
89457de4d4
@ -1,7 +1,10 @@
|
|||||||
# -*-:python; coding:utf-8; -*-
|
# -*-:python; coding:utf-8; -*-
|
||||||
# author: Louis Abel <label@rockylinux.org>
|
# author: Louis Abel <label@rockylinux.org>
|
||||||
"""
|
"""
|
||||||
Import module
|
Importer module
|
||||||
|
|
||||||
|
This assists packagers by taking input as srpm or git location, importing and
|
||||||
|
tagging it as appropriate.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .operation import Import, SrpmImport
|
from .operation import Import, SrpmImport
|
||||||
|
@ -12,7 +12,8 @@ from pv2.util import error as err
|
|||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'Import',
|
'Import',
|
||||||
'SrpmImport'
|
'SrpmImport',
|
||||||
|
'GitImport'
|
||||||
]
|
]
|
||||||
# todo: add in logging and replace print with log
|
# todo: add in logging and replace print with log
|
||||||
|
|
||||||
@ -77,11 +78,12 @@ class Import:
|
|||||||
Returns a dict of files that are part of sources and are binary.
|
Returns a dict of files that are part of sources and are binary.
|
||||||
"""
|
"""
|
||||||
source_dict = {}
|
source_dict = {}
|
||||||
for file in os.scandir(f'{local_repo_path}/SOURCES'):
|
if os.path.exists(f'{local_repo_path}/SOURCES'):
|
||||||
full_path = f'{local_repo_path}/SOURCES/{file.name}'
|
for file in os.scandir(f'{local_repo_path}/SOURCES'):
|
||||||
magic = fileutil.get_magic_file(full_path)
|
full_path = f'{local_repo_path}/SOURCES/{file.name}'
|
||||||
if magic.encoding == 'binary':
|
magic = fileutil.get_magic_file(full_path)
|
||||||
source_dict[f'SOURCES/{file.name}'] = fileutil.get_checksum(full_path)
|
if magic.encoding == 'binary':
|
||||||
|
source_dict[f'SOURCES/{file.name}'] = fileutil.get_checksum(full_path)
|
||||||
|
|
||||||
return source_dict
|
return source_dict
|
||||||
|
|
||||||
@ -332,3 +334,8 @@ class SrpmImport(Import):
|
|||||||
"""
|
"""
|
||||||
new_name = self.__srpm_metadata['name'].replace('+', 'plus')
|
new_name = self.__srpm_metadata['name'].replace('+', 'plus')
|
||||||
return new_name
|
return new_name
|
||||||
|
|
||||||
|
class GitImport(Import):
|
||||||
|
"""
|
||||||
|
Import class for importing from git (e.g. pagure or gitlab)
|
||||||
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user