contrib/oot: script to update and check oot projects
authorJean Privat <jean@pryen.org>
Tue, 28 Feb 2017 15:35:44 +0000 (10:35 -0500)
committerJean Privat <jean@pryen.org>
Wed, 1 Mar 2017 18:34:31 +0000 (13:34 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/oot.sh [new file with mode: 0755]
contrib/oot.txt [new file with mode: 0644]
contrib/oot/.gitignore [new file with mode: 0644]
contrib/oot/packages.ini [new file with mode: 0644]

diff --git a/contrib/oot.sh b/contrib/oot.sh
new file mode 100755 (executable)
index 0000000..ff29ba2
--- /dev/null
@@ -0,0 +1,53 @@
+#!/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
diff --git a/contrib/oot.txt b/contrib/oot.txt
new file mode 100644 (file)
index 0000000..933c71f
--- /dev/null
@@ -0,0 +1,6 @@
+# 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
diff --git a/contrib/oot/.gitignore b/contrib/oot/.gitignore
new file mode 100644 (file)
index 0000000..72e8ffc
--- /dev/null
@@ -0,0 +1 @@
+*
diff --git a/contrib/oot/packages.ini b/contrib/oot/packages.ini
new file mode 100644 (file)
index 0000000..e69de29