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