summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2021-04-21 15:20:04 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-23 09:13:13 (GMT)
commitcda69e016695c30ce9d8cfb9896e7da0aba86df9 (patch)
tree32fdccc8410ac9c05c510900559b204bcc857c20 /bitbake/lib/bblayers
parent9fae310dd2c24259b4b4707744fec92145f5816c (diff)
downloadpoky-cda69e016695c30ce9d8cfb9896e7da0aba86df9.tar.gz
bitbake: layerindex: Add --fetchdir parameter to layerindex-fetch
Introduce --fetchdir parameter to layerindex-fetch enabling users to choose the directory to fetch the layers different from BBLAYERS_FETCH_DIR. [YOCTO #14347] (Bitbake rev: 784a904faffac723ddf58ba765b9dd11ac068de5) Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers')
-rw-r--r--bitbake/lib/bblayers/layerindex.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/bitbake/lib/bblayers/layerindex.py b/bitbake/lib/bblayers/layerindex.py
index 17dfc98..7936516 100644
--- a/bitbake/lib/bblayers/layerindex.py
+++ b/bitbake/lib/bblayers/layerindex.py
@@ -159,12 +159,17 @@ class LayerIndexPlugin(ActionPlugin):
159 logger.plain(' recommended by: %s' % ' '.join(recommendedby)) 159 logger.plain(' recommended by: %s' % ' '.join(recommendedby))
160 160
161 if dependencies: 161 if dependencies:
162 fetchdir = self.tinfoil.config_data.getVar('BBLAYERS_FETCH_DIR') 162 if args.fetchdir:
163 if not fetchdir: 163 fetchdir = args.fetchdir
164 logger.error("Cannot get BBLAYERS_FETCH_DIR") 164 else:
165 return 1 165 fetchdir = self.tinfoil.config_data.getVar('BBLAYERS_FETCH_DIR')
166 if not fetchdir:
167 logger.error("Cannot get BBLAYERS_FETCH_DIR")
168 return 1
169
166 if not os.path.exists(fetchdir): 170 if not os.path.exists(fetchdir):
167 os.makedirs(fetchdir) 171 os.makedirs(fetchdir)
172
168 addlayers = [] 173 addlayers = []
169 174
170 for deplayerbranch in dependencies: 175 for deplayerbranch in dependencies:
@@ -206,6 +211,7 @@ class LayerIndexPlugin(ActionPlugin):
206""" 211"""
207 args.show_only = True 212 args.show_only = True
208 args.ignore = [] 213 args.ignore = []
214 args.fetchdir = ""
209 args.shallow = True 215 args.shallow = True
210 self.do_layerindex_fetch(args) 216 self.do_layerindex_fetch(args)
211 217
@@ -215,6 +221,7 @@ class LayerIndexPlugin(ActionPlugin):
215 parser_layerindex_fetch.add_argument('-b', '--branch', help='branch name to fetch') 221 parser_layerindex_fetch.add_argument('-b', '--branch', help='branch name to fetch')
216 parser_layerindex_fetch.add_argument('-s', '--shallow', help='do only shallow clones (--depth=1)', action='store_true') 222 parser_layerindex_fetch.add_argument('-s', '--shallow', help='do only shallow clones (--depth=1)', action='store_true')
217 parser_layerindex_fetch.add_argument('-i', '--ignore', help='assume the specified layers do not need to be fetched/added (separate multiple layers with commas, no spaces)', metavar='LAYER') 223 parser_layerindex_fetch.add_argument('-i', '--ignore', help='assume the specified layers do not need to be fetched/added (separate multiple layers with commas, no spaces)', metavar='LAYER')
224 parser_layerindex_fetch.add_argument('-f', '--fetchdir', help='directory to fetch the layer(s) into (will be created if it does not exist)')
218 parser_layerindex_fetch.add_argument('layername', nargs='+', help='layer to fetch') 225 parser_layerindex_fetch.add_argument('layername', nargs='+', help='layer to fetch')
219 226
220 parser_layerindex_show_depends = self.add_command(sp, 'layerindex-show-depends', self.do_layerindex_show_depends, parserecipes=False) 227 parser_layerindex_show_depends = self.add_command(sp, 'layerindex-show-depends', self.do_layerindex_show_depends, parserecipes=False)