All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
To: openembedded-core@lists.openembedded.org
Cc: jonaskgandersson@gmail.com, paul.eggleton@linux.intel.com,
	rennes@savoirfairelinux.com, bunk@stusta.de
Subject: [PATCH v3 01/17] devtool: npm: update command line options
Date: Wed, 20 Nov 2019 10:33:42 +0100	[thread overview]
Message-ID: <20191120093358.11622-2-jean-marie.lemetayer@savoirfairelinux.com> (raw)
In-Reply-To: <20191120093358.11622-1-jean-marie.lemetayer@savoirfairelinux.com>

This commit renames the '--fetch-dev' option into '--npm-dev' which is
more easily understandable.

It also adds the '--npm-registry' option to allow creating a npm recipe
with a non default npm registry (e.g. if the SRC_URI is using git://).

Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
---
 scripts/lib/devtool/standard.py  |  9 ++++++---
 scripts/lib/recipetool/create.py | 12 +++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 8d9c1a3022..7068a02a01 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -145,8 +145,10 @@ def add(args, config, basepath, workspace):
         extracmdopts += ' --src-subdir "%s"' % args.src_subdir
     if args.autorev:
         extracmdopts += ' -a'
-    if args.fetch_dev:
-        extracmdopts += ' --fetch-dev'
+    if args.npm_dev:
+        extracmdopts += ' --npm-dev'
+    if args.npm_registry:
+        extracmdopts += ' --npm-registry "%s"' % args.npm_registry
     if args.mirrors:
         extracmdopts += ' --mirrors'
     if args.srcrev:
@@ -2197,7 +2199,8 @@ def register_commands(subparsers, context):
     group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
     group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
     parser_add.add_argument('--fetch', '-f', help='Fetch the specified URI and extract it to create the source tree (deprecated - pass as positional argument instead)', metavar='URI')
-    parser_add.add_argument('--fetch-dev', help='For npm, also fetch devDependencies', action="store_true")
+    parser_add.add_argument('--npm-dev', help='For npm, also fetch devDependencies', action="store_true")
+    parser_add.add_argument('--npm-registry', help='For npm, use the specified registry', type=str)
     parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
     parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true")
     group = parser_add.add_mutually_exclusive_group()
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1fb6b55530..932dc3f374 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -716,10 +716,11 @@ def create_recipe(args):
         lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
         lines_after.append('')
 
-    if args.fetch_dev:
-        extravalues['fetchdev'] = True
-    else:
-        extravalues['fetchdev'] = None
+    if args.npm_dev:
+        extravalues['NPM_INSTALL_DEV'] = 1
+
+    if args.npm_registry:
+        extravalues['NPM_REGISTRY'] = args.npm_registry
 
     # Find all plugins that want to register handlers
     logger.debug('Loading recipe handlers')
@@ -1315,7 +1316,8 @@ def register_commands(subparsers):
     group.add_argument('-S', '--srcrev', help='Source revision to fetch if fetching from an SCM such as git (default latest)')
     parser_create.add_argument('-B', '--srcbranch', help='Branch in source repository if fetching from an SCM such as git (default master)')
     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('--npm-dev', action="store_true", help='For npm, also fetch devDependencies')
+    parser_create.add_argument('--npm-registry', help='For npm, use the specified registry', type=str)
     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)
-- 
2.20.1



  reply	other threads:[~2019-11-20  9:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  9:33 [PATCH v3 00/17] NPM refactoring Jean-Marie LEMETAYER
2019-11-20  9:33 ` Jean-Marie LEMETAYER [this message]
2019-11-20  9:33 ` [PATCH v3 02/17] npm.bbclass: refactor the npm class Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 03/17] recipetool/create_npm.py: refactor the npm recipe creation handler Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 04/17] lib/oe/package.py: remove unneeded npm_split_package_dirs function Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 05/17] devtool/standard.py: npm: update the append file Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 06/17] recipetool/create.py: npm: remove the 'noverify' url parameter Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 07/17] recipetool/create.py: npm: replace the 'latest' keyword Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 08/17] npm.bbclass: split the do_compile task Jean-Marie LEMETAYER
2019-11-25 13:58   ` Ross Burton
2019-11-20  9:33 ` [PATCH v3 09/17] devtool/standard.py: npm: exclude the node_modules directory Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 10/17] recipetool/create_npm.py: handle the licenses of the dependencies Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 11/17] npm.bbclass: restrict the build to be offline Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 12/17] npm.bbclass: use the local node headers Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 13/17] recipetool/create_npm.py: convert the shrinkwrap file Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 14/17] npm.bbclass: force to rebuild the prebuild addons Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 15/17] devtool/standard.py: npm: configure the NPM_CACHE_DIR to be persistent Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 16/17] oeqa/selftest/recipetool: add npm recipe creation test Jean-Marie LEMETAYER
2019-11-20  9:33 ` [PATCH v3 17/17] oeqa/selftest/devtool: add npm recipe build test Jean-Marie LEMETAYER
2019-11-21  6:27 ` [PATCH v3 00/17] NPM refactoring Tim Orling
2019-11-21  6:36   ` Tim Orling
2019-11-21 13:21     ` Jean-Marie LEMETAYER
2019-11-21 14:07     ` André Draszik
2019-11-21 18:26 ` Richard Purdie
2019-11-21 19:53   ` Jean-Marie LEMETAYER
2019-11-21 20:25     ` Richard Purdie
2019-11-22 11:08       ` Jean-Marie LEMETAYER
2019-11-25 13:55         ` Ross Burton
2019-11-25 15:03           ` Jean-Marie LEMETAYER

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=20191120093358.11622-2-jean-marie.lemetayer@savoirfairelinux.com \
    --to=jean-marie.lemetayer@savoirfairelinux.com \
    --cc=bunk@stusta.de \
    --cc=jonaskgandersson@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    --cc=rennes@savoirfairelinux.com \
    /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.