mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Use mktemp to create workspace directory
mktemp is a better idea for security, as well as enabling users to specify a different directory using the TMPDIR environment variable, which is useful if /tmp is a small tmpfs. Also fix a bug where the first few log messages were failing as the workspace directory wasn't been created early enough.
This commit is contained in:
parent
c0133ecfa6
commit
de789ac8ea
@ -49,11 +49,8 @@ source `dirname $0`/tesstrain_utils.sh
|
||||
ARGV=("$@")
|
||||
parse_flags
|
||||
|
||||
tlog "\n=== Starting training for language '${LANG_CODE}'"
|
||||
|
||||
tlog "Cleaning workspace directory ${TRAINING_DIR}..."
|
||||
mkdir -p ${TRAINING_DIR}
|
||||
rm -fr ${TRAINING_DIR}/*
|
||||
tlog "\n=== Starting training for language '${LANG_CODE}'"
|
||||
|
||||
source `dirname $0`/language-specific.sh
|
||||
set_lang_specific_parameters ${LANG_CODE}
|
||||
|
@ -25,7 +25,7 @@ OUTPUT_DIR="/tmp/tesstrain/tessdata"
|
||||
OVERWRITE=0
|
||||
RUN_SHAPE_CLUSTERING=0
|
||||
EXTRACT_FONT_PROPERTIES=1
|
||||
WORKSPACE_DIR="/tmp/tesstrain"
|
||||
WORKSPACE_DIR=`mktemp -d`
|
||||
EXPOSURES=0
|
||||
|
||||
# Logging helper functions.
|
||||
|
Loading…
Reference in New Issue
Block a user