From 6cc98539354607306e213ac90b2dac7cb3e86f73 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Thu, 1 Oct 2015 00:18:32 +0200 Subject: [PATCH] bootstrap: Generate final install.sh during build This solves problem where bootstrap was simply copying ./install.sh.template into ./install.sh. Then first call of ./install.sh was calling ./koch install that was running extra compilation and overwriting ./install.sh with new content. This was overcomplicated, and also caused first `sudo ./install.sh DIR` to run compilation under root account, leaving root owned files in working directory. Now bootstrap calls `./koch geninstall` that just generates ./install.sh without calling it. This ./install.sh is FINAL one, and running it does not generate any files aside passed DIR. This makes whole process simpler. --- bootstrap.sh | 7 +++++-- install.sh.template | 9 --------- 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 install.sh.template diff --git a/bootstrap.sh b/bootstrap.sh index ade74a9aa..7f19c2440 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -12,8 +12,11 @@ cd ".." ./bin/nim c koch ./koch boot -d:release +./koch geninstall -cp -f install.sh.template install.sh -chmod +x install.sh +set +x + +echo +echo 'Install Nim using "./install.sh " or "sudo ./install.sh ".' exit 0 diff --git a/install.sh.template b/install.sh.template deleted file mode 100644 index 1292abdab..000000000 --- a/install.sh.template +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e -set -x - -if [ "$1" != "" ]; then - exec ./koch install "$1" -else - exec ./koch install -fi