+### deal with tmpdir ###
+precmd=
+if [ -n "$tmpdir" ]; then
+ if [ ! -d "$tmpdir" ]; then
+ info "Temporary directory ($tmpdir) does not exist, creating it."
+ mkdir -p "$tmpdir"
+ [ $? -eq 0 ] || fatal "Could not create temporary directory ($tmpdir)."
+ fi
+ info "Using $tmpdir as TMPDIR"
+ precmd="${precmd}TMPDIR=$tmpdir "
+fi
+