diff options
Diffstat (limited to 'contrib/bmake/mk/install-mk')
-rwxr-xr-x[-rw-r--r--] | contrib/bmake/mk/install-mk | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk index 7d0ee92c9397..c9941bb4247e 100644..100755 --- a/contrib/bmake/mk/install-mk +++ b/contrib/bmake/mk/install-mk @@ -28,6 +28,10 @@ # -g "group" # Use "group" for installed files. # +# -U "umask" +# Use "umask" so directories are created with suitable +# mode (default is 022). +# # var=val # Set "var" to "val". See below. # @@ -55,9 +59,9 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: install-mk,v 1.217 2022/03/25 23:43:43 sjg Exp $ +# $Id: install-mk,v 1.250 2024/03/10 02:57:17 sjg Exp $ # -# @(#) Copyright (c) 1994 Simon J. Gerraty +# @(#) Copyright (c) 1994-2023 Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. @@ -70,7 +74,7 @@ # sjg@crufty.net # -MK_VERSION=20220323 +MK_VERSION=20240309 OWNER= GROUP= MODE=444 @@ -79,6 +83,8 @@ ECHO=: SKIP= cp_f=-f +umask 022 + while : do case "$1" in @@ -91,6 +97,7 @@ do -v) ECHO=echo; shift;; -q) ECHO=:; shift;; -n) ECHO=echo SKIP=:; shift;; + -U) umask $2; shift;; --) shift; break;; *) break;; esac @@ -131,6 +138,12 @@ realpath() { echo $1 } +# some Linux systems have deprecated egrep in favor of grep -E +case "`echo bmake | egrep 'a' 2>&1`" in +*"grep -E"*) egrep='grep -E';; +*) egrep=egrep;; +esac + if [ -s $SYS_MK -a -d $dest ]; then # if this is a BSD system we don't want to touch $SYS_MK dest=`realpath $dest` @@ -160,8 +173,8 @@ if [ $mksrc = $dest ]; then SKIP_MKFILES=: else # we do not install the examples - mk_files=`grep '^[a-z].*\.mk' FILES | egrep -v '(examples/|^sys\.mk|sys/)'` - mk_scripts=`egrep '^[a-z].*\.(sh|py)' FILES | egrep -v '/'` + mk_files=`grep '^[a-z].*\.mk' FILES | $egrep -v '(examples/|^sys\.mk|sys/)'` + mk_scripts=`$egrep '^[a-z].*[.-](sh|py)' FILES | $egrep -v '/'` sys_mk_files=`grep 'sys/.*\.mk' FILES` SKIP_MKFILES= [ -z "$SKIP_SYS_MK" ] && mk_files="sys.mk $mk_files" |