mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-06-02 11:00:14 +00:00
Compare commits
7 Commits
01a6696adc
...
38405b883b
Author | SHA1 | Date | |
---|---|---|---|
38405b883b | |||
e8b72866ae | |||
d9e2f2b370 | |||
32642b1efd | |||
ff35a29d08 | |||
7f2004719a | |||
c2297d6189 |
|
@ -765,6 +765,7 @@ class GitImport(Import):
|
||||||
# Within the confines of the source git repo, we need to find a
|
# Within the confines of the source git repo, we need to find a
|
||||||
# "sources" file or a metadata file. One of these will determine which
|
# "sources" file or a metadata file. One of these will determine which
|
||||||
# route we take.
|
# route we take.
|
||||||
|
metafile_to_use = None
|
||||||
if os.path.exists(metadata_file):
|
if os.path.exists(metadata_file):
|
||||||
no_metadata_list = ['stream', 'fedora']
|
no_metadata_list = ['stream', 'fedora']
|
||||||
if any(ignore in self.upstream_lookaside for ignore in no_metadata_list):
|
if any(ignore in self.upstream_lookaside for ignore in no_metadata_list):
|
||||||
|
@ -779,10 +780,16 @@ class GitImport(Import):
|
||||||
metafile_to_use = sources_file
|
metafile_to_use = sources_file
|
||||||
else:
|
else:
|
||||||
#raise err.GenericError('sources or metadata file NOT found')
|
#raise err.GenericError('sources or metadata file NOT found')
|
||||||
print('WARNING: There was no sources or metadata found. Making blank file.')
|
# There isn't a reason to make a blank file right now.
|
||||||
|
print('WARNING: There was no sources or metadata found.')
|
||||||
with open(metadata_file, 'w+') as metadata_handle:
|
with open(metadata_file, 'w+') as metadata_handle:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if not metafile_to_use:
|
||||||
|
print('Source: There was no metadata file found. Skipping import attempt.')
|
||||||
|
self.perform_cleanup([source_git_repo_path, dest_git_repo_path])
|
||||||
|
return False
|
||||||
|
|
||||||
sources_dict = self.parse_metadata_file(metafile_to_use)
|
sources_dict = self.parse_metadata_file(metafile_to_use)
|
||||||
|
|
||||||
# We need to check if there is a SPECS directory and make a SOURCES
|
# We need to check if there is a SPECS directory and make a SOURCES
|
||||||
|
@ -811,7 +818,8 @@ class GitImport(Import):
|
||||||
source_git_repo_spec = self.find_spec_file(source_git_repo_path)
|
source_git_repo_spec = self.find_spec_file(source_git_repo_path)
|
||||||
|
|
||||||
# do rpm autochangelog logic here
|
# do rpm autochangelog logic here
|
||||||
if HAS_RPMAUTOSPEC and os.path.exists(source_git_repo_changelog):
|
#if HAS_RPMAUTOSPEC and os.path.exists(source_git_repo_changelog):
|
||||||
|
if HAS_RPMAUTOSPEC:
|
||||||
# Check that the spec file really has %autochangelog
|
# Check that the spec file really has %autochangelog
|
||||||
AUTOCHANGELOG = False
|
AUTOCHANGELOG = False
|
||||||
with open(source_git_repo_spec, 'r') as spec_file:
|
with open(source_git_repo_spec, 'r') as spec_file:
|
||||||
|
@ -1142,7 +1150,7 @@ class ModuleImport(Import):
|
||||||
|
|
||||||
with open(modulemd_file, 'r') as module_yaml:
|
with open(modulemd_file, 'r') as module_yaml:
|
||||||
content = module_yaml.read()
|
content = module_yaml.read()
|
||||||
content_new = re.sub('ref:\s+(.*)', f'ref: {dest_branch}', content)
|
content_new = re.sub(r'ref:\s+(.*)', f'ref: {dest_branch}', content)
|
||||||
module_yaml.close()
|
module_yaml.close()
|
||||||
|
|
||||||
# Write to the root
|
# Write to the root
|
||||||
|
|
|
@ -139,8 +139,11 @@ def tag(repo, tag_name:str, message: str):
|
||||||
|
|
||||||
def lsremote(url):
|
def lsremote(url):
|
||||||
"""
|
"""
|
||||||
Helps check if a repo exists, and if it does, return references. If not,
|
Helps check if a repo exists.
|
||||||
return None and assume it doesn't exist.
|
|
||||||
|
If repo exists: return references
|
||||||
|
If repo exists and is completely empty: return empty dict
|
||||||
|
If repo does not exist: return None
|
||||||
"""
|
"""
|
||||||
remote_refs = {}
|
remote_refs = {}
|
||||||
git_cmd = rawgit.cmd.Git()
|
git_cmd = rawgit.cmd.Git()
|
||||||
|
@ -153,5 +156,6 @@ def lsremote(url):
|
||||||
|
|
||||||
for ref in git_cmd.ls_remote(url).split('\n'):
|
for ref in git_cmd.ls_remote(url).split('\n'):
|
||||||
hash_ref_list = ref.split('\t')
|
hash_ref_list = ref.split('\t')
|
||||||
remote_refs[hash_ref_list[1]] = hash_ref_list[0]
|
if len(hash_ref_list) > 1:
|
||||||
|
remote_refs[hash_ref_list[1]] = hash_ref_list[0]
|
||||||
return remote_refs
|
return remote_refs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "pv2"
|
name = "pv2"
|
||||||
version = "0.11.0"
|
version = "0.12.0"
|
||||||
description = "PV2 backend framework module"
|
description = "PV2 backend framework module"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
@ -11,7 +11,7 @@ maintainers = [
|
||||||
{ name = "Louis Abel", email = "label@rockylinux.org" }
|
{ name = "Louis Abel", email = "label@rockylinux.org" }
|
||||||
]
|
]
|
||||||
|
|
||||||
requires-python = ">=3.6"
|
requires-python = ">=3.9"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"GitPython >= 3.1.30",
|
"GitPython >= 3.1.30",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user