diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/npmsw.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/npmsw.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/bitbake/lib/bb/fetch2/npmsw.py b/bitbake/lib/bb/fetch2/npmsw.py index a8c4d3528f..36fcbfba15 100644 --- a/bitbake/lib/bb/fetch2/npmsw.py +++ b/bitbake/lib/bb/fetch2/npmsw.py | |||
@@ -129,10 +129,28 @@ class NpmShrinkWrap(FetchMethod): | |||
129 | 129 | ||
130 | localpath = os.path.join(d.getVar("DL_DIR"), localfile) | 130 | localpath = os.path.join(d.getVar("DL_DIR"), localfile) |
131 | 131 | ||
132 | # Handle local tarball and link sources | ||
133 | elif version.startswith("file"): | ||
134 | localpath = version[5:] | ||
135 | if not version.endswith(".tgz"): | ||
136 | unpack = False | ||
137 | |||
132 | # Handle git sources | 138 | # Handle git sources |
133 | elif version.startswith("git"): | 139 | elif version.startswith(("git", "bitbucket","gist")) or ( |
140 | not version.endswith((".tgz", ".tar", ".tar.gz")) | ||
141 | and not version.startswith((".", "@", "/")) | ||
142 | and "/" in version | ||
143 | ): | ||
134 | if version.startswith("github:"): | 144 | if version.startswith("github:"): |
135 | version = "git+https://github.com/" + version[len("github:"):] | 145 | version = "git+https://github.com/" + version[len("github:"):] |
146 | elif version.startswith("gist:"): | ||
147 | version = "git+https://gist.github.com/" + version[len("gist:"):] | ||
148 | elif version.startswith("bitbucket:"): | ||
149 | version = "git+https://bitbucket.org/" + version[len("bitbucket:"):] | ||
150 | elif version.startswith("gitlab:"): | ||
151 | version = "git+https://gitlab.com/" + version[len("gitlab:"):] | ||
152 | elif not version.startswith(("git+","git:")): | ||
153 | version = "git+https://github.com/" + version | ||
136 | regex = re.compile(r""" | 154 | regex = re.compile(r""" |
137 | ^ | 155 | ^ |
138 | git\+ | 156 | git\+ |
@@ -158,12 +176,6 @@ class NpmShrinkWrap(FetchMethod): | |||
158 | 176 | ||
159 | url = str(uri) | 177 | url = str(uri) |
160 | 178 | ||
161 | # Handle local tarball and link sources | ||
162 | elif version.startswith("file"): | ||
163 | localpath = version[5:] | ||
164 | if not version.endswith(".tgz"): | ||
165 | unpack = False | ||
166 | |||
167 | else: | 179 | else: |
168 | raise ParameterError("Unsupported dependency: %s" % name, ud.url) | 180 | raise ParameterError("Unsupported dependency: %s" % name, ud.url) |
169 | 181 | ||