cd $BUILD_DIRECTORY &&
mk_source_dir "$SOURCE_DIRECTORY" &&
verify_file '' &&
xz -dc $SOURCE_CACHE/$SOURCE | tar -xf - &&

# find all the pdfs, strip the extension and then check if their source is
# also present. If it is, remove the pdf.
if [[ $TTMF_SMALL == y ]]; then
  find "$SOURCE_DIRECTORY" -type f -iname "*.pdf" | sed 's,....$,,' |
    while read p; do
      if [[ -e "$p.pdf" && -e "$p.tex" ]]; then
        rm "$p.pdf"
      fi
    done
fi
