All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 01/10] recipetool: create: disable PREMIRRORS and MIRRORS by default
Date: Mon, 21 Aug 2017 17:39:40 +1200	[thread overview]
Message-ID: <b464cf929437951f54936931fb207db832921274.1503293342.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1503293342.git.paul.eggleton@linux.intel.com>

From: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>

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>
---
 scripts/lib/recipetool/create.py | 1 +
 scripts/lib/scriptutils.py       | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index e21e2bf..2c3a58a 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1169,5 +1169,6 @@ 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 (disabled by default).')
     parser_create.set_defaults(func=create_recipe)
 
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 9785438..11f1a78 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)
 
-- 
2.9.5



  reply	other threads:[~2017-08-21  5:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21  5:39 [PATCH 00/10] devtool/recipetool fixes rollup Paul Eggleton
2017-08-21  5:39 ` Paul Eggleton [this message]
2017-08-21  5:39 ` [PATCH 02/10] recipetool: create: being able to set branch when revision is provided Paul Eggleton
2017-08-21  5:39 ` [PATCH 03/10] recipetool: create: handle git URLs specifying only a tag Paul Eggleton
2017-08-21  5:39 ` [PATCH 04/10] recipetool: create: replacing PV in SRCURI Paul Eggleton
2017-08-21  5:39 ` [PATCH 05/10] devtool: upgrade: enable branch checking when revision is provided Paul Eggleton
2017-08-21  5:39 ` [PATCH 06/10] devtool: export: new plugin to export the devtool workspace Paul Eggleton
2017-08-21  5:39 ` [PATCH 07/10] devtool: append md5sum only if not already present Paul Eggleton
2017-08-21  5:39 ` [PATCH 08/10] devtool: import: new plugin to import the devtool workspace Paul Eggleton
2017-08-21  5:39 ` [PATCH 09/10] recipetool: allow plugins to set PN / PV more easily Paul Eggleton
2017-08-21  5:39 ` [PATCH 10/10] recipetool: allow plugins to set LICENSE and LIC_FILES_CHKSUM Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b464cf929437951f54936931fb207db832921274.1503293342.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.