summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:16 +0100
commit210d9590230d0168fb0fdf8a70f8f0f3239894f2 (patch)
tree40f1d85608fbad428457fe843b2ef95e5b3d5f8c /scripts/lib
parenta35ad723ce9ef75f8a7d66c05179fe0eb0e50f73 (diff)
downloadpoky-210d9590230d0168fb0fdf8a70f8f0f3239894f2.tar.gz
recipetool: create: fix handling of URIs containing #
The # character in a URI denotes a fragment; we don't care about this since it is never supposed to be sent to the server, so remove it from the URI before actually trying to fetch it or use it in SRC_URI within the recipe. (This has come up because download links on pypi.python.org seem to have a fragment containing the md5sum of the download; without stripping this off the fetcher will choke on it.) (From OE-Core rev: 58dc726808817210764eab963a4d453dc4ff49aa) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/create.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 99d9cc850e..409b255f5f 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -23,6 +23,7 @@ import fnmatch
23import re 23import re
24import logging 24import logging
25import scriptutils 25import scriptutils
26import urlparse
26 27
27logger = logging.getLogger('recipetool') 28logger = logging.getLogger('recipetool')
28 29
@@ -102,7 +103,8 @@ def create_recipe(args):
102 srcrev = '${AUTOREV}' 103 srcrev = '${AUTOREV}'
103 if '://' in args.source: 104 if '://' in args.source:
104 # Fetch a URL 105 # Fetch a URL
105 srcuri = args.source 106 fetchuri = urlparse.urldefrag(args.source)[0]
107 srcuri = fetchuri
106 rev_re = re.compile(';rev=([^;]+)') 108 rev_re = re.compile(';rev=([^;]+)')
107 res = rev_re.search(srcuri) 109 res = rev_re.search(srcuri)
108 if res: 110 if res:
@@ -111,7 +113,7 @@ def create_recipe(args):
111 tempsrc = tempfile.mkdtemp(prefix='recipetool-') 113 tempsrc = tempfile.mkdtemp(prefix='recipetool-')
112 srctree = tempsrc 114 srctree = tempsrc
113 logger.info('Fetching %s...' % srcuri) 115 logger.info('Fetching %s...' % srcuri)
114 checksums = scriptutils.fetch_uri(tinfoil.config_data, args.source, srctree, srcrev) 116 checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
115 dirlist = os.listdir(srctree) 117 dirlist = os.listdir(srctree)
116 if 'git.indirectionsymlink' in dirlist: 118 if 'git.indirectionsymlink' in dirlist:
117 dirlist.remove('git.indirectionsymlink') 119 dirlist.remove('git.indirectionsymlink')