]> git.sesse.net Git - remoteglot-book/blobdiff - build-book.sh
Accept and store the computer/human flag.
[remoteglot-book] / build-book.sh
index d9c2876326cd23bf0dcd057aa30607ca54618fab..94f3a298ef6c655f7c296fe24d7b3f1b4da7c462 100755 (executable)
@@ -19,9 +19,14 @@ for X in $( seq 0 $(( MAPPERS - 1 )) ); do
                (
                        PGNNUM=0
                        for FILE in "$@"; do
+                               COMP=0
+                               if echo "$FILE" | grep -q ^comp:; then
+                                       COMP=1
+                                       FILE=$( echo "$FILE" | sed s/comp:// )
+                               fi
                                START=$( ./find-pgn-split-point.sh "$FILE" $X $MAPPERS )
                                END=$( ./find-pgn-split-point.sh "$FILE" $(( X + 1 )) $MAPPERS )
-                               ~/nmu/pgn-extract/pgn-extract --startpos $START --endpos $END --startfilenum $PGNNUM -e -Wsessebin "$FILE" 2>/dev/null
+                               ~/nmu/pgn-extract/pgn-extract --computerflag $COMP --startpos $START --endpos $END --startfilenum $PGNNUM -e -Wsessebin "$FILE" 2>/dev/null
                                PGNNUM=$(( PGNNUM + 1 ))
                        done
                ) | ./binloader - tmp.mtbl.mapper$X $SHARDS 500000