diff options
author | Helmut Grohne <helmut@subdivi.de> | 2016-05-23 21:03:52 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2016-05-23 21:03:52 +0200 |
commit | ad65a01073bce55948ce4b45381ee6941b5046b2 (patch) | |
tree | f85e8dadc83913823db1ec303265b4d4c8ef3631 /autoimport.py | |
parent | 2f12a6e2f42673cc2b9cceec33821ce589204fd1 (diff) | |
download | debian-dedup-ad65a01073bce55948ce4b45381ee6941b5046b2.tar.gz |
remove curl dependency
Teach importpkg how to download urls using urlopen and thus remove the
need for invoking curl.
Diffstat (limited to 'autoimport.py')
-rwxr-xr-x | autoimport.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/autoimport.py b/autoimport.py index 132e671..abd3a5f 100755 --- a/autoimport.py +++ b/autoimport.py @@ -70,15 +70,9 @@ def process_pkg(name, pkgdict, outpath): if "sha256hash" in pkgdict: importcmd.extend(["-H", pkgdict["sha256hash"]]) if filename.startswith(("http://", "https://", "ftp://", "file://")): + importcmd.append(filename) with open(outpath, "w") as outp: - dl = subprocess.Popen(["curl", "-s", filename], - stdout=subprocess.PIPE, close_fds=True) - imp = subprocess.Popen(importcmd, stdin=dl.stdout, stdout=outp, - close_fds=True) - if imp.wait(): - raise ValueError("importpkg failed") - if dl.wait(): - raise ValueError("curl failed") + subprocess.check_call(importcmd, stdout=outp, close_fds=True) else: with open(filename) as inp: with open(outpath, "w") as outp: |