Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2017 21:30:17 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326581 - head/share/mk
Message-ID:  <201712052130.vB5LUHuJ019360@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Dec  5 21:30:17 2017
New Revision: 326581
URL: https://svnweb.freebsd.org/changeset/base/326581

Log:
  Handle writable-but-not-a-directory cases for writable OBJDIR check.
  
  Sponsored by:	Dell EMC

Modified:
  head/share/mk/src.sys.obj.mk

Modified: head/share/mk/src.sys.obj.mk
==============================================================================
--- head/share/mk/src.sys.obj.mk	Tue Dec  5 21:29:47 2017	(r326580)
+++ head/share/mk/src.sys.obj.mk	Tue Dec  5 21:30:17 2017	(r326581)
@@ -137,7 +137,10 @@ __objdir:=	${MAKEOBJDIR}
 # If the last component is a symlink then recurse on the new path.
 CheckAutoObj= \
 DirIsCreatable() { \
-	[ -w "$${1}" ] && return 0; \
+	if [ -w "$${1}" ]; then \
+		[ -d "$${1}" ] || return 1; \
+		return 0; \
+	fi; \
 	d="$${1}"; \
 	IFS=/; \
 	set -- $${d}; \
@@ -154,13 +157,16 @@ DirIsCreatable() { \
 				ret=0; \
 				DirIsCreatable "$${dir%/}" || ret=$$?; \
 				return $${ret}; \
+			elif [ -e "/$${dir}$${d}" ]; then \
+				return 1; \
 			else \
 				break; \
 			fi; \
 		fi; \
 		dir="$${dir}$${d}/"; \
 	done; \
-	[ -w "$${dir}" ]; \
+	[ -w "$${dir}" ] && [ -d "$${dir}" ] && return 0; \
+	return 1; \
 }; \
 CheckAutoObj() { \
 	if DirIsCreatable "$${1}"; then \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712052130.vB5LUHuJ019360>