[oe-commits] [openembedded-core] 29/55: recipetool: create: fix conflict between SRCREV and tag
git at git.openembedded.org
git at git.openembedded.org
Fri Jan 5 12:07:47 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch rocko-next
in repository openembedded-core.
commit e118c387bc4c6367c1d4c2ecc5fdd276fee43602
Author: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
AuthorDate: Wed Nov 15 10:01:13 2017 +0800
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.
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
(cherry picked from commit 53f8effa3eb07dc7035ff9933e7918318f242579)
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
scripts/lib/recipetool/create.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 055bdef..5bf939e 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -477,7 +477,6 @@ def create_recipe(args):
if tag:
# Keep a copy of tag and append nobranch=1 then remove tag from URL.
# Bitbake fetcher unable to fetch when {AUTOREV} and tag is set at the same time.
- # We will re-introduce tag argument after bitbake fetcher process is complete.
storeTagName = params['tag']
params['nobranch'] = '1'
del params['tag']
@@ -549,13 +548,11 @@ def create_recipe(args):
# Since we might have a value in srcbranch, we need to
# recontruct the srcuri to include 'branch' in params.
+ scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri)
if srcbranch:
- scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri)
params['branch'] = srcbranch
- srcuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
if storeTagName and scheme in ['git', 'gitsm']:
- # Re-introduced tag variable from storeTagName
# Check srcrev using tag and check validity of the tag
cmd = ('git rev-parse --verify %s' % (storeTagName))
try:
@@ -565,6 +562,9 @@ def create_recipe(args):
logger.error(str(err))
logger.error("Possibly wrong tag name is provided")
sys.exit(1)
+ # Drop tag from srcuri as it will have conflicts with SRCREV during recipe parse.
+ del params['tag']
+ srcuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'):
srcuri = 'gitsm://' + srcuri[6:]
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list