diff --git a/builder.py b/builder.py index b655f35..63a6caa 100644 --- a/builder.py +++ b/builder.py @@ -107,7 +107,7 @@ class BuildJob: sf.set_checked() sf.save() return self._after2(0) - if (os.path.exists(t) and not os.path.exists(t + '/.') + if (os.path.exists(t) and not os.path.isdir(t + '/.') and not sf.is_generated): # an existing source file that was not generated by us. # This step is mentioned by djb in his notes. diff --git a/contrib/bash_completion.d/redo b/contrib/bash_completion.d/redo index 46c3621..562ce01 100644 --- a/contrib/bash_completion.d/redo +++ b/contrib/bash_completion.d/redo @@ -23,7 +23,7 @@ __redo_completions() rest=${name#$cur} [ "$cur$rest" != "$name" ] && continue name2="$cur${rest%%/*}" - [ -e "$name2/." ] || echo "$name2" + [ -d "$name2/." ] || echo "$name2" done # targets named explicitly by .do files diff --git a/minimal/do b/minimal/do index 3c17ac8..5bde592 100755 --- a/minimal/do +++ b/minimal/do @@ -99,7 +99,7 @@ _do() { DIR=$1 TARGET=$2 - if [ ! -e "$TARGET" ] || [ -e "$TARGET/." -a ! -e "$TARGET.did" ]; then + if [ ! -e "$TARGET" ] || [ -d "$TARGET/." -a ! -e "$TARGET.did" ]; then printf '%sdo %s%s%s%s\n' \ "$GREEN" "$DO_DEPTH" "$BOLD" "$DIR$TARGET" "$PLAIN" >&2 echo "$PWD/$TARGET" >>"$DO_BUILT" diff --git a/t/default.vartest.do b/t/default.vartest.do new file mode 100644 index 0000000..9aa78cd --- /dev/null +++ b/t/default.vartest.do @@ -0,0 +1,2 @@ +: ${PREFIX=not defined} +echo "$PREFIX" diff --git a/t/vartest.do b/t/vartest.do new file mode 100644 index 0000000..2abd784 --- /dev/null +++ b/t/vartest.do @@ -0,0 +1,3 @@ +PREFIX=/a/b/c/d/e redo vartest2 +read x