[oe-commits] [openembedded-core] 10/19: recipetool: create: fix SRCPV prefix for non-git SCMs

git at git.openembedded.org git at git.openembedded.org
Thu Aug 31 16:55:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit b9429161b3f0d1823cad50f3da14c69ae932b7a7
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Aug 31 11:54:13 2017 +1200

    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 at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/recipetool/create.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 4da745b..d8cfcbd 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')):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list