1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

Use wget in getdeps to download source code

Summary:
Neither the default "urlretrieve" nor "pycurl" works fine for all of FBOSS'
dependencies. One or other fails (opennsa, libmnl, exprtk, etc...) with these
two options. So, adding support for "wget".

Tried to use python's wget.download() but this also internally uses
"urlretrieve" and hence it fails for some of the FBOSS' dependencies.
So, using wget command directly instead.

Reviewed By: shri-khare

Differential Revision: D40841867

fbshipit-source-id: 229b3064f3faad4b32cf8a3c43fef53f2bb001fd
This commit is contained in:
Siva Muthusamy
2022-10-31 10:15:27 -07:00
committed by Facebook GitHub Bot
parent 1416dbc17a
commit dcb2f57204

View File

@@ -680,7 +680,19 @@ def download_url_to_file_with_progress(url: str, file_name) -> None:
progress = Progress()
start = time.time()
try:
if os.environ.get("GETDEPS_USE_LIBCURL") is not None:
if os.environ.get("GETDEPS_USE_WGET") is not None:
subprocess.run(
[
"wget",
"-O",
file_name,
url,
]
)
headers = None
elif os.environ.get("GETDEPS_USE_LIBCURL") is not None:
import pycurl
with open(file_name, "wb") as f: