import json
import logging
import scriptutils
-import urlparse
+from urllib.parse import urlparse, urldefrag, urlsplit
import hashlib
logger = logging.getLogger('recipetool')
"""Determine name and version from a URL"""
pn = None
pv = None
- parseres = urlparse.urlparse(srcuri.lower().split(';', 1)[0])
+ parseres = urlparse(srcuri.lower().split(';', 1)[0])
if parseres.path:
if 'github.com' in parseres.netloc:
res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path)
srcrev = '${AUTOREV}'
if '://' in args.source:
# Fetch a URL
- fetchuri = reformat_git_uri(urlparse.urldefrag(args.source)[0])
+ fetchuri = reformat_git_uri(urldefrag(args.source)[0])
if args.binary:
# Assume the archive contains the directory structure verbatim
# so we need to extract to a subdirectory