diff --git a/config.nims b/config.nims index da72649d4..50672979c 100644 --- a/config.nims +++ b/config.nims @@ -1,6 +1,8 @@ # to allow locking if dirExists("nimbledeps/pkgs"): switch("NimblePath", "nimbledeps/pkgs") +if dirExists("nimbledeps/pkgs2"): + switch("NimblePath", "nimbledeps/pkgs2") switch("warning", "CaseTransition:off") switch("warning", "ObservableStores:off") diff --git a/libp2p.nimble b/libp2p.nimble index 85ba6bf91..2644f6fef 100644 --- a/libp2p.nimble +++ b/libp2p.nimble @@ -143,10 +143,20 @@ task install_pinned, "Reads the lockfile": if system.dirExists("nimbledeps/pkgs"): "nimbledeps/pkgs" else: "nimbledeps/pkgs2" for dependency in listDirs(nimblePkgs): - let filename = dependency.extractFilename - if toInstall.anyIt(filename.startsWith(it[0]) and - filename.endsWith(it[1].split('#')[^1])) == false: - rmDir(dependency) + let + fileName = dependency.extractFilename + fileContent = readFile(dependency & "/nimblemeta.json") + packageName = fileName.split('-')[0] + + if toInstall.anyIt( + it[0] == packageName and + ( + it[1].split('#')[^1] in fileContent or # nimble for nim 2.X + fileName.endsWith(it[1].split('#')[^1]) # nimble for nim 1.X + ) + ) == false or + fileName.split('-')[^1].len < 20: # safegard for nimble for nim 1.X + rmDir(dependency) task unpin, "Restore global package use": rmDir("nimbledeps") diff --git a/nimble.lock b/nimble.lock deleted file mode 100644 index 2c0d98666..000000000 --- a/nimble.lock +++ /dev/null @@ -1,208 +0,0 @@ -{ - "version": 1, - "packages": { - "unittest2": { - "version": "0.0.5", - "vcsRevision": "da8398c45cafd5bd7772da1fc96e3924a18d3823", - "url": "https://github.com/status-im/nim-unittest2", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "b3f8493a4948989ef3e645a38b23aad77e851e26" - } - }, - "testutils": { - "version": "0.5.0", - "vcsRevision": "dfc4c1b39f9ded9baf6365014de2b4bfb4dafc34", - "url": "https://github.com/status-im/nim-testutils", - "downloadMethod": "git", - "dependencies": [ - "unittest2" - ], - "checksums": { - "sha1": "756d0757c4dd06a068f9d38c7f238576ba5ee897" - } - }, - "stew": { - "version": "0.1.0", - "vcsRevision": "7184d2424dc3945657884646a72715d494917aad", - "url": "https://github.com/status-im/nim-stew", - "downloadMethod": "git", - "dependencies": [ - "unittest2" - ], - "checksums": { - "sha1": "f3125ed2fd126dfd3edbaea14275abd9fa57d703" - } - }, - "bearssl": { - "version": "0.2.0", - "vcsRevision": "a647994910904b0103a05db3a5ec1ecfc4d91a88", - "url": "https://github.com/status-im/nim-bearssl", - "downloadMethod": "git", - "dependencies": [ - "unittest2" - ], - "checksums": { - "sha1": "d634751df2716ea9975912a2d5d0a090bb6bcfa9" - } - }, - "httputils": { - "version": "0.3.0", - "vcsRevision": "a85bd52ae0a956983ca6b3267c72961d2ec0245f", - "url": "https://github.com/status-im/nim-http-utils", - "downloadMethod": "git", - "dependencies": [ - "stew", - "unittest2" - ], - "checksums": { - "sha1": "92933b21bcd29335f68e377e2b2193fa331e28b3" - } - }, - "chronos": { - "version": "3.0.11", - "vcsRevision": "75d030ff71264513fb9701c75a326cd36fcb4692", - "url": "https://github.com/status-im/nim-chronos", - "downloadMethod": "git", - "dependencies": [ - "stew", - "bearssl", - "httputils", - "unittest2" - ], - "checksums": { - "sha1": "57a674ba3c1a57a694fa7810d93ceb68f338a861" - } - }, - "faststreams": { - "version": "0.3.0", - "vcsRevision": "b42daf41d8eb4fbce40add6836bed838f8d85b6f", - "url": "https://github.com/status-im/nim-faststreams", - "downloadMethod": "git", - "dependencies": [ - "stew", - "chronos", - "unittest2" - ], - "checksums": { - "sha1": "62f7ac8fb200a8ecb9e6c63f5553a7dad66ae613" - } - }, - "serialization": { - "version": "0.1.0", - "vcsRevision": "d77417cba6896c26287a68e6a95762e45a1b87e5", - "url": "https://github.com/status-im/nim-serialization", - "downloadMethod": "git", - "dependencies": [ - "faststreams", - "unittest2", - "stew" - ], - "checksums": { - "sha1": "e17244c6654de22254acb9bcf71d8ddbeca8b2aa" - } - }, - "metrics": { - "version": "0.0.1", - "vcsRevision": "21e99a2e9d9f80e68bef65c80ef781613005fccb", - "url": "https://github.com/status-im/nim-metrics", - "downloadMethod": "git", - "dependencies": [ - "chronos" - ], - "checksums": { - "sha1": "ab1c994bbcd6b04f2500f05d8ea4e463f33dd310" - } - }, - "nimcrypto": { - "version": "0.5.4", - "vcsRevision": "24e006df85927f64916e60511620583b11403178", - "url": "https://github.com/cheatfate/nimcrypto", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "a4db2105de265930f1578bb7957f49fa39b10d9b" - } - }, - "json_serialization": { - "version": "0.1.0", - "vcsRevision": "a7d815ed92f200f490c95d3cfd722089cc923ce6", - "url": "https://github.com/status-im/nim-json-serialization", - "downloadMethod": "git", - "dependencies": [ - "serialization", - "stew" - ], - "checksums": { - "sha1": "50fc34a992ef3df68a7bee88af096bb8ed42572f" - } - }, - "chronicles": { - "version": "0.10.3", - "vcsRevision": "32ac8679680ea699f7dbc046e8e0131cac97d41a", - "url": "https://github.com/status-im/nim-chronicles", - "downloadMethod": "git", - "dependencies": [ - "testutils", - "json_serialization" - ], - "checksums": { - "sha1": "79f09526d4d9b9196dd2f6a75310d71a890c4f88" - } - }, - "zlib": { - "version": "0.1.0", - "vcsRevision": "6a6670afba6b97b29b920340e2641978c05ab4d8", - "url": "https://github.com/status-im/nim-zlib", - "downloadMethod": "git", - "dependencies": [ - "stew" - ], - "checksums": { - "sha1": "2621e46369be2a6846713e8c3d681a5bba3e0325" - } - }, - "websock": { - "version": "0.1.0", - "vcsRevision": "691f069b209d372b1240d5ae1f57fb7bbafeaba7", - "url": "https://github.com/status-im/nim-websock", - "downloadMethod": "git", - "dependencies": [ - "chronos", - "httputils", - "chronicles", - "stew", - "nimcrypto", - "bearssl", - "zlib" - ], - "checksums": { - "sha1": "c71edfce064e7c0cadde0e687c6edc0caaf9ec07" - } - }, - "dnsclient": { - "version": "0.3.2", - "vcsRevision": "fcd7443634b950eaea574e5eaa00a628ae029823", - "url": "https://github.com/ba0f3/dnsclient.nim", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "146aa4a8d512a3a786c5bf54311b79900166d9d7" - } - }, - "secp256k1": { - "version": "0.5.2", - "vcsRevision": "fd173fdff863ce2e211cf64c9a03bc7539fe40b0", - "url": "https://github.com/status-im/nim-secp256k1", - "downloadMethod": "git", - "dependencies": [ - "stew", - "nimcrypto" - ], - "checksums": { - "sha1": "657c79f6f2b1b6da92a9cda81ffc9f95d26443cb" - } - } - } -} \ No newline at end of file