Skip to content

Commit c04fe0e

Browse files
committed
fix(fetch): Include revision in hashing for pypi
1 parent 1bbc714 commit c04fe0e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

acbs/fetch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def fetch_source(info: List[ACBSSourceInfo], source_location: str, package_name:
2828
# in generate mode, we need to fetch all the sources
2929
if not i.enabled and not generate_mode:
3030
logging.info(f'Source {count} skipped.')
31-
url_hash = hash_url(i.url)
31+
url = i.url
32+
if i.type == 'pypi':
33+
url = f"pypi://{i.url}/{i.revision}"
34+
url_hash = hash_url(url)
3235
fetch_source_inner(i, source_location, url_hash)
3336
return None
3437

@@ -67,10 +70,9 @@ def process_source(info: ACBSPackageInfo, source_name: str) -> None:
6770
# Fetchers implementations
6871
def tarball_fetch(info: ACBSSourceInfo, source_location: str, name: str) -> Optional[ACBSSourceInfo]:
6972
if source_location:
70-
filename = hash_url(info.url)
7173
if not info.chksum[1] and not generate_mode:
7274
raise ValueError('No checksum found. Please specify the checksum!')
73-
full_path = os.path.join(source_location, filename)
75+
full_path = os.path.join(source_location, name)
7476
try:
7577
wget_download(info.url, full_path)
7678
info.source_location = full_path

0 commit comments

Comments
 (0)