scripts: Fix urlparse imports for python3
Used urllib.parse instead of urlparse to make code working in python 3. (From OE-Core rev: 0a064f2216895db0181ee033a785328e704ddc0b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
fa4275bbc0
commit
0d7db8e732
|
@ -24,7 +24,7 @@ import re
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import scriptutils
|
import scriptutils
|
||||||
import urlparse
|
from urllib.parse import urlparse, urldefrag, urlsplit
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
logger = logging.getLogger('recipetool')
|
logger = logging.getLogger('recipetool')
|
||||||
|
@ -283,7 +283,7 @@ def determine_from_url(srcuri):
|
||||||
"""Determine name and version from a URL"""
|
"""Determine name and version from a URL"""
|
||||||
pn = None
|
pn = None
|
||||||
pv = None
|
pv = None
|
||||||
parseres = urlparse.urlparse(srcuri.lower().split(';', 1)[0])
|
parseres = urlparse(srcuri.lower().split(';', 1)[0])
|
||||||
if parseres.path:
|
if parseres.path:
|
||||||
if 'github.com' in parseres.netloc:
|
if 'github.com' in parseres.netloc:
|
||||||
res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path)
|
res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path)
|
||||||
|
@ -355,7 +355,7 @@ def create_recipe(args):
|
||||||
srcrev = '${AUTOREV}'
|
srcrev = '${AUTOREV}'
|
||||||
if '://' in args.source:
|
if '://' in args.source:
|
||||||
# Fetch a URL
|
# Fetch a URL
|
||||||
fetchuri = reformat_git_uri(urlparse.urldefrag(args.source)[0])
|
fetchuri = reformat_git_uri(urldefrag(args.source)[0])
|
||||||
if args.binary:
|
if args.binary:
|
||||||
# Assume the archive contains the directory structure verbatim
|
# Assume the archive contains the directory structure verbatim
|
||||||
# so we need to extract to a subdirectory
|
# so we need to extract to a subdirectory
|
||||||
|
|
Loading…
Reference in New Issue