[OE-core] [PATCH 1/3] recipetool: create: disable PREMIRRORS and MIRRORS by default
Chang Rebecca Swee Fun
rebecca.swee.fun.chang at intel.com
Thu Jul 13 03:33:54 UTC 2017
When creating new recipes, we are almost certainly fetching a new
source rather that something that has already been fetched. I have
disable PREMIRRORS and MIRRORS settings from datastore while leaving
an option for users to enable them manually if needed.
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
---
scripts/lib/recipetool/create.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 2a5a84c..ee1f678 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -405,6 +405,7 @@ def create_recipe(args):
source = args.source
srcsubdir = ''
srcrev = '${AUTOREV}'
+ mirrors = args.mirrors
if os.path.isfile(source):
source = 'file://%s' % os.path.abspath(source)
@@ -425,6 +426,13 @@ def create_recipe(args):
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
srctree = tempsrc
d = bb.data.createCopy(tinfoil.config_data)
+ if not mirrors:
+ # We do not need PREMIRRORS since we are almost certainly
+ # fetching new source rather than something that has already
+ # been fetched. Hence, we disable them by default.
+ # However, we provide an option for users to enable it.
+ d.setVar('PREMIRRORS', '')
+ d.setVar('MIRRORS', '')
if fetchuri.startswith('npm://'):
# Check if npm is available
npm_bindir = check_npm(tinfoil, args.devtool)
@@ -1163,6 +1171,7 @@ def register_commands(subparsers):
parser_create.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
parser_create.add_argument('--fetch-dev', action="store_true", help='For npm, also fetch devDependencies')
parser_create.add_argument('--devtool', action="store_true", help=argparse.SUPPRESS)
+ parser_create.add_argument('--mirrors', action="store_true", help='Enable PREMIRRORS and MIRRORS for source tree fetching (disable by default).')
# FIXME I really hate having to set parserecipes for this, but given we may need
# to call into npm (and we don't know in advance if we will or not) and in order
# to do so we need to know npm's recipe sysroot path, there's not much alternative
--
2.7.4
More information about the Openembedded-core
mailing list