diff options
authorOlaf Mandel <>2017-08-25 17:01:57 +0000
committerRichard Purdie <>2017-08-30 11:13:52 +0100
commit0d1e2b4507af28fc451b8fa94130a39ac342637d (patch)
parent38d4672ee9fe2d9ef341875434562be8bca7d9bb (diff)
(PRE)MIRRORS: fix pattern for npm:// without slash
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://;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 <> Signed-off-by: Richard Purdie <>
2 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/mirrors.bbclass b/meta/classes/mirrors.bbclass
index b98684f5c6..766f1cb6fa 100644
--- a/meta/classes/mirrors.bbclass
+++ b/meta/classes/mirrors.bbclass
@@ -48,7 +48,7 @@ p4://.*/.* \n \
osc://.*/.* \n \
https?$://.*/.* \n \
ftp://.*/.* \n \
-npm://.*/.* \n \
+npm://.*/?.* \n \
cvs://.*/.* \n \
svn://.*/.* \n \
git://.*/.* \n \
@@ -58,7 +58,7 @@ p4://.*/.* \n \
osc://.*/.* \n \
https?$://.*/.* \n \
ftp://.*/.* \n \
-npm://.*/.* \n \
+npm://.*/?.* \n \
diff --git a/meta/classes/own-mirrors.bbclass b/meta/classes/own-mirrors.bbclass
index 12b42675bc..0296d545be 100644
--- a/meta/classes/own-mirrors.bbclass
+++ b/meta/classes/own-mirrors.bbclass
@@ -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}