minimal/do: didn't work correctly with multi-level auto dir creation.

If we tried to build target a/b/c/d and a/b/c didn't exist yet, we
would correctly name the temp file something like a__b/c__d.tmp.  But
if a/b didn't exist yet, we named the temp file a/b__c/d.tmp, which
didn't work.  Instead, name it a/b__c__d.tmp as expected.
This commit is contained in:
Avery Pennarun 2018-11-02 04:17:27 -04:00
commit 2023d36676
3 changed files with 12 additions and 3 deletions

View file

@ -322,10 +322,10 @@ _dir_shovel()
xdir=$1 xbase=$2 xbasetmp=$2
while [ ! -d "$xdir" -a -n "$xdir" ]; do
_dirsplit "${xdir%/}"
xbasetmp=${_dirsplit_base}__$xbase
xbasetmp=${_dirsplit_base}__$xbasetmp
xdir=$_dirsplit_dir xbase=$_dirsplit_base/$xbase
_debug "xbasetmp='$xbasetmp'" >&2
done
_debug "xbasetmp='$xbasetmp'" >&2
}