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