aboutsummaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/find_src.sh21
-rwxr-xr-xscript/generate_rendu.sh26
2 files changed, 47 insertions, 0 deletions
diff --git a/script/find_src.sh b/script/find_src.sh
new file mode 100755
index 0000000..1d645a1
--- /dev/null
+++ b/script/find_src.sh
@@ -0,0 +1,21 @@
+#!bin/sh
+
+if [ $# -ne 1 ]; then
+ echo "Usage $0 ignore_file"
+ exit 1
+fi
+
+IGNORE_FILE=$1
+
+if [ ! -e $IGNORE_FILE ]; then
+ echo "Ignore file doesnt exist"
+ exit 1
+fi
+
+SRC_DIR=src
+
+IGNORE_FIND_ARGS=`sed 's/.*/-not -path "&"/' $IGNORE_FILE | paste -sd " "`
+IGNORE_FIND_ARGS="$IGNORE_FIND_ARGS -not -name \"*inter*\""
+
+sh -c "find $SRC_DIR $IGNORE_FIND_ARGS -name \"*.c\""
+# find $SRC_DIR $IGNORE_FIND_ARGS -name "*.c"
diff --git a/script/generate_rendu.sh b/script/generate_rendu.sh
new file mode 100755
index 0000000..1b68a97
--- /dev/null
+++ b/script/generate_rendu.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if [ "$(git status --porcelain)" ]
+then
+ echo "Error: Your working directory isn't clean"
+ exit
+fi
+
+BASE_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
+RENDU_BRANCH_NAME="rendu-$BASE_BRANCH_NAME"
+
+if [ -z $(git show-ref --verify --quiet refs/heads/$RENDU_BRANCH_NAME) ]
+then
+ echo "Error: $RENDU_BRANCH_NAME was already generated"
+ exit
+fi
+
+git checkout -b $RENDU_BRANCH_NAME
+RENDU_IGNORE=$(sed -n 's/RENDU_IGNORE=//p')
+make fclean
+rm -f $RENDU_IGNORE
+
+# generate makefile strict src
+
+git add .
+git commit --message "Generated commit: creation of rendu for $BASE_BRANCH_NAME"