Hi,

I am facing an issue with compiling tex files under directories with spaces
in the name through texi2dvi (version 6991). Apparently mkdir internally is
not passed with a "safe" version of the path which results in the error
mkdir: cannot create directory ‘dir ...

pdflatex and variants work OK on my platform (Ubuntu 16.04) and the oddest
thing of all is that texi2dvi I have on a Mac OS X system (version 5381)
works fine.

Attached is the output form texi2dvi --debug on a test file.

Any input will be much appreciated.

Thanks in advance,

Ioannis
# 
   Main program main loop - TeXify each file in turn.
for command_line_filename
do
  verbose "Processing $command_line_filename ..."

  input_file_name_decode

  # `texinfo' or `latex'?
  in_lang=`compute_language "$command_line_filename"`

  # An auxiliary directory used for all the auxiliary tasks involved
  # in compiling this document.
  case $build_dir in
      '' | . ) t2ddir=$out_noext.t2d ;;
      *) # Avoid collisions between multiple occurrences of the same
         # file, so depend on the output path.  Remove leading `./',
         # at least to avoid creating a file starting with `.!', i.e.,
         # an invisible file. The sed expression is fragile if the cwd
         # has active characters.  Transform / into ! so that we don't
         # need `mkdir -p'.  It might be something to reconsider.
         t2ddir=$build_dir/`echo "$out_dir_abs/$out_noext.t2d" |
             $SED "s,^$orig_pwd/,,;s,^\./,,;s,/,!,g"`
  esac
  # Remove it at exit if clean mode.
  trap "cleanup" 0 HUP INT TERM

  ensure_dir "$build_dir" "$t2ddir"

  # We will change directory, better work with an absolute path...
  t2ddir=`absolute "$t2ddir"`
  # Sometimes there are incompatibilities between auxiliary files for
  # DVI and PDF.  The contents can also change whether we work on PDF
  # and/or DVI.  So keep separate spaces for each.
  workdir=$t2ddir/`out_lang_tex`
  ensure_dir "$workdir"

  # _build.  In a tidy build, where the auxiliary files are output.
  if $tidy; then
    work_build=$workdir/build
  else
    work_build=.
  fi

  # _bak.  Copies of the previous auxiliary files (another round is
  # run if they differ from the new ones).
  work_bak=$workdir/bak

  # Make those directories.
  ensure_dir "$work_build" "$work_bak"

  # Decide how to find auxiliary files created by TeX.
  decide_aux_files_method
  
  case $action in
    compile)
      # Compile the document.
      compile
      cleanup
      ;;

    mostly-clean)
      xref_files_new=`generated_files_get`
      mostly_clean
      ;;
  esac
done
+ verbose Processing mytex.tex ...
+ false
+ input_file_name_decode
+ echo mytex.tex
+ LC_ALL=C egrep ^(/|[A-Za-z]:/)
+ command_line_filename=./mytex.tex
+ test -r ./mytex.tex
+ func_dirname ./mytex.tex
+ dirname ./mytex.tex
+ in_dir=.
+ absolute .
+ echo .
+ sed -n s,.*[^/]\(/*\)$,\1,p
+ absolute_slashes=
+ func_dirname .
+ dirname .
+ absolute_rel=/home/yiannis/Downloads/tex dir/.
+ test -d /home/yiannis/Downloads/tex dir/.
+ cd /home/yiannis/Downloads/tex dir/.
+ pwd
+ basename .
+ absolute_name=/home/yiannis/Downloads/tex dir/.
+ echo /home/yiannis/Downloads/tex dir/.
+ in_dir_abs=/home/yiannis/Downloads/tex dir/.
+ false
+ basename ./mytex.tex
+ in_base=mytex.tex
+ noext mytex.tex
+ echo mytex.tex
+ sed -e s/\.[^/.][^/.]*$//
+ in_noext=mytex
+ in_input=./mytex.tex
+ test x != x
+ out_lang_ext
+ echo pdf
+ out_name=mytex.pdf
+ func_dirname mytex.pdf
+ dirname mytex.pdf
+ out_dir=.
+ absolute .
+ echo .
+ sed -n s,.*[^/]\(/*\)$,\1,p
+ absolute_slashes=
+ func_dirname .
+ dirname .
+ absolute_rel=/home/yiannis/Downloads/tex dir/.
+ test -d /home/yiannis/Downloads/tex dir/.
+ cd /home/yiannis/Downloads/tex dir/.
+ pwd
+ basename .
+ absolute_name=/home/yiannis/Downloads/tex dir/.
+ echo /home/yiannis/Downloads/tex dir/.
+ out_dir_abs=/home/yiannis/Downloads/tex dir/.
+ basename mytex.pdf
+ out_base=mytex.pdf
+ noext mytex.pdf
+ echo mytex.pdf+ 
sed -e s/\.[^/.][^/.]*$//
+ out_noext=mytex
+ compute_language ./mytex.tex
+ test -n 
+ sed 1q ./mytex.tex
+ grep input texinfo
+ echo latex
+ in_lang=latex
+ t2ddir=mytex.t2d
+ trap cleanup 0 HUP INT TERM
+ ensure_dir . mytex.t2d
+ test -d .
+ test -d mytex.t2d
+ mkdir mytex.t2d
+ absolute mytex.t2d
+ echo mytex.t2d
+ sed -n s,.*[^/]\(/*\)$,\1,p
+ absolute_slashes=
+ func_dirname mytex.t2d
+ dirname mytex.t2d
+ absolute_rel=/home/yiannis/Downloads/tex dir/.
+ test -d /home/yiannis/Downloads/tex dir/.
+ cd /home/yiannis/Downloads/tex dir/.
+ pwd
+ basename mytex.t2d
+ absolute_name=/home/yiannis/Downloads/tex dir/mytex.t2d
+ echo /home/yiannis/Downloads/tex dir/mytex.t2d
+ t2ddir=/home/yiannis/Downloads/tex dir/mytex.t2d
+ out_lang_tex
+ echo pdf
+ workdir=/home/yiannis/Downloads/tex dir/mytex.t2d/pdf
+ ensure_dir /home/yiannis/Downloads/tex dir/mytex.t2d/pdf
+ test -d /home/yiannis/Downloads/tex dir/mytex.t2d/pdf
+ mkdir /home/yiannis/Downloads/tex dir/mytex.t2d/pdf
+ false
+ work_build=.
+ work_bak=/home/yiannis/Downloads/tex dir/mytex.t2d/pdf/bak
+ ensure_dir . /home/yiannis/Downloads/tex dir/mytex.t2d/pdf/bak
+ test -d .
+ test -d /home/yiannis/Downloads/tex dir/mytex.t2d/pdf/bak
+ mkdir /home/yiannis/Downloads/tex dir/mytex.t2d/pdf/bak
+ decide_aux_files_method
+ test -n 
+ TEXI2DVI_USE_RECORDER=nomaybe
+ check_openout_in_log_support
+ verbose Checking TeX \openout in log support...
+ false
+ make_openout_test  log
+ ensure_dir /home/yiannis/Downloads/tex dir/mytex.t2d/pdf/check_recorder
+ test -d /home/yiannis/Downloads/tex
+ test -d dir/mytex.t2d/pdf/check_recorder
+ mkdir dir/mytex.t2d/pdf/check_recorder
mkdir: cannot create directory ‘dir/mytex.t2d/pdf/check_recorder’: No such file 
or directory
+ test -d dir/mytex.t2d/pdf/check_recorder
+ error 1 cannot create directory: dir/mytex.t2d/pdf/check_recorder
+ error_status=1
+ shift
+ report cannot create directory: dir/mytex.t2d/pdf/check_recorder
+ echo /usr/bin/texi2dvi: cannot create directory: 
dir/mytex.t2d/pdf/check_recorder
/usr/bin/texi2dvi: cannot create directory: dir/mytex.t2d/pdf/check_recorder
+ test 1 != 0
+ exit 1
+ cleanup
+ cd_orig
+ cd /
+ cd /home/yiannis/Downloads/tex dir
+ remove /home/yiannis/Downloads/tex dir/mytex.t2d
+ verbose Removing /home/yiannis/Downloads/tex dir/mytex.t2d
+ false
+ rm -rf /home/yiannis/Downloads/tex dir/mytex.t2d

Reply via email to