From 5ce414141ed2141591006da4b0261d51d9be32d6 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 7 Jan 2017 10:39:00 +0100 Subject: koch.nim: critical fix for the tar.xz installations --- koch.nim | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'koch.nim') diff --git a/koch.nim b/koch.nim index f117f136c..d5b756420 100644 --- a/koch.nim +++ b/koch.nim @@ -188,21 +188,25 @@ proc buildNimble(latest: bool) = # here so that it cannot cause problems (nimble bug #306): if dirExists("bin/nimblepkg"): removeDir("bin/nimblepkg") + # if koch is used for a tar.xz, build the dist/nimble we shipped + # with the tarball: var installDir = "dist/nimble" - if not dirExists("dist/nimble/.git"): - # if dist/nimble exist, but is not a git repo, don't mess with it: - if dirExists(installDir): - var id = 0 - while dirExists("dist/nimble" & $id): - inc id - installDir = "dist/nimble" & $id - exec("git clone https://github.com/nim-lang/nimble.git " & installDir) - withDir(installDir): - if latest: - exec("git checkout -f master") - else: - exec("git checkout -f stable") - exec("git pull") + if not latest and dirExists(installDir) and not dirExists("dist/nimble/.git"): + discard "don't do the git dance" + else: + if not dirExists("dist/nimble/.git"): + if dirExists(installDir): + var id = 0 + while dirExists("dist/nimble" & $id): + inc id + installDir = "dist/nimble" & $id + exec("git clone https://github.com/nim-lang/nimble.git " & installDir) + withDir(installDir): + if latest: + exec("git checkout -f master") + else: + exec("git checkout -f stable") + exec("git pull") nimexec("c --noNimblePath -p:compiler " & installDir / "src/nimble.nim") copyExe(installDir / "src/nimble".exe, "bin/nimble".exe) -- cgit 1.4.1-2-gfad0 e='0bb76dde547ff9f3e80f7421d4f2c556d7aefc4d'/>
path: root/build_all.sh
blob: 6828bbbd8fd2cd9843d2f7dba150b414eb6840fb (plain) (blame)
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