summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
authorChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>2017-11-15 10:01:13 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-18 18:03:57 +0000
commit05bcd72f9f6fb89d853a74d6fbb7becdfb06db84 (patch)
tree771c9b57ad1ec73eeb8f10610c2d61e99acb0063 /scripts/lib/recipetool/create.py
parent020aa061dda316dae10647d215481e3c108af8ca (diff)
downloadpoky-05bcd72f9f6fb89d853a74d6fbb7becdfb06db84.tar.gz
recipetool: create: fix conflict between SRCREV and tag
If you specify 'tag=' for a git URL and passed to recipetool create, you will get into Bitbake expansion error shown below: ----- snip ----- $ devtool add --version 2.4.2 mbedtls "git://github.com/ARMmbed/mbedtls;tag=mbedtls-2.4.2" ... bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Conflicting revisions (abeccb9dbd7e19ae91ac50e1edd3803111c5f9b6 from SRCREV and mbedtls-2.4.2 from the url) found, please specify one valid value ----- snip ----- Assuming the tag is valid, we should get the tag commit hash and drop the usage of 'tag=' from SRC_URI. By using a commit hash corresponding to the tag will prevent bitbake from accessing remote repository in order to expand SRCPV. (From OE-Core rev: 53f8effa3eb07dc7035ff9933e7918318f242579) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r--scripts/lib/recipetool/create.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 54e7e85396..2fc9e0aa4e 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -480,7 +480,6 @@ def create_recipe(args):
480 if tag: 480 if tag:
481 # Keep a copy of tag and append nobranch=1 then remove tag from URL. 481 # Keep a copy of tag and append nobranch=1 then remove tag from URL.
482 # Bitbake fetcher unable to fetch when {AUTOREV} and tag is set at the same time. 482 # Bitbake fetcher unable to fetch when {AUTOREV} and tag is set at the same time.
483 # We will re-introduce tag argument after bitbake fetcher process is complete.
484 storeTagName = params['tag'] 483 storeTagName = params['tag']
485 params['nobranch'] = '1' 484 params['nobranch'] = '1'
486 del params['tag'] 485 del params['tag']
@@ -552,13 +551,11 @@ def create_recipe(args):
552 551
553 # Since we might have a value in srcbranch, we need to 552 # Since we might have a value in srcbranch, we need to
554 # recontruct the srcuri to include 'branch' in params. 553 # recontruct the srcuri to include 'branch' in params.
554 scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri)
555 if srcbranch: 555 if srcbranch:
556 scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri)
557 params['branch'] = srcbranch 556 params['branch'] = srcbranch
558 srcuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
559 557
560 if storeTagName and scheme in ['git', 'gitsm']: 558 if storeTagName and scheme in ['git', 'gitsm']:
561 # Re-introduced tag variable from storeTagName
562 # Check srcrev using tag and check validity of the tag 559 # Check srcrev using tag and check validity of the tag
563 cmd = ('git rev-parse --verify %s' % (storeTagName)) 560 cmd = ('git rev-parse --verify %s' % (storeTagName))
564 try: 561 try:
@@ -568,6 +565,9 @@ def create_recipe(args):
568 logger.error(str(err)) 565 logger.error(str(err))
569 logger.error("Possibly wrong tag name is provided") 566 logger.error("Possibly wrong tag name is provided")
570 sys.exit(1) 567 sys.exit(1)
568 # Drop tag from srcuri as it will have conflicts with SRCREV during recipe parse.
569 del params['tag']
570 srcuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
571 571
572 if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'): 572 if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'):
573 srcuri = 'gitsm://' + srcuri[6:] 573 srcuri = 'gitsm://' + srcuri[6:]