summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-29 11:47:48 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-08-31 11:50:27 +1200
commit8bfdce20a06e094fe7ebfa86293ab4270a637697 (patch)
tree4ced24959b289ec0ee27d4da3b2d9de7318ddfff
parent3d923d8c63b04e0ba8db997f82b738ece8696128 (diff)
downloadopenembedded-core-contrib-8bfdce20a06e094fe7ebfa86293ab4270a637697.tar.gz
openembedded-core-contrib-8bfdce20a06e094fe7ebfa86293ab4270a637697.tar.bz2
openembedded-core-contrib-8bfdce20a06e094fe7ebfa86293ab4270a637697.zip
recipetool: create: fix SRCPV prefix for non-git SCMs
If you're fetching from an SCM other than git (for example subversion or mercurial) then we need to use a different prefix for the SRCPV in PV instead of +git. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--scripts/lib/recipetool/create.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 4da745b732..d8cfcbdab8 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -423,6 +423,7 @@ def create_recipe(args):
srcsubdir = ''
srcrev = '${AUTOREV}'
srcbranch = ''
+ scheme = ''
storeTagName = ''
pv_srcpv = False
@@ -682,7 +683,14 @@ def create_recipe(args):
lines_before.append('')
lines_before.append('# Modify these as desired')
# Note: we have code to replace realpv further down if it gets set to some other value
- lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0'))
+ scheme, _, _, _, _, _ = bb.fetch2.decodeurl(srcuri)
+ if scheme in ['git', 'gitsm']:
+ srcpvprefix = 'git'
+ elif scheme == 'svn':
+ srcpvprefix = 'svnr'
+ else:
+ srcpvprefix = scheme
+ lines_before.append('PV = "%s+%s${SRCPV}"' % (realpv or '1.0', srcpvprefix))
pv_srcpv = True
if not args.autorev and srcrev == '${AUTOREV}':
if os.path.exists(os.path.join(srctree, '.git')):