aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/scriptutils.py
diff options
context:
space:
mode:
authorChang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>2017-08-21 17:39:40 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-21 08:30:32 +0100
commit091cee2bdc2378a3425a4ef8558d03e6f9c021ff (patch)
tree880239a82f4196eb6d42a524e8b93409f604823c /scripts/lib/scriptutils.py
parent5c9ef0734d23909b5694ed43cdbb205c2ba9ca95 (diff)
downloadopenembedded-core-contrib-091cee2bdc2378a3425a4ef8558d03e6f9c021ff.tar.gz
recipetool: create: disable PREMIRRORS and MIRRORS by default
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 in the recipe that created by devtool while leaving an option for users to enable them manually if needed. Since devtool already has this options, we need to ensure that recipetool is able to handle the options passed from devtool. Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/scriptutils.py')
-rw-r--r--scripts/lib/scriptutils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 97854385d5..11f1a78e97 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -102,7 +102,7 @@ class FetchUrlFailure(Exception):
def __str__(self):
return "Failed to fetch URL %s" % self.url
-def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False):
+def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirrors=False):
"""
Fetch the specified URL using normal do_fetch and do_unpack tasks, i.e.
any dependencies that need to be satisfied in order to support the fetch
@@ -150,6 +150,13 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False):
f.write('WORKDIR = "%s"\n' % tmpworkdir)
# Set S out of the way so it doesn't get created under the workdir
f.write('S = "%s"\n' % os.path.join(tmpdir, 'emptysrc'))
+ 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.
+ f.write('PREMIRRORS = ""\n')
+ f.write('MIRRORS = ""\n')
logger.info('Fetching %s...' % srcuri)