Add --force-new-sources option to sync_release
@@ -59,7 +59,11 @@ class PackitAPI:
)
def sync_release(
- self, dist_git_branch: str, use_local_content=False, version: str = None
+ self,
+ dist_git_branch: str,
+ use_local_content=False,
+ version: str = None,
+ force_new_sources=False,
):
"""
Update given package in Fedora
@@ -113,6 +117,7 @@ class PackitAPI:
dist_git_branch=dist_git_branch,
commit_msg_description=description,
add_new_sources=True,
+ force_new_sources=force_new_sources,
)
finally:
if not use_local_content:
@@ -127,12 +132,15 @@ class PackitAPI:
dist_git_branch: str,
commit_msg_description: str = None,
add_new_sources=False,
+ force_new_sources=False,
):
- if add_new_sources:
+ if add_new_sources or force_new_sources:
# btw this is really naive: the name could be the same but the hash can be different
# TODO: we should do something when such situation happens
- if not distgit.is_archive_in_lookaside_cache(distgit.upstream_archive_name):
+ if force_new_sources or not distgit.is_archive_in_lookaside_cache(
+ distgit.upstream_archive_name
+ ):
archive = distgit.download_upstream_archive()
distgit.upload_to_lookaside_cache(archive)
