diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-19 12:33:44 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:01 +0100 |
commit | 0d7db8e732a9032c68364ad12167c280310aa599 (patch) | |
tree | fd1580b1dae9f5bd5f5811a8abc0c7cbdbe47b4f /scripts/lib/recipetool/create.py | |
parent | fa4275bbc0098124f3b44e0eafae83692db778b9 (diff) | |
download | poky-0d7db8e732a9032c68364ad12167c280310aa599.tar.gz |
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>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r-- | scripts/lib/recipetool/create.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 744ff1b0ab..129742807f 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -24,7 +24,7 @@ import re | |||
24 | import json | 24 | import json |
25 | import logging | 25 | import logging |
26 | import scriptutils | 26 | import scriptutils |
27 | import urlparse | 27 | from urllib.parse import urlparse, urldefrag, urlsplit |
28 | import hashlib | 28 | import hashlib |
29 | 29 | ||
30 | logger = logging.getLogger('recipetool') | 30 | logger = logging.getLogger('recipetool') |
@@ -283,7 +283,7 @@ def determine_from_url(srcuri): | |||
283 | """Determine name and version from a URL""" | 283 | """Determine name and version from a URL""" |
284 | pn = None | 284 | pn = None |
285 | pv = None | 285 | pv = None |
286 | parseres = urlparse.urlparse(srcuri.lower().split(';', 1)[0]) | 286 | parseres = urlparse(srcuri.lower().split(';', 1)[0]) |
287 | if parseres.path: | 287 | if parseres.path: |
288 | if 'github.com' in parseres.netloc: | 288 | if 'github.com' in parseres.netloc: |
289 | res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path) | 289 | res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path) |
@@ -355,7 +355,7 @@ def create_recipe(args): | |||
355 | srcrev = '${AUTOREV}' | 355 | srcrev = '${AUTOREV}' |
356 | if '://' in args.source: | 356 | if '://' in args.source: |
357 | # Fetch a URL | 357 | # Fetch a URL |
358 | fetchuri = reformat_git_uri(urlparse.urldefrag(args.source)[0]) | 358 | fetchuri = reformat_git_uri(urldefrag(args.source)[0]) |
359 | if args.binary: | 359 | if args.binary: |
360 | # Assume the archive contains the directory structure verbatim | 360 | # Assume the archive contains the directory structure verbatim |
361 | # so we need to extract to a subdirectory | 361 | # so we need to extract to a subdirectory |