mirror of https://github.com/peridotbuild/pv2.git
Compare commits
7 Commits
0913ae912f
...
b982646f3a
Author | SHA1 | Date |
---|---|---|
Louis Abel | b982646f3a | |
Louis Abel | 0854a39c58 | |
Louis Abel | 45abe82b40 | |
Louis Abel | f3213dafaf | |
Louis Abel | 1255a10ef9 | |
Louis Abel | 7001664d9f | |
Louis Abel | 236f18412b |
16
README.md
16
README.md
|
@ -7,19 +7,19 @@
|
|||
![license](https://img.shields.io/github/license/peridotbuild/pv2)
|
||||
|
||||
pv2 is a backend module framework for building and development. Initially
|
||||
designed as a POC to support peridot's transition to python, it provides
|
||||
utilities that can be used for developers in and outside of the projects
|
||||
in the RESF (such as Rocky Linux).
|
||||
designed as a POC to support peridot's potential transition to python, it
|
||||
provides utilities that can be used for developers in and outside of the
|
||||
projects in the RESF (such as Rocky Linux).
|
||||
|
||||
## Requirements
|
||||
|
||||
* An RPM Distribution
|
||||
|
||||
* Fedora
|
||||
* Enterprise Linux 8, 9+ recommended
|
||||
* CentOS Stream 8, 9+ recommended
|
||||
* Enterprise Linux 9+ recommended
|
||||
* CentOS Stream 9+ recommended
|
||||
|
||||
* Python 3.6 or higher - Python 3.9+ recommended
|
||||
* Python 3.9 or higher
|
||||
* rpm-build
|
||||
* A few python modules
|
||||
|
||||
|
@ -34,6 +34,10 @@ in the RESF (such as Rocky Linux).
|
|||
* \*-rpm-macros
|
||||
* \*-srpm-macros
|
||||
|
||||
* additional packages either in Fedora Linux or EPEL
|
||||
|
||||
* rpmautospec-rpm-macros
|
||||
|
||||
## Example Scripts
|
||||
|
||||
Example scripts are found in the `examples` directory, which can utilize
|
||||
|
|
|
@ -352,6 +352,7 @@ class SrpmImport(Import):
|
|||
distprefix: str = 'el',
|
||||
git_user: str = 'git',
|
||||
org: str = 'rpms',
|
||||
preconv_names: bool = False,
|
||||
dest_lookaside: str = '/var/www/html/sources',
|
||||
verify_signature: bool = False,
|
||||
aws_access_key_id: str = '',
|
||||
|
@ -373,7 +374,12 @@ class SrpmImport(Import):
|
|||
self.__dest_lookaside = dest_lookaside
|
||||
|
||||
pkg_name = self.__srpm_metadata['name']
|
||||
git_url = f'ssh://{git_user}@{git_url_path}/{org}/{pkg_name}.git'
|
||||
|
||||
package_name = pkg_name
|
||||
if preconv_names:
|
||||
package_name = pkg_name.replace('+', 'plus')
|
||||
|
||||
git_url = f'ssh://{git_user}@{git_url_path}/{org}/{package_name}.git'
|
||||
self.__git_url = git_url
|
||||
|
||||
file_name_search_srpm_res = re.search(r'.*?\.src\.rpm$',
|
||||
|
@ -418,7 +424,7 @@ class SrpmImport(Import):
|
|||
than uploaded to lookaside.
|
||||
"""
|
||||
check_repo = gitutil.lsremote(self.git_url)
|
||||
git_repo_path = f'/var/tmp/{self.rpm_name}'
|
||||
git_repo_path = f'/var/tmp/{self.rpm_name_replace}'
|
||||
branch = self.__branch
|
||||
repo_tags = []
|
||||
|
||||
|
@ -546,6 +552,14 @@ class SrpmImport(Import):
|
|||
"""
|
||||
return self.__srpm_metadata['name']
|
||||
|
||||
@property
|
||||
def rpm_name_replace(self):
|
||||
"""
|
||||
Returns name of srpm
|
||||
"""
|
||||
new_name = self.__srpm_metadata['name'].replace('+', 'plus')
|
||||
return new_name
|
||||
|
||||
@property
|
||||
def rpm_version(self):
|
||||
"""
|
||||
|
@ -575,14 +589,6 @@ class SrpmImport(Import):
|
|||
|
||||
return False
|
||||
|
||||
@property
|
||||
def rpm_name_replace(self):
|
||||
"""
|
||||
Returns a "fixed" version of the RPM name
|
||||
"""
|
||||
new_name = self.__srpm_metadata['name'].replace('+', 'plus')
|
||||
return new_name
|
||||
|
||||
@property
|
||||
def distprefix(self):
|
||||
"""
|
||||
|
@ -620,6 +626,7 @@ class GitImport(Import):
|
|||
scl_mode: bool = False,
|
||||
scl_package: str = '',
|
||||
alternate_spec_name: str = '',
|
||||
preconv_names: bool = False,
|
||||
dest_lookaside: str = '/var/www/html/sources',
|
||||
source_git_protocol: str = 'https',
|
||||
dest_branch: str = '',
|
||||
|
@ -644,8 +651,12 @@ class GitImport(Import):
|
|||
if source_git_protocol == 'ssh':
|
||||
full_source_git_url_path = f'{source_git_user}@{source_git_url_path}'
|
||||
|
||||
self.__source_git_url = f'{source_git_protocol}://{full_source_git_url_path}/{source_git_org_path}/{package}.git'
|
||||
self.__dest_git_url = f'ssh://{dest_git_user}@{dest_git_url_path}/{dest_org}/{package}.git'
|
||||
package_name = package
|
||||
if preconv_names:
|
||||
package_name = package.replace('+', 'plus')
|
||||
|
||||
self.__source_git_url = f'{source_git_protocol}://{full_source_git_url_path}/{source_git_org_path}/{package_name}.git'
|
||||
self.__dest_git_url = f'ssh://{dest_git_user}@{dest_git_url_path}/{dest_org}/{package_name}.git'
|
||||
self.__dist_prefix = distprefix
|
||||
self.__dist_tag = f'.{distprefix}{release}'
|
||||
self.__source_branch = source_branch
|
||||
|
@ -654,6 +665,7 @@ class GitImport(Import):
|
|||
self.__upstream_lookaside = upstream_lookaside
|
||||
self.__upstream_lookaside_url = self.get_lookaside_template_path(upstream_lookaside)
|
||||
self.__alternate_spec_name = alternate_spec_name
|
||||
self.__preconv_names = preconv_names
|
||||
self.__aws_access_key_id = aws_access_key_id
|
||||
self.__aws_access_key = aws_access_key
|
||||
self.__aws_bucket = aws_bucket
|
||||
|
@ -858,8 +870,11 @@ class GitImport(Import):
|
|||
"""
|
||||
Returns the translated URL to obtain sources
|
||||
"""
|
||||
rpm_name = self.rpm_name
|
||||
if self.preconv_names:
|
||||
rpm_name = self.rpm_name_replace
|
||||
dict_template = {
|
||||
'PKG_NAME': self.rpm_name,
|
||||
'PKG_NAME': rpm_name,
|
||||
'FILENAME': filename,
|
||||
'HASH_TYPE': hashtype.lower(),
|
||||
'HASH': checksum
|
||||
|
@ -947,6 +962,13 @@ class GitImport(Import):
|
|||
"""
|
||||
return self.__dest_lookaside
|
||||
|
||||
@property
|
||||
def preconv_names(self):
|
||||
"""
|
||||
Returns if names are being preconverted
|
||||
"""
|
||||
return self.__preconv_names
|
||||
|
||||
class ModuleImport(Import):
|
||||
"""
|
||||
Imports module repos
|
||||
|
|
|
@ -39,6 +39,7 @@ git_parser.add_argument('--dest-giturl', type=str, required=True)
|
|||
git_parser.add_argument('--dest-gitorg', type=str, required=False, default='rpms')
|
||||
git_parser.add_argument('--dest-branch', type=str, required=False, default='')
|
||||
git_parser.add_argument('--release', type=str, required=False, default='')
|
||||
git_parser.add_argument('--preconv-names', action='store_true', help='Convert + to plus first')
|
||||
git_parser.add_argument('--distprefix', type=str, required=False, default='el')
|
||||
git_parser.add_argument('--dest-lookaside', type=str, required=False, default='/var/www/html/sources')
|
||||
git_parser.add_argument('--upstream-lookaside',
|
||||
|
@ -90,6 +91,7 @@ def main():
|
|||
dest_git_url_path=results.dest_giturl,
|
||||
dest_org=results.dest_gitorg,
|
||||
release=results.release,
|
||||
preconv_names=results.preconv_names,
|
||||
source_branch=results.source_branch,
|
||||
dest_branch=results.dest_branch,
|
||||
upstream_lookaside=results.upstream_lookaside,
|
||||
|
|
Loading…
Reference in New Issue