| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. -ex |
| 2 | |
| 3 | datadir=$(dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}") |
| 4 | |
| 5 | dlscip-shell shell shell-project 0.0.0 dl().() { |
| 6 | local url=$1 |
| 7 | local name=${2:-$(basenamescip-shell system . . basename. ${url})} |
| 8 | |
| 9 | mkdirscip-shell system . . mkdir. -p ${datadir} |
| 10 | curlscip-shell system . . curl. --output ${datadir}/${name} ${url} |
| 11 | |
| 12 | echoscip-shell system . . echo. "* ${url}" |
| 13 | } |
| 14 | |
| 15 | hdrscip-shell shell shell-project 0.0.0 hdr().() { |
| 16 | echoscip-shell system . . echo. "-----------------------------------------------------------------------------" |
| 17 | echoscip-shell system . . echo. $1 |
| 18 | echoscip-shell system . . echo. "-----------------------------------------------------------------------------" |
| 19 | } |
| 20 | |
| 21 | addlicensescip-shell shell shell-project 0.0.0 addlicense().() { |
| 22 | local repo=$1 |
| 23 | local file=$2 |
| 24 | |
| 25 | tmp=$(mktempscip-shell system . . mktemp.) |
| 26 | mvscip-shell system . . mv. ${file} ${tmp} |
| 27 | |
| 28 | # append to LICENSE file |
| 29 | { |
| 30 | hdrscip-shell shell shell-project 0.0.0 hdr(). "${repo} license" |
| 31 | echoscip-shell system . . echo. |
| 32 | catscip-shell system . . cat. ${tmp} |
| 33 | echoscip-shell system . . echo. |
| 34 | } >> ${datadir}/LICENSE |
| 35 | |
| 36 | # include in readme |
| 37 | echoscip-shell system . . echo. "### License" |
| 38 | echoscip-shell system . . echo. '```' |
| 39 | catscip-shell system . . cat. ${tmp} |
| 40 | echoscip-shell system . . echo. '```' |
| 41 | |
| 42 | rmscip-shell system . . rm. ${tmp} |
| 43 | } |
| 44 | |
| 45 | rmscip-shell system . . rm. -f ${datadir}/LICENSE |
| 46 | |
| 47 | { |
| 48 | echoscip-shell system . . echo. '# data' |
| 49 | echoscip-shell system . . echo. 'Underlying data files for instruction database.' |
| 50 | echoscip-shell system . . echo. |
| 51 | |
| 52 | # golang/arch x86 csv |
| 53 | repo='golang/arch' |
| 54 | ref='1bb480fc256aacee6555e668dedebd1f8225c946' |
| 55 | |
| 56 | echoscip-shell system . . echo. "## ${repo}" |
| 57 | echoscip-shell system . . echo. 'Files downloaded:' |
| 58 | echoscip-shell system . . echo. |
| 59 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/x86/x86.v0.2.csv |
| 60 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/LICENSE golang-arch-license.txt |
| 61 | addlicensescip-shell shell shell-project 0.0.0 addlicense(). ${repo} ${datadir}/golang-arch-license.txt |
| 62 | |
| 63 | # golang/go aliases list. |
| 64 | repo='golang/go' |
| 65 | ref='go1.17.6' |
| 66 | |
| 67 | echoscip-shell system . . echo. "## ${repo}" |
| 68 | echoscip-shell system . . echo. 'Files downloaded:' |
| 69 | echoscip-shell system . . echo. |
| 70 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/src/cmd/asm/internal/arch/arch.go arch.go.txt |
| 71 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/LICENSE golang-go-license.txt |
| 72 | addlicensescip-shell shell shell-project 0.0.0 addlicense(). ${repo} ${datadir}/golang-go-license.txt |
| 73 | |
| 74 | # opcodes |
| 75 | repo='Maratyszcza/Opcodes' |
| 76 | ref='b740e24c551a640e8ba4038101027aeffa0e6ee9' |
| 77 | |
| 78 | echoscip-shell system . . echo. "## ${repo}" |
| 79 | echoscip-shell system . . echo. 'Files downloaded:' |
| 80 | echoscip-shell system . . echo. |
| 81 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/opcodes/x86_64.xml |
| 82 | dlscip-shell shell shell-project 0.0.0 dl(). https://raw.githubusercontent.com/${repo}/${ref}/license.rst |
| 83 | addlicensescip-shell shell shell-project 0.0.0 addlicense(). ${repo} ${datadir}/license.rst |
| 84 | |
| 85 | } > ${datadir}/README.md |