fedora-helper: Do not fail if unlink() fails

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-05-30 18:43:56 +02:00
parent 979ccdb601
commit 8fee5adf47
No known key found for this signature in database
GPG key ID: 115D5AB89C5C1E1E

View file

@ -131,7 +131,10 @@ def get_binary_license(ctx, source, add, verbose):
if repo.iscontiguous(): if repo.iscontiguous():
repo.empty() repo.empty()
repo.add_solv(tmp.name) repo.add_solv(tmp.name)
os.unlink(cache_file) try:
os.unlink(cache_file)
except FileNotFoundError:
pass
os.link(tmp.name, cache_file) os.link(tmp.name, cache_file)
repo_local = pool.add_repo("local") repo_local = pool.add_repo("local")