GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — fork-nodegit-nodegit/utils/discoverOpenSSLDistros.js at master · marbug/fork-nodegit-nodegit Expand file tree/ Copy pathdiscoverOpenSSLDistros.jsMore file actions 184 lines (165 loc) · 5.77 KB / Copy pathdiscoverOpenSSLDistros.jsFile metadata and controls184 lines (165 loc) · 5.77 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 const cheerio = require("cheerio"); const fse = require("fs-extra"); const path = require("path"); const R = require("ramda"); const request = require("request-promise-native"); const windowsCommonConditions = [ R.test(/^\s*os=Windows$/gm), R.test(/^\s*shared=False$/gm) ]; const macCommonConditions = [ R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*os=Macos$/gm), R.test(/^\s*compiler=apple-clang$/gm), R.test(/^\s*shared=False$/gm) ]; const debugPairs = R.toPairs({ "win32-vs12-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=12$/gm) ]), "win32-vs14-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=14$/gm) ]), "win32-vs15-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=15$/gm) ]), "win64-vs12-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=12$/gm) ]), "win64-vs14-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=14$/gm) ]), "win64-vs15-static-debug": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.runtime=MTd$/gm), R.test(/^\s*compiler\.version=15$/gm) ]), "macOS-clang-9-static-debug": R.allPass([ ...macCommonConditions, R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.version=9.0$/gm) ]), "macOS-clang-8.1-static-debug": R.allPass([ ...macCommonConditions, R.test(/^\s*build_type=Debug$/gm), R.test(/^\s*compiler\.version=8\.1$/gm) ]) }); const releasePairs = R.toPairs({ "win32-vs12-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=12$/gm) ]), "win32-vs14-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=14$/gm) ]), "win32-vs15-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=15$/gm) ]), "win64-vs12-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=12$/gm) ]), "win64-vs14-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=14$/gm) ]), "win64-vs15-static-release": R.allPass([ ...windowsCommonConditions, R.test(/^\s*arch=x86_64$/gm), R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.runtime=MT$/gm), R.test(/^\s*compiler\.version=15$/gm) ]), "macOS-clang-9-static-release": R.allPass([ ...macCommonConditions, R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.version=9.0$/gm) ]), "macOS-clang-8.1-static-release": R.allPass([ ...macCommonConditions, R.test(/^\s*build_type=Release$/gm), R.test(/^\s*compiler\.version=8\.1$/gm) ]) }); const distributionPairs = [...debugPairs, ...releasePairs]; const getDistributionConfigURLFromHash = itemHash => `https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/${itemHash}/conaninfo.txt`; const getDistributionDownloadURLFromHash = itemHash => `https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/${itemHash}/conan_package.tgz`; const getDistributionsRootURL = () => "https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/"; const detectDistributionPairFromConfig = (itemHash, body) => R.pipe( R.find(([_, predicate]) => predicate(body)), (distributionPair) => distributionPair ? [distributionPair[0], getDistributionDownloadURLFromHash(itemHash)] : undefined )(distributionPairs); const getDistributionConfig = (itemHash) => request.get(getDistributionConfigURLFromHash(itemHash)) .then((body) => detectDistributionPairFromConfig(itemHash, body)); const discoverDistributions = (treeHtml) => { const releaseHashes = []; const $ = cheerio.load(treeHtml); $("a").each((_, link) => { const linkText = link.children[0].data; if (!linkText) { return; } // Trim off the trailing '/' const releaseHash = linkText.substring(0, linkText.length - 1); releaseHashes.push(releaseHash); }); return Promise.all( R.map(releaseHash => getDistributionConfig(releaseHash), releaseHashes) ); } const writeFile = (distributions) => fse.ensureDir(path.dirname(outputPath)) .then(fse.writeFile(outputPath, JSON.stringify(distributions, null, 2))); const outputPath = path.resolve(__dirname, "..", "vendor", "static_config", "openssl_distributions.json"); request(getDistributionsRootURL()) .then(discoverDistributions) .then(R.filter(R.identity)) .then(R.sortBy(R.prop(0))) .then(R.fromPairs) .then(writeFile); |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |