]> code.ossystems Code Review - openembedded-core.git/commitdiff
(PRE)MIRRORS: fix pattern for npm:// without slash
authorOlaf Mandel <o.mandel@menlosystems.com>
Fri, 25 Aug 2017 17:01:57 +0000 (17:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Aug 2017 10:13:52 +0000 (11:13 +0100)
For URIs with the npm:// transport but with no other slash in it, the
common MIRRORS and PREMIRRORS pattern of npm://.*/.* fails to match.
Make the last slash in the pattern optional in the mirros.bbclass and
own-mirrors.bbclass classes.

Many URIs with the npm:// transport have no slash after the host part:

  npm://registry.npmjs.org;name=foo;version=0.1.2

This means that MIRRORS and PREMIRRORS containing entries like the
first one will not match these URIs:

  npm://.*/.*   # fails to match
  npm://.*/?.*  # matches this and URIs with path components

For normal regular expressions, a pattern like 'npm://.*(/.*)?' would
probably be preferred, but that won't work here: the pattern gets split
into the substrings 'npm', '.*(' and '/.*)?', which are not valid
regular expressions individually.

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/mirrors.bbclass
meta/classes/own-mirrors.bbclass

index b98684f5c6dbec2384a1b071466d65f38fe4f92f..766f1cb6fade8b83b07216110a12f773bde3eefd 100644 (file)
@@ -48,7 +48,7 @@ p4://.*/.*      http://downloads.yoctoproject.org/mirror/sources/ \n \
 osc://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
 https?$://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
 ftp://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
-npm://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+npm://.*/?.*    http://downloads.yoctoproject.org/mirror/sources/ \n \
 cvs://.*/.*     http://sources.openembedded.org/ \n \
 svn://.*/.*     http://sources.openembedded.org/ \n \
 git://.*/.*     http://sources.openembedded.org/ \n \
@@ -58,7 +58,7 @@ p4://.*/.*      http://sources.openembedded.org/ \n \
 osc://.*/.*     http://sources.openembedded.org/ \n \
 https?$://.*/.* http://sources.openembedded.org/ \n \
 ftp://.*/.*     http://sources.openembedded.org/ \n \
-npm://.*/.*     http://sources.openembedded.org/ \n \
+npm://.*/?.*    http://sources.openembedded.org/ \n \
 ${CPAN_MIRROR}  http://cpan.metacpan.org/ \n \
 ${CPAN_MIRROR}  http://search.cpan.org/CPAN/ \n \
 "
index 12b42675bc4ae4d35658aa185e036a217713a63e..0296d545be454ab9e748eac04d22acc1a3d83ae5 100644 (file)
@@ -9,5 +9,5 @@ p4://.*/.*      ${SOURCE_MIRROR_URL}
 osc://.*/.*     ${SOURCE_MIRROR_URL}
 https?$://.*/.* ${SOURCE_MIRROR_URL}
 ftp://.*/.*     ${SOURCE_MIRROR_URL}
-npm://.*/.*     ${SOURCE_MIRROR_URL}
+npm://.*/?.*    ${SOURCE_MIRROR_URL}
 }