aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-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')):