From owner-svn-src-head@freebsd.org Tue Dec 5 21:30:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 011BCE82CAD; Tue, 5 Dec 2017 21:30:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2445716CE; Tue, 5 Dec 2017 21:30:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB5LUHZx019361; Tue, 5 Dec 2017 21:30:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB5LUHuJ019360; Tue, 5 Dec 2017 21:30:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201712052130.vB5LUHuJ019360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 5 Dec 2017 21:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326581 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 326581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 21:30:19 -0000 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 \