Fix #2355.
Pull-Request: #2382
--- /dev/null
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Update out-of-tree projects from oot.txt
+# Each one is cloned in the oot/ directory.
+
+
+# Update the directory
+update_oot() {
+ if test -d "$dir"; then
+ echo "$name: git pull"
+ ../misc/jenkins/unitrun.sh "cmd-$name-pull" git --work-tree="$PWD/$dir" --git-dir="$PWD/$dir/.git" pull -f
+ else
+ echo "$name: git clone"
+ ../misc/jenkins/unitrun.sh "cmd-$name-clone" git clone "$repo" "$dir"
+ fi
+}
+
+# Run trymake with arguments
+trymake_oot() {
+ echo "$name: trymake $@"
+ ../misc/jenkins/trymake.sh "$name" "$dir" "$@"
+}
+
+cmd="$1"
+shift
+
+while read -r repo name; do
+ [[ "$repo" = "#"* ]] && continue
+ [[ "$name" = "" ]] && continue
+ dir="oot/$name"
+ case "$cmd" in
+ list) echo "$name";;
+ update) update_oot;;
+ trymake) trymake_oot "$@";;
+ pre-build) trymake_oot pre-build;;
+ all) update_oot; trymake_oot pre-build all check;;
+ ""|help) echo "usage: oot.sh command [arg...]"; exit 0;;
+ *) echo >&2 "unknown command: $cmd"; exit 1;;
+ esac
+done < oot.txt
--- /dev/null
+# List of out-of-tree repositories
+# Format: repo name
+https://github.com/R4PaSs/brewnit.git brewnit
+https://github.com/Morriar/Missions.git missions
+https://github.com/ppepos/pep8-dbg.git pep8dbg
+https://gitlab.com/xymus/sputnit.git sputnit
all: re_parser re_app
+pre-build: grammar
+
nitcc:
cd ../nitcc && make nitcc
path = key
set_node(path, null)
else
- var parts = line.split("=")
- assert parts.length > 1 else
- print "Error: malformed ini at line {line_number}"
+ var parts = line.split_once_on("=")
+ if parts.length == 1 then
+ continue
end
var key = parts[0].trim
var val = parts[1].trim
--- /dev/null
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Try to make targets (like pre-build). If the rule does on exists this does nothing instead of failing.
+# This also generate xml JUnit files
+#
+# Usage
+#
+# trymake.sh name directory [targets]..
+#
+# Example
+#
+# trymake.sh foo contrib/foo check android
+
+shdir="`dirname "$BASH_SOURCE"`"
+
+name="$1"
+dir="$2"
+shift
+shift
+failed=
+# Check each rules, if they exists
+for rule in "$@"; do
+ make -C "$dir" $rule -n >/dev/null 2>/dev/null || {
+ # Special case for `all` that falls back as the default target
+ if [ "$rule" = "all" ]; then
+ echo "*** make -C $dir ***"
+ $shdir/unitrun.sh "cmd-$name-make" make -C "$dir" ||
+ failed="$failed $name"
+ fi
+ continue
+ }
+ echo "*** make $rule -C $dir ***"
+ $shdir/unitrun.sh "cmd-$name-make$rule" make -C "$dir" $rule ||
+ failed="$failed $name-$rule"
+done
+if test -n "$failed"; then
+ echo "FAILED: $failed"
+ exit 1
+fi
+exit 0
TIME="env time --quiet -f%U -o ${name}.t.out"
elif env time -f%U true 2>/dev/null; then
TIME="env time -f%U -o ${name}.t.out"
+elif env gtime -f%U true 2>/dev/null; then
+ TIME="env gtime -f%U -o ${name}.t.out"
else
TIME=
fi
TIME="env time --quiet -f%U"
elif env time -f%U true 2>/dev/null; then
TIME="env time -f%U"
+elif env gtime -f%U true 2>/dev/null; then
+ TIME="env gtime -f%U"
else
TIME=
fi
fi
# Detect a working hostname command
-if hostname --version | grep coreutils >/dev/null 2>&1; then
+if hostname --version 2>&1 | grep coreutils >/dev/null 2>&1; then
HOSTNAME="hostname"
else
HOSTNAME="hostname -s"