processor fix

This commit is contained in:
Louis Abel 2024-03-04 17:27:16 -07:00
parent 99035af3e9
commit 01a6696adc
Signed by: label
GPG Key ID: 2A6975660E424560

View File

@ -814,16 +814,18 @@ class GitImport(Import):
if HAS_RPMAUTOSPEC and os.path.exists(source_git_repo_changelog):
# Check that the spec file really has %autochangelog
AUTOCHANGELOG = False
for line in source_git_repo_spec:
if re.search(r'^%autochangelog', line):
print('autochangelog found')
AUTOCHANGELOG = True
with open(source_git_repo_spec, 'r') as spec_file:
for line in spec_file:
if re.match(r'^%autochangelog', line):
print('autochangelog found')
AUTOCHANGELOG = True
spec_file.close()
# It was easier to do this then reimplement logic
if AUTOCHANGELOG:
try:
rpmautocl.process_distgit(
source_git_repo_path,
'/tmp/{self.rpm_name}.spec'
source_git_repo_spec,
f'/tmp/{self.rpm_name}.spec'
)
except Exception as exc:
raise err.GenericError('There was an error with autospec.') from exc