From 03d6cc0a5ac4d546f234d8326551f2ee35e0f1a5 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 21 Apr 2014 12:50:15 +0200 Subject: autoimport: support protocols besides http --- autoimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'autoimport.py') diff --git a/autoimport.py b/autoimport.py index d44c012..9c4c73e 100755 --- a/autoimport.py +++ b/autoimport.py @@ -60,7 +60,7 @@ def process_pkg(name, pkgdict, outpath): importcmd = ["python", "importpkg.py"] if "sha256hash" in pkgdict: importcmd.extend(["-H", pkgdict["sha256hash"]]) - if filename.startswith("http://"): + if filename.startswith(("http://", "https://", "ftp://", "file://")): with open(outpath, "w") as outp: dl = subprocess.Popen(["curl", "-s", filename], stdout=subprocess.PIPE, close_fds=True) @@ -95,7 +95,7 @@ def main(): pkgs = {} for d in args: print("processing %s" % d) - if d.startswith("http://"): + if d.startswith(("http://", "https://", "ftp://", "file://")): process_http(pkgs, d) elif os.path.isdir(d): process_dir(pkgs, d) -- cgit v1.2.3