Handle writable-but-not-a-directory cases for writable OBJDIR check.
Sponsored by: Dell EMC
This commit is contained in:
parent
e22224a5c2
commit
302bf4c180
@ -137,7 +137,10 @@ __objdir:= ${MAKEOBJDIR}
|
|||||||
# If the last component is a symlink then recurse on the new path.
|
# If the last component is a symlink then recurse on the new path.
|
||||||
CheckAutoObj= \
|
CheckAutoObj= \
|
||||||
DirIsCreatable() { \
|
DirIsCreatable() { \
|
||||||
[ -w "$${1}" ] && return 0; \
|
if [ -w "$${1}" ]; then \
|
||||||
|
[ -d "$${1}" ] || return 1; \
|
||||||
|
return 0; \
|
||||||
|
fi; \
|
||||||
d="$${1}"; \
|
d="$${1}"; \
|
||||||
IFS=/; \
|
IFS=/; \
|
||||||
set -- $${d}; \
|
set -- $${d}; \
|
||||||
@ -154,13 +157,16 @@ DirIsCreatable() { \
|
|||||||
ret=0; \
|
ret=0; \
|
||||||
DirIsCreatable "$${dir%/}" || ret=$$?; \
|
DirIsCreatable "$${dir%/}" || ret=$$?; \
|
||||||
return $${ret}; \
|
return $${ret}; \
|
||||||
|
elif [ -e "/$${dir}$${d}" ]; then \
|
||||||
|
return 1; \
|
||||||
else \
|
else \
|
||||||
break; \
|
break; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
dir="$${dir}$${d}/"; \
|
dir="$${dir}$${d}/"; \
|
||||||
done; \
|
done; \
|
||||||
[ -w "$${dir}" ]; \
|
[ -w "$${dir}" ] && [ -d "$${dir}" ] && return 0; \
|
||||||
|
return 1; \
|
||||||
}; \
|
}; \
|
||||||
CheckAutoObj() { \
|
CheckAutoObj() { \
|
||||||
if DirIsCreatable "$${1}"; then \
|
if DirIsCreatable "$${1}"; then \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user