#!/bin/bash unset DISPLAY unset LUI if [ -z "${LOGONROOT}" ]; then echo "transfer: unable to determiner \$LOGONROOT directory; exit." exit 1; fi # # include a shared set of shell functions and global parameters, including the # architecture identifier .LOGONOS. # . ${LOGONROOT}/etc/library.bash date=$(date "+%Y-%m-%d") count=1 limit=2000 source="--source" client=noen analysis=norgram skeletons=norsk while [ $# -gt 0 -a "${1#-}" != "$1" ]; do case ${1} in --binary) source=""; shift 1; ;; --source) source="--source"; shift 1; ;; --jaen) client=jaen; analysis=jacy; skeletons=nihongo; shift 1; ;; --deen) client=deen; analysis=gg; skeletons=deutsch; shift 1; ;; -g|--gold) gold="${2}"; shift 2; ;; -f|--filter) filter=true; shift 1; ;; -c|--count) count=${2}; echo "batch: ignoring --count argument (PR itsdb/323)." count=1 shift 2; ;; -l|--limit) limit=${2}; shift 2; ;; -b|--best) best=${2}; shift 2; ;; -s|--suffix) suffix="${2}"; shift 2; ;; -d|--debug) debug=true; shift 1; ;; esac done skeleton=tur; if [ ! -z "${1}" ]; then skeleton=${1}; fi if [ -z "${gold}" ]; then gold="gold/${analysis}/${skeleton}"; fi if [ -z "${LOGONTMP}" ]; then LOGONTMP=${HOME} fi LOG=${LOGONTMP}/${skeleton}.transfer.${date}.log { options=":error :exit :wait 300" # # when running from source, configure and compile the LOGON system # if [ -n "${source}" ]; then echo "(load \"${LOGONROOT}/lingo/lkb/src/general/loadup.lisp\")"; echo "(pushnew :lkb *features*)"; echo "(pushnew :mrs *features*)"; echo "(pushnew :tsdb *features*)"; echo "(pushnew :mt *features*)"; echo "(pushnew :logon *features*)"; echo "(setf (system:getenv \"DISPLAY\") nil)"; echo "(compile-system \"tsdb\")"; fi # # make sure to initialize [incr tsdb()] against our own start-up file # echo "(tsdb::initialize-tsdb nil :rc \"${LOGONROOT}/dot.tsdbrc\")"; if [ -n "${skeletons}" ]; then echo "(tsdb:tsdb :skeletons \"${LOGONROOT}/lingo/lkb/src/tsdb/skeletons/${skeletons}\")"; fi; if [ "${limit}" != "nil" -a "${limit}" != "0" ]; then echo "(setf tsdb::*tsdb-maximal-number-of-results* ${limit})"; fi; if [ -n "${best}" ]; then echo "(setf tsdb::*tsdb-maximal-number-of-analyses* ${best})"; fi; \ echo "(setf tsdb::*tsdb-maximal-number-of-edges* 1000)"; echo "(setf tsdb::*process-suppress-duplicates* nil)"; echo "(setf tsdb::*process-raw-print-trace-p* t)"; reset="t"; while [ ${count} -ge 1 ]; do echo "(tsdb:tsdb :cpu :${client} :task :transfer :file t :reset ${reset} ${options})"; count=$[${count} - 1]; reset="nil"; done; echo "(setf target (format nil \"~a~a\" (tsdb::suggest-test-run-directory \"${skeleton}\" :absolute nil) \"${suffix}\"))"; echo "(tsdb:tsdb :create target :skeleton \"${skeleton}\")"; if [ -n "${debug}" ]; then : fi; echo "(tsdb::tsdb-do-process target :type :transfer :overwrite t :gold \"${gold}\")"; if [ "$filter" ]; then echo "(setf tsdb::*filter-test* '(:syntax :cscope :unet :fragmentation))"; echo "(tsdb::purge-profile-cache target)"; echo "(tsdb::browse-results target :file \"/dev/null\")"; fi echo "(excl:exit)"; } | ${LOGONROOT}/bin/logon ${source} \ -I base -locale no_NO.UTF-8 -qq 2>&1 | tee ${LOG}