diff --git a/usr.sbin/postinstall/postinstall b/usr.sbin/postinstall/postinstall index 378cc7444b4b..2ff3067f7e1b 100755 --- a/usr.sbin/postinstall/postinstall +++ b/usr.sbin/postinstall/postinstall @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: postinstall,v 1.209 2017/01/09 19:51:31 christos Exp $ +# $NetBSD: postinstall,v 1.210 2017/02/11 19:35:45 uwe Exp $ # # Copyright (c) 2002-2015 The NetBSD Foundation, Inc. # All rights reserved. @@ -523,7 +523,7 @@ obsolete_paths() failed=0 while read ofile; do - if ! file_exists_exact "${ofile}"; then + if ! ${file_exists_exact} "${ofile}"; then continue fi ofile="${DEST_DIR}${ofile#.}" @@ -534,6 +534,8 @@ obsolete_paths() elif [ -d "${ofile}" ]; then ftype="directory" cmd="rmdir" + elif [ ! -e "${ofile}" ]; then + continue fi if [ "${op}" = "check" ]; then msg "Remove obsolete ${ftype} ${ofile}" @@ -2328,6 +2330,16 @@ main() DIRMODE=false # true if "-s" specified a directory SOURCEMODE=false # true if "-s" specified a source directory + case "$(uname -s)" in + Darwin) + # case sensitive match for case insensitive fs + file_exists_exact=file_exists_exact + ;; + *) + file_exists_exact=: + ;; + esac + while getopts s:x:d:m:a: ch; do case "${ch}" in s)