From afef51ddeeb533a693a7ca6ac009d5fb2cbd8299 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Feb 14 2020 09:51:07 +0000 Subject: Don't compare DBs if not publishing result. --- diff --git a/mdapi-get_repo_md b/mdapi-get_repo_md index 2032d15..f75a22d 100755 --- a/mdapi-get_repo_md +++ b/mdapi-get_repo_md @@ -287,10 +287,7 @@ def compare_dbs(name, db1, db2, cache1, cache2): def publish_changes(name, packages, repomd_url): - print(f'{name.ljust(padding)} Publishing differences to fedora messaging: ' - f'{PUBLISH_CHANGES}') - if not PUBLISH_CHANGES: - return + print(f'{name.ljust(padding)} Publishing differences to fedora messaging:') change = bool(packages) if not change: @@ -417,8 +414,12 @@ def process_repo(tupl): download_db(name, repomd_url, archive) decompress_db(name, archive, tempdb) - packages = compare_dbs(name, tempdb, destfile, cache1, cache2) - publish_changes(name, packages, repomd_url) + if PUBLISH_CHANGES: + packages = compare_dbs(name, tempdb, destfile, cache1, cache2) + publish_changes(name, packages, repomd_url) + else: + print(f'{name.ljust(padding)} Not publishing to Fedora ' + f'messaging; not comparing DBs.') install_db(name, tempdb, destfile)