MacOS: "-e filename/." returns true even for non-directories.
This has something to do with resource forks. So use "-d filename/." instead, which returns false if filename is not a directory.
This commit is contained in:
parent
97eea66830
commit
c1a1f32445
5 changed files with 8 additions and 3 deletions
|
|
@ -107,7 +107,7 @@ class BuildJob:
|
||||||
sf.set_checked()
|
sf.set_checked()
|
||||||
sf.save()
|
sf.save()
|
||||||
return self._after2(0)
|
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):
|
and not sf.is_generated):
|
||||||
# an existing source file that was not generated by us.
|
# an existing source file that was not generated by us.
|
||||||
# This step is mentioned by djb in his notes.
|
# This step is mentioned by djb in his notes.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ __redo_completions()
|
||||||
rest=${name#$cur}
|
rest=${name#$cur}
|
||||||
[ "$cur$rest" != "$name" ] && continue
|
[ "$cur$rest" != "$name" ] && continue
|
||||||
name2="$cur${rest%%/*}"
|
name2="$cur${rest%%/*}"
|
||||||
[ -e "$name2/." ] || echo "$name2"
|
[ -d "$name2/." ] || echo "$name2"
|
||||||
done
|
done
|
||||||
|
|
||||||
# targets named explicitly by .do files
|
# targets named explicitly by .do files
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ _do()
|
||||||
{
|
{
|
||||||
DIR=$1
|
DIR=$1
|
||||||
TARGET=$2
|
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' \
|
printf '%sdo %s%s%s%s\n' \
|
||||||
"$GREEN" "$DO_DEPTH" "$BOLD" "$DIR$TARGET" "$PLAIN" >&2
|
"$GREEN" "$DO_DEPTH" "$BOLD" "$DIR$TARGET" "$PLAIN" >&2
|
||||||
echo "$PWD/$TARGET" >>"$DO_BUILT"
|
echo "$PWD/$TARGET" >>"$DO_BUILT"
|
||||||
|
|
|
||||||
2
t/default.vartest.do
Normal file
2
t/default.vartest.do
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
: ${PREFIX=not defined}
|
||||||
|
echo "$PREFIX"
|
||||||
3
t/vartest.do
Normal file
3
t/vartest.do
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
PREFIX=/a/b/c/d/e redo vartest2
|
||||||
|
read x <vartest2
|
||||||
|
[ "$x" = "/a/b/c/d/e" ] || exit 45
|
||||||
Loading…
Add table
Add a link
Reference in a new issue