mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
niminst: use 'set -e'; failing to copy docs and data is no installation error
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
discard """
|
||||
file: "system.nim"
|
||||
line: 640
|
||||
errormsg: "type mismatch"
|
||||
"""
|
||||
|
||||
|
||||
1
todo.txt
1
todo.txt
@@ -1,7 +1,6 @@
|
||||
version 0.9.0
|
||||
=============
|
||||
|
||||
- fix the installer
|
||||
- implement 'gorge'
|
||||
- make templates hygienic by default: try to gensym() everything in the 'block'
|
||||
of a template
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# result = "#! /bin/sh\n# Generated from niminst\n" &
|
||||
# "# Template is in tools/buildsh.tmpl\n" &
|
||||
# "# To regenerate run ``niminst csource`` or ``koch csource``\n"
|
||||
|
||||
set -e
|
||||
|
||||
while :
|
||||
do
|
||||
case "$1" in
|
||||
@@ -108,11 +111,11 @@ case $myos in
|
||||
# var linkCmd = ""
|
||||
# for f in items(c.cfiles[osA][cpuA]):
|
||||
echo "$CC $COMP_FLAGS -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}"
|
||||
$CC $COMP_FLAGS -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")} || exit 1
|
||||
$CC $COMP_FLAGS -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
|
||||
# end for
|
||||
echo "$LINKER $LINK_FLAGS -o ?{firstBinPath(c)/toLower(c.name)} ?linkCmd"
|
||||
$LINKER $LINK_FLAGS -o ?{firstBinPath(c)/toLower(c.name)} ?linkCmd || exit 1
|
||||
$LINKER $LINK_FLAGS -o ?{firstBinPath(c)/toLower(c.name)} ?linkCmd
|
||||
;;
|
||||
# end for
|
||||
*)
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||
# var proj = c.name.toLower
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -eq 1 ] ; then
|
||||
# if c.cat[fcUnixBin].len > 0:
|
||||
if test -f ?{c.cat[fcUnixBin][0]}
|
||||
@@ -47,13 +49,13 @@ if [ $# -eq 1 ] ; then
|
||||
docdir="$1/?proj/doc"
|
||||
datadir="$1/?proj/data"
|
||||
|
||||
mkdir -p $1/?proj || exit 1
|
||||
mkdir -p $bindir || exit 1
|
||||
mkdir -p $configdir || exit 1
|
||||
mkdir -p $1/?proj
|
||||
mkdir -p $bindir
|
||||
mkdir -p $configdir
|
||||
;;
|
||||
esac
|
||||
mkdir -p $libdir || exit 1
|
||||
mkdir -p $docdir || exit 1
|
||||
mkdir -p $libdir
|
||||
mkdir -p $docdir
|
||||
echo "copying files..."
|
||||
#var createdDirs = newStringTable()
|
||||
#for cat in fcConfig..fcLib:
|
||||
@@ -63,30 +65,34 @@ if [ $# -eq 1 ] ; then
|
||||
# mk = unixDirVars[cat] & "/" & mk
|
||||
# if not createdDirs.hasKey(mk):
|
||||
# createdDirs[mk] = "true"
|
||||
mkdir -p ?mk || exit 1
|
||||
mkdir -p ?mk
|
||||
# end if
|
||||
# end if
|
||||
# end for
|
||||
#end for
|
||||
|
||||
#for f in items(c.cat[fcUnixBin]):
|
||||
cp ?f $bindir/?f.skipRoot || exit 1
|
||||
cp ?f $bindir/?f.skipRoot
|
||||
chmod 755 $bindir/?f.skipRoot
|
||||
#end for
|
||||
#for f in items(c.cat[fcConfig]):
|
||||
cp ?f $configdir/?f.skipRoot || exit 1
|
||||
cp ?f $configdir/?f.skipRoot
|
||||
chmod 644 $configdir/?f.skipRoot
|
||||
#end for
|
||||
#for f in items(c.cat[fcData]):
|
||||
cp ?f $datadir/?f.skipRoot || exit 1
|
||||
chmod 644 $datadir/?f.skipRoot
|
||||
if [ -f ?f ]; then
|
||||
cp ?f $datadir/?f.skipRoot
|
||||
chmod 644 $datadir/?f.skipRoot
|
||||
fi
|
||||
#end for
|
||||
#for f in items(c.cat[fcDoc]):
|
||||
cp ?f $docdir/?f.skipRoot || exit 1
|
||||
chmod 644 $docdir/?f.skipRoot
|
||||
#for f in items(c.cat[fcDoc]):
|
||||
if [ -f ?f ]; then
|
||||
cp ?f $docdir/?f.skipRoot
|
||||
chmod 644 $docdir/?f.skipRoot
|
||||
fi
|
||||
#end for
|
||||
#for f in items(c.cat[fcLib]):
|
||||
cp ?f $libdir/?f.skipRoot || exit 1
|
||||
#for f in items(c.cat[fcLib]):
|
||||
cp ?f $libdir/?f.skipRoot
|
||||
chmod 644 $libdir/?f.skipRoot
|
||||
#end for
|
||||
|
||||
|
||||
Reference in New Issue
Block a user