Last active
August 29, 2015 14:23
-
-
Save webmaster128/35ac1b65fd61cfee8e6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| set -v | |
| REPO="https://github.com/randombit/botan.git" | |
| BRANCH="master" | |
| datetime() { | |
| date --rfc-3339=seconds | |
| } | |
| start=$(date +%s) | |
| PATH="/usr/lib/ccache:$PATH" | |
| which cc c++ gcc g++ | |
| WD="/run/shm/botan-tmp" | |
| mkdir -p "$WD" | |
| PD="$HOME/botan-testing" | |
| mkdir -p "$PD" | |
| export CCACHE_DIR="$WD/ccache" | |
| mkdir -p "$CCACHE_DIR" | |
| # Ccache info | |
| ccache -s | |
| LOG="$PD/log_$(datetime).txt" | |
| MODFILE="$PD/modlist.txt" | |
| # Clear logfile | |
| echo -n "" > "$LOG" | |
| COUNTER=0 | |
| cd "$WD" | |
| echo "Cloning repository ..." >> "$LOG" | |
| rm -rf ./botan | |
| git clone "$REPO" | |
| cd ./botan | |
| git checkout "$BRANCH" | |
| echo "Done cloning repository" >> "$LOG" | |
| # Log code position | |
| (git status; echo ""; echo "---"; echo ""; git log -n 3) | cat -n >> "$LOG" | |
| modlist=$(./configure.py | grep "INFO: Loading modules" | cut -c 26-) | |
| modlist="$modlist cvc" | |
| echo "$modlist" | tr ' ' '\n' | sort > $MODFILE | |
| datetime >> "$LOG" | |
| echo "$modlist" >> "$LOG" | |
| echo "" >> "$LOG" | |
| while read a; do | |
| while read b; do | |
| while read c; do | |
| COUNTER=$((COUNTER+1)) | |
| d=$(datetime) | |
| mods="$a,$b,$c" | |
| cmd="./configure.py --link-method=hardlink --no-autoload --enable-modules='$mods'" | |
| runtime=$(($(date +%s) - start)) | |
| echo -n "$COUNTER. (${runtime}s) $d: $mods ..." >> "$LOG" | |
| # echo " $cmd" >> "$LOG" | |
| echo "|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|" | |
| echo "Starting $mods ..." | |
| echo "$cmd" | |
| echo "|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|" | |
| git clean -xdf | |
| $cmd | |
| make -j 4 | |
| echo " ok." >> "$LOG" | |
| done < $MODFILE | |
| done < $MODFILE | |
| done < $MODFILE | |
| echo "$(datetime): Done." >> "$LOG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment