- case "$corpus_size" in
- small)
- mail_subdir="mail/enron/bailey-s"
- check_for="${TEST_DIRECTORY}/corpus/$mail_subdir"
- ;;
- medium)
- mail_subdir="mail/notmuch-archive"
- check_for="${TEST_DIRECTORY}/corpus/$mail_subdir"
- ;;
- *)
- mail_subdir=mail
- check_for="${TEST_DIRECTORY}/corpus/$mail_subdir/enron/wolfe-j"
- esac
-
- MAIL_CORPUS="${TEST_DIRECTORY}/corpus/$mail_subdir"
- args=()
- if [ ! -d "$check_for" ] ; then
- args+=("notmuch-email-corpus/$mail_subdir")
+ CORPUS_DIR=${TEST_DIRECTORY}/corpus
+ mkdir -p "${CORPUS_DIR}"
+
+ MAIL_CORPUS="${CORPUS_DIR}/mail.${corpus_size}"
+ TAG_CORPUS="${CORPUS_DIR}/tags"
+
+ if command -v pixz > /dev/null; then
+ XZ=pixz
+ else
+ XZ=xz
+ fi
+
+ if [ ! -d "${CORPUS_DIR}/manifest" ]; then
+
+ printf "Unpacking manifests\n"
+ tar --extract --use-compress-program ${XZ} --strip-components=1 \
+ --directory ${TEST_DIRECTORY}/corpus \
+ --wildcards --file ../download/notmuch-email-corpus-${PERFTEST_VERSION}.tar.xz \
+ 'notmuch-email-corpus/manifest/*'