Open ghost opened 4 years ago
an attempt to solve this:
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js
index 86e92f85208..f77b60c985b 100755
--- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js
+++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/internal/fixup_yarn_lock.js
@@ -34,7 +34,16 @@ readFile
result.push(` resolved "${fileName}#${shaOrRev}"`)
} else {
- result.push(line)
+ const arr2 = line.match(/^ {2}resolved "(.+)\/([^\/"]+)"$/)
+ if (arr2 !== null) {
+ const [_, url, shaOrRev] = arr2
+
+ const fileName = urlToName(url + '/' + shaOrRev)
+
+ result.push(` resolved "${fileName}"`)
+ } else {
+ result.push(line)
+ }
}
})
.on('close', () => {
For all lockfile entries with a 'resolved' containing a
#
character, they are changed by fixup_yarn_lock.js to contain a reference that matches the file name in the offline cache, for example:is changed to
However, some dependencies are not matched by the regex in fixup_yarn_lock.js and thus are not changed to refer to the correct filename:
Note how this does not contain a
#
character. Calling buildYarnPackage will complain about not being able to fetch the dependency, because it can not find a corresponding file in the offline cache.