summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-04-14 20:24:19 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-15 06:59:43 +0100
commit60a8719e6eca525c5b6cafd3d02c9ca419309460 (patch)
tree68a88153aad65f22b20ac89788aed76ae31a67ea /scripts/lib/devtool/upgrade.py
parent8353557193a5e3d2bfa7861f11acfb2c0cb4f7fe (diff)
downloadpoky-60a8719e6eca525c5b6cafd3d02c9ca419309460.tar.gz
devtool: upgrade: handle recipes where source is not first entry in SRC_URI
It is unusual but not impossible to find recipes whose first entry is not the main source URL but instead some patch or other local file, for example python-cryptography in meta-python (which sets SRC_URI before inheriting pypi). There's nothing inherently wrong with this, and we shouldn't assume that the first entry is the main source URL, so just take the first non-local entry instead. (From OE-Core rev: c868198c1f6006789707b497c2ae34d7cc5e706f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/upgrade.py')
-rw-r--r--scripts/lib/devtool/upgrade.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 680cbf132d..a085f78c43 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -145,7 +145,15 @@ def _get_uri(rd):
145 srcuris = rd.getVar('SRC_URI', True).split() 145 srcuris = rd.getVar('SRC_URI', True).split()
146 if not len(srcuris): 146 if not len(srcuris):
147 raise DevtoolError('SRC_URI not found on recipe') 147 raise DevtoolError('SRC_URI not found on recipe')
148 srcuri = srcuris[0] # it is assumed, URI is at first position 148 # Get first non-local entry in SRC_URI - usually by convention it's
149 # the first entry, but not always!
150 srcuri = None
151 for entry in srcuris:
152 if not entry.startswith('file://'):
153 srcuri = entry
154 break
155 if not srcuri:
156 raise DevtoolError('Unable to find non-local entry in SRC_URI')
149 srcrev = '${AUTOREV}' 157 srcrev = '${AUTOREV}'
150 if '://' in srcuri: 158 if '://' in srcuri:
151 # Fetch a URL 159 # Fetch a URL