NetBSD Problem Report #36618

From martin@duskware.de  Mon Jul  9 08:01:18 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 6E9A063B96E
	for <gnats-bugs@gnats.netbsd.org>; Mon,  9 Jul 2007 08:01:18 +0000 (UTC)
Message-Id: <20070709065805.475C763B874@narn.NetBSD.org>
Date: Mon,  9 Jul 2007 06:58:05 +0000 (UTC)
From: cheusov@tut.by
Reply-To: cheusov@tut.by
To: netbsd-bugs-owner@NetBSD.org
Subject: ./bootstrap --unprivileged failes on Interix
X-Send-Pr-Version: www-1.0

>Number:         36618
>Category:       pkg
>Synopsis:       ./bootstrap --unprivileged failes on Interix
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    abs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 09 08:05:00 +0000 2007
>Closed-Date:    
>Last-Modified:  Sun Aug 26 07:00:02 +0000 2012
>Originator:     Aleksey Cheusov
>Release:        Interix 3.5 SP-8.0.1969.1 x86 AMD Athlon/Duron
>Organization:
home
>Environment:
Interix 3.5 SP-8.0.1969.1 x86 AMD Athlon/Duron

>Description:
./bootstrap --unprivileged failes on Interix because of spaces
inside user's group (Domain Users, for example).

Cheusov@syn-fs>
0 bootstrap>./bootstrap --workdir /tmp/obj_pkgsrc --prefix ~/pkg \
--unprivileged
...
ar cr libnbcompat.a glob.o md5c.o md5hl.o rmd160.o rmd160hl.o sha1.o sha1hl.o sha2.o sha2hl.o getopt_long.o vis.o unvis.o asprintf.o fparseln.o lchflags.o lchmod.o lutimes.o mkdtemp.o setgroupent.o setpassent.o setprogname.o strtoll.o utimes.o gettemp.o pwcache.o poll.o
ranlib libnbcompat.a
===> Creating mk.conf.example in /tmp/obj_pkgsrc
===> running: /bin/cp mods/Interix.bsd.lib.mk bsd.lib.mk
===> running: /bin/cp mods/Interix.sys.mk sys.mk
===> running: /bin/sed -e 's|@ROOT_GROUP@|'131616'|g;s|@ROOT_USER@|'1049710'|g;s|@SYSCONFDIR@|'/dev/fs/D/home/Cheusov/pkg/etc'|g' mods/bsd.own.mk.in > bsd.own.mk
===> running: /bin/cp bsd.* sys.mk /dev/fs/D/home/Cheusov/pkg/share/mk
===> Installing BSD compatible install script
===> running: /bin/sh /tmp/obj_pkgsrc/install-sh -c -o Cheusov -g Domain -m 755 /tmp/obj_pkgsrc/install-sh /dev/fs/D/home/Cheusov/pkg/bin/install-sh
chgrp: Domain: Invalid group name
===> exited with status 1
aborted.

Cheusov@syn-fs>
1 bootstrap>

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->interix-pkg-people
Responsible-Changed-By: snj@netbsd.org
Responsible-Changed-When: Tue, 10 Jul 2007 00:20:43 +0000
Responsible-Changed-Why:


From: Aleksey Cheusov <cheusov@tut.by>
To: gnats-bugs@NetBSD.org
Cc: interix-pkg-people@NetBSD.org,  pkg-manager@netbsd.org,
	  pkgsrc-bugs@netbsd.org,  gnats-admin@netbsd.org,  snj@netbsd.org
Subject: Re: pkg/36618 (./bootstrap --unprivileged failes on Interix)
Date: Sat, 13 Sep 2008 10:55:07 +0300

 The following patch fixes this problem.

 Index: mk/unprivileged.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/unprivileged.mk,v
 retrieving revision 1.16
 diff -u -r1.16 unprivileged.mk
 --- mk/unprivileged.mk	4 Mar 2008 06:45:33 -0000	1.16
 +++ mk/unprivileged.mk	13 Sep 2008 07:21:57 -0000
 @@ -129,7 +129,11 @@
  UNPRIVILEGED_USER!=	${ID} -n -u
  .  endif
  .  if !defined(UNPRIVILEGED_GROUP) || empty(UNPRIVILEGED_GROUP)
 +.    if "$(OPSYS)" == "Interix"
 +UNPRIVILEGED_GROUP!=	${ID} -g
 +.    else
  UNPRIVILEGED_GROUP!=	${ID} -n -g
 +.    endif
  .  endif
  .  if !defined(UNPRIVILEGED_GROUPS) || empty(UNPRIVILEGED_GROUPS)
  UNPRIVILEGED_GROUPS!=	${ID} -n -G

 -- 
 Best regards, Aleksey Cheusov.

Responsible-Changed-From-To: interix-pkg-people->abs
Responsible-Changed-By: abs@NetBSD.org
Responsible-Changed-When: Wed, 30 Dec 2009 12:21:36 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->closed
State-Changed-By: abs@NetBSD.org
State-Changed-When: Wed, 30 Dec 2009 12:21:36 +0000
State-Changed-Why:
patch applied - thanks


From: David Brownlee <abs@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/36618 CVS commit: pkgsrc/mk
Date: Wed, 30 Dec 2009 12:21:16 +0000

 Module Name:	pkgsrc
 Committed By:	abs
 Date:		Wed Dec 30 12:21:16 UTC 2009

 Modified Files:
 	pkgsrc/mk: unprivileged.mk

 Log Message:
 pkg PR/36618 - fix UNPRIVILEGED_GROUP definition for Interix


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.18 pkgsrc/mk/unprivileged.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/36618 CVS commit: pkgsrc/mk
Date: Tue, 27 Apr 2010 15:36:24 +0900

 following commit may fix unprivileged bootstrap with space-in-groupname situation,
 but broke binary package creation with USE_DESTDIR=yes.

 UNPRIVILEGED_GROUP will be REAL_ROOT_GROUP with UNPRIVILEGED=yes.
 REAL_ROOT_GROUP will be passed with -g option to pkg_create(1).
 pkg_create(1) try to get gid from group name passed with -g option.
 rise "group XXXX unknown" (XXXX is gid) and failed to create binary package.

 Suggested solution(?):
 1. username/groupname handling should be changed to treat space (escape?)
 2. -u/-g option of pkg_create(1) should also recognize uid/gid

 On Wed, 30 Dec 2009 21:25:02 +0900, David Brownlee <abs@netbsd.org> wrote:

 > The following reply was made to PR pkg/36618; it has been noted by GNATS.
 >
 > From: David Brownlee <abs@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:
 > Subject: PR/36618 CVS commit: pkgsrc/mk
 > Date: Wed, 30 Dec 2009 12:21:16 +0000
 >
 >  Module Name:	pkgsrc
 >  Committed By:	abs
 >  Date:		Wed Dec 30 12:21:16 UTC 2009
 > Modified Files:
 >  	pkgsrc/mk: unprivileged.mk
 > Log Message:
 >  pkg PR/36618 - fix UNPRIVILEGED_GROUP definition for Interix
 > To generate a diff of this commit:
 >  cvs rdiff -u -r1.17 -r1.18 pkgsrc/mk/unprivileged.mk
 > Please note that diffs are not public domain; they are subject to the
 >  copyright notices on the relevant files.
 >


 -- 
 OBATA Akio / obache@NetBSD.org

State-Changed-From-To: closed->open
State-Changed-By: obache@NetBSD.org
State-Changed-When: Thu, 12 Aug 2010 01:29:08 +0000
State-Changed-Why:
This change broke binary pakage creation.


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36618 (./bootstrap --unprivileged failes on Interix)
Date: Sun, 15 Aug 2010 03:04:35 +0000

 As noted in PR 39742 (which I'm closing as a duplicate) this problem
 also applies to user names.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Aleksey Cheusov" <cheusov@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/36618 CVS commit: pkgsrc/mk
Date: Sat, 21 Apr 2012 19:29:47 +0000

 Module Name:	pkgsrc
 Committed By:	cheusov
 Date:		Sat Apr 21 19:29:47 UTC 2012

 Modified Files:
 	pkgsrc/mk: unprivileged.mk

 Log Message:
 Revert the patch commited in PR 36618. It creates more problems
 than it solves on Interix.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 pkgsrc/mk/unprivileged.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Ryo ONODERA <ryo_on@yk.rim.or.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36618 (./bootstrap --unprivileged failes on Interix)
Date: Fri, 24 Aug 2012 12:57:18 +0900 (JST)

 Hi,

 On NetBSD, the following patches helps bootstrap pkgsrc with
 username and groupname with whitespaces.

 The patches include
 * patch for mk/
 * patch for sysutils/install-sh (probably Interix utilizes this, patch is
   provided from soda@)
 * patch for pkgtools/pkg_install .

 I have no Interix test environment, could anyone test my patches?

 http://www.netbsd.org/~ryoon/36618.diff

 Thank you.

 P.S.
 The patches will be needed by upcoming Cygwin port.
 I want to commit this patches.
 And the patches does not support path with whitespace.
 Try, for example, " ./bootstrap --unprivileged --prefix=/tmp/bs".

 --
 Ryo ONODERA // ryo_on@yk.rim.or.jp
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

 diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
 index 171600c..793eb5f 100755
 --- a/bootstrap/bootstrap
 +++ b/bootstrap/bootstrap
 @@ -229,7 +229,7 @@ opsys_finish()
  		fi
  		if [ `uname -r` -lt 6 ]; then
  		        echo_msg "Installing fake ldd script"
 -        		run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
 +        		run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
  			need_extras=yes
  			echo "LDD=			$prefix/sbin/fakeldd" >> ${TARGET_MKCONF}
  		fi
 @@ -275,7 +275,7 @@ run_cmd()
  mkdir_p()
  {
  	for dir in $@; do
 -		run_cmd "$install_sh -d -o $user -g $group $dir"
 +		run_cmd "$install_sh -d -o '$user' -g '$group' $dir"
  	done
  }

 @@ -843,24 +843,24 @@ install_sh="$shprog $wrkdir/bin/install-sh"

  is_root
  if [ $? = 1 ]; then
 -	user=$root_user
 -	group=$root_group
 +	user="$root_user"
 +	group="$root_group"
  else
  	if [ $unprivileged = "no" ]; then
  		die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option."
  	fi

  	user=`$whoamiprog`
 -	group=`$groupsprog | $awkprog '{print $1}'`
 +	group="`$groupsprog`"
  	echo_msg "building as unprivileged user $user/$group"

  	# force bmake install target to use $user and $group
 -	echo "BINOWN=$user
 -BINGRP=$group
 -LIBOWN=$user
 -LIBGRP=$group
 -MANOWN=$user
 -MANGRP=$group" > ${wrkdir}/Makefile.inc
 +	echo 'BINOWN="$user"
 +BINGRP="$group"
 +LIBOWN="$user"
 +LIBGRP="$group"
 +MANOWN="$user"
 +MANGRP="$group"' > ${wrkdir}/Makefile.inc
  fi

  # export the proper environment
 @@ -942,8 +942,8 @@ if [ "$need_bsd_install" = "yes" ]; then
  fi

  if [ "$need_fixed_strip" = "yes" ] ; then
 -	echo_msg "Installing fixed strip script"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip"
 +	cho_msg "Installing fixed strip script"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip"
  	echo "TOOLS_PLATFORM.strip?=		$prefix/bin/strip" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.strip?=		$wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -951,7 +951,7 @@ fi

  if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then
  	echo_msg "Installing fixed mkdir script \"mkdir-sh\""
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh"
  	echo "TOOLS_PLATFORM.mkdir?=		$prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.mkdir?=		$wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -959,7 +959,7 @@ fi

  if [ "$need_xargs" = "yes" ]; then
  	echo_msg "Installing fixed xargs script"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs"
  	echo "TOOLS_PLATFORM.xargs?=		$prefix/bin/xargs" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.xargs?=		$wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -967,15 +967,15 @@ fi

  echo_msg "Bootstrapping mk-files"
  run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \
 - OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \
 -ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \
 + OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=\"${root_group}\" \
 +ROOT_USER=\"${root_user}\" SED=${sedprog} SYSCONFDIR=${sysconfdir} \
  $shprog ./bootstrap.sh)"

  bootstrap_bmake() {
  	echo_msg "Bootstrapping bmake"
  	copy_src $pkgsrcdir/devel/bmake/files bmake
  	run_cmd "(cd $wrkdir/bmake && env $bmakexenv $shprog ./boot-strap $configure_quiet_flags -q -o bootstrap.$opsys --prefix=$wrkdir --sysconfdir=$wrkdir --mksrc none --with-default-sys-path="$wrkdir/share/mk" $bmakexargs)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake"
  }
  bootstrap_bmake

 @@ -992,7 +992,7 @@ yes)	echo_msg "Bootstrapping ksh"
  	copy_src $pkgsrcdir/shells/pdksh/files ksh
  	test -n "$CC" || CC=gcc	# default to gcc if no compiler is specified
  	run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir && $bmake)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
  	echo "TOOLS_PLATFORM.sh?=		$prefix/bin/pdksh" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.sh?=		$wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF}
  	echo "TOOLS_PLATFORM.ksh?=		$prefix/bin/pdksh" >> ${TARGET_MKCONF}
 @@ -1010,7 +1010,7 @@ yes)	echo_msg "Bootstrapping awk"
  	copy_src $pkgsrcdir/lang/nawk/files awk
  	test -n "$CC" || CC=gcc	# default to gcc if no compiler is specified
  	run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
  	echo "TOOLS_PLATFORM.awk?=		$prefix/bin/nawk" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.awk?=		$wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF}
  	;;
 @@ -1021,7 +1021,7 @@ case "$need_sed" in
  yes)	echo_msg "Bootstrapping sed"
  	copy_src $pkgsrcdir/textproc/nbsed/files sed
  	run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
  	echo "TOOLS_PLATFORM.sed?=		$prefix/bin/nbsed" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.sed?=		$wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
  	;;
 @@ -1036,9 +1036,9 @@ LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
  LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
  --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
  --with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
  echo "PKG_ADMIN_CMD?=			$wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
  echo "PKG_CREATE_CMD?=			$wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
  echo "PKG_INFO_CMD?=			$wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
 diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
 index 15944e0..ed13f51 100644
 --- a/mk/bsd.pkg.mk
 +++ b/mk/bsd.pkg.mk
 @@ -99,9 +99,9 @@ SVR4_PKGNAME?=		${PKGNAME}
  WRKSRC?=		${WRKDIR}/${DISTNAME}

  # Override for SU_CMD user check
 -_SU_ROOT_USER?=		${ROOT_USER}
 -REAL_ROOT_USER?=	${ROOT_USER}
 -REAL_ROOT_GROUP?=	${ROOT_GROUP}
 +_SU_ROOT_USER?=		"${ROOT_USER}"
 +REAL_ROOT_USER?=	"${ROOT_USER}"
 +REAL_ROOT_GROUP?=	"${ROOT_GROUP}"

  .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS)
  _INSTALL_UNSTRIPPED=	# set (flag used by platform/*.mk)
 @@ -177,11 +177,11 @@ ALL_ENV+=	PREFIX=${PREFIX}

  # This variable can be added to MAKE_ENV to ease installation of packages
  # that use BSD-style Makefiles.
 -BSD_MAKE_ENV=	BINOWN=${BINOWN} BINGRP=${BINGRP}
 -BSD_MAKE_ENV+=	GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP}
 -BSD_MAKE_ENV+=	MANOWN=${MANOWN} MANGRP=${MANGRP}
 -BSD_MAKE_ENV+=	SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP}
 -BSD_MAKE_ENV+=	DOCOWN=${DOCOWN} DOCGRP=${DOCGRP}
 +BSD_MAKE_ENV=	BINOWN="${BINOWN}" BINGRP="${BINGRP}"
 +BSD_MAKE_ENV+=	GAMEOWN="${GAMEOWN}" GAMEGRP="${GAMEGRP}"
 +BSD_MAKE_ENV+=	MANOWN="${MANOWN}" MANGRP="${MANGRP}"
 +BSD_MAKE_ENV+=	SHAREOWN="${SHAREOWN}" SHAREGRP="${SHAREGRP}"
 +BSD_MAKE_ENV+=	DOCOWN="${DOCOWN}" DOCGRP="${DOCGRP}"
  BSD_MAKE_ENV+=	BINMODE=${BINMODE} NONBINMODE=${NONBINMODE}
  BSD_MAKE_ENV+=	BINDIR=${PREFIX}/bin
  BSD_MAKE_ENV+=	INCSDIR=${PREFIX}/include
 @@ -239,31 +239,31 @@ TOUCH_FLAGS?=		-f
  # A few aliases for *-install targets
  INSTALL=		${TOOLS_INSTALL}	# XXX override sys.mk
  INSTALL_PROGRAM?= 	\
 -	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_GAME?=		\
 -	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE}
 +	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEMODE}
  INSTALL_SCRIPT?= 	\
 -	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_LIB?= 		\
 -	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_DATA?= 		\
 -	${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
 +	${INSTALL} ${COPY} -o "${SHAREOWN}" -g "${SHAREGRP}" -m ${SHAREMODE}
  INSTALL_GAME_DATA?= 	\
 -	${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE}
 +	${INSTALL} ${COPY} -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEDATAMODE}
  INSTALL_MAN?= 		\
 -	${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
 +	${INSTALL} ${COPY} -o "${MANOWN}" -g "${MANGRP}" -m ${MANMODE}
  INSTALL_PROGRAM_DIR?= 	\
 -	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${BINOWN}" -g "${BINGRP}" -m ${PKGDIRMODE}
  INSTALL_GAME_DIR?=		\
 -	${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE}
 +	${INSTALL} -d -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEDIRMODE}
  INSTALL_SCRIPT_DIR?= 	\
  	${INSTALL_PROGRAM_DIR}
  INSTALL_LIB_DIR?= 	\
  	${INSTALL_PROGRAM_DIR}
  INSTALL_DATA_DIR?= 	\
 -	${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${SHAREOWN}" -g "${SHAREGRP}" -m ${PKGDIRMODE}
  INSTALL_MAN_DIR?= 	\
 -	${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${MANOWN}" -g "${MANGRP}" -m ${PKGDIRMODE}

  INSTALL_MACROS=	BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}		\
  		BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}			\
 diff --git a/mk/configure/configure.mk b/mk/configure/configure.mk
 index 6ca30bb..782cef8 100644
 --- a/mk/configure/configure.mk
 +++ b/mk/configure/configure.mk
 @@ -192,7 +192,7 @@ do-configure-post-hook:
  ### do-configure-script runs the configure script to configure the
  ### software for building.
  ###
 -_CONFIGURE_SCRIPT_ENV+=	INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
 +_CONFIGURE_SCRIPT_ENV+=	INSTALL=${INSTALL:Q}\ -c\ -o\ "${BINOWN}"\ -g\ "${BINGRP}"
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_DATA=${INSTALL_DATA:Q}
 diff --git a/mk/configure/gnu-configure.mk b/mk/configure/gnu-configure.mk
 index 0dcc9da..800ba4e 100644
 --- a/mk/configure/gnu-configure.mk
 +++ b/mk/configure/gnu-configure.mk
 @@ -15,7 +15,7 @@ INSTALL_SH_OVERRIDE?=		# empty

  CONFIGURE_ENV+=	CONFIG_SHELL=${CONFIG_SHELL:Q}
  CONFIGURE_ENV+=	LIBS=${LIBS:M*:Q}
 -CONFIGURE_ENV+=	ac_given_INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
 +CONFIGURE_ENV+=	ac_given_INSTALL=${INSTALL:Q}\ -c\ -o\ "${BINOWN}"\ -g\ "${BINGRP}"

  .if (defined(USE_LIBTOOL) || !empty(PKGPATH:Mdevel/libtool-base)) && \
      defined(_OPSYS_MAX_CMDLEN_CMD)
 --- a/pkgtools/bootstrap-mk-files/Makefile
 +++ b/pkgtools/bootstrap-mk-files/Makefile
 @@ -36,9 +36,9 @@ do-configure:
  	else								\
  		own_mk=mods/bsd.own.mk.in;				\
  	fi;								\
 -	${SED}	-e 's|@ROOT_GROUP@|'${REAL_ROOT_GROUP}'|g'			\
 -		-e 's|@ROOT_USER@|'${REAL_ROOT_USER}'|g'			\
 -		-e 's|@SYSCONFDIR@|'${PKG_SYSCONFDIR}'|g'		\
 +	${SED}	-e 's|@ROOT_GROUP@|"${REAL_ROOT_GROUP}"|g'		\
 +		-e 's|@ROOT_USER@|"${REAL_ROOT_USER}"|g'		\
 +		-e 's|@SYSCONFDIR@|${PKG_SYSCONFDIR}|g'			\
  		$$own_mk > bsd.own.mk

  do-install:
 diff --git a/pkgtools/libnbcompat/inplace.mk b/pkgtools/libnbcompat/inplace.mk
 index 34b84b7..bd15cf5 100644
 --- a/pkgtools/libnbcompat/inplace.mk
 +++ b/pkgtools/libnbcompat/inplace.mk
 @@ -45,9 +45,9 @@ libnbcompat-build:
  	cd ${LIBNBCOMPAT_SRCDIR} && ${SETENV}				\
  		AWK=${AWK:Q} CC=${CC:Q} CFLAGS=${CFLAGS:M*:Q}		\
  		CPPFLAGS=${CPPFLAGS:M*:Q}				\
 -		${CONFIGURE_ENV:NLIBS=*} ${CONFIG_SHELL}		\
 +		${CONFIGURE_ENV:NLIBS=*:Q} ${CONFIG_SHELL}		\
  		${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} &&	\
 -		${SETENV} ${MAKE_ENV} ${MAKE}
 +		${SETENV} ${MAKE_ENV:Q} ${MAKE}
  .if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
  	@${STEP_MSG} "Configuring and building libnbcompat (PIC version)"
  	${RUN} ${_ULIMIT_CMD}						\
 diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in
 index 9185cd7..73cc770 100644
 --- a/pkgtools/pkg_install/files/add/Makefile.in
 +++ b/pkgtools/pkg_install/files/add/Makefile.in
 @@ -26,8 +26,6 @@ LIBS+=		-lcrypto
  .endif
  LIBS+=		@LIBS@

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_add

  OBJS=	main.o perform.o
 @@ -44,11 +42,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) -d ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/admin/Makefile.in b/pkgtools/pkg_install/files/admin/Makefile.in
 index 92e4f0f..8089b03 100644
 --- a/pkgtools/pkg_install/files/admin/Makefile.in
 +++ b/pkgtools/pkg_install/files/admin/Makefile.in
 @@ -22,8 +22,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_admin
  SCRIPTS=	audit-packages download-vulnerability-list

 @@ -54,20 +52,20 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man8dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 555 $(SCRIPTS) ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 -	$(INSTALL) -m 444 audit-packages.8 ${DESTDIR}$(man8dir)/
 -	$(INSTALL) -m 444 download-vulnerability-list.8 ${DESTDIR}$(man8dir)/
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man8dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_SCRIPT) $(SCRIPTS) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_MAN) audit-packages.8 ${DESTDIR}$(man8dir)/
 +	$(BSD_INSTALL_MAN) download-vulnerability-list.8 ${DESTDIR}$(man8dir)/
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat8dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 -	$(INSTALL) -m 444 audit-packages.cat ${DESTDIR}$(cat8dir)/audit-packages.0
 -	$(INSTALL) -m 444 download-vulnerability-list.cat ${DESTDIR}$(cat8dir)/download-vulnerability-list.0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat8dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN) audit-packages.cat ${DESTDIR}$(cat8dir)/audit-packages.0
 +	$(BSD_INSTALL_MAN) download-vulnerability-list.cat ${DESTDIR}$(cat8dir)/download-vulnerability-list.0
  .endif

  audit-packages: audit-packages.sh.in
 diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in
 index 70ae4575..2f9dd5c 100644
 --- a/pkgtools/pkg_install/files/create/Makefile.in
 +++ b/pkgtools/pkg_install/files/create/Makefile.in
 @@ -19,8 +19,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_create

  .if empty(BOOTSTRAP)
 @@ -45,11 +43,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/delete/Makefile.in b/pkgtools/pkg_install/files/delete/Makefile.in
 index e1b2483..6dcad2b 100644
 --- a/pkgtools/pkg_install/files/delete/Makefile.in
 +++ b/pkgtools/pkg_install/files/delete/Makefile.in
 @@ -19,8 +19,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_delete

  OBJS=		pkg_delete.o
 @@ -37,11 +35,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/info/Makefile.in b/pkgtools/pkg_install/files/info/Makefile.in
 index ddf6759..c636e3d 100644
 --- a/pkgtools/pkg_install/files/info/Makefile.in
 +++ b/pkgtools/pkg_install/files/info/Makefile.in
 @@ -30,8 +30,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_info

  OBJS=	main.o perform.o show.o
 @@ -48,11 +46,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/lib/Makefile.in b/pkgtools/pkg_install/files/lib/Makefile.in
 index 2613315..7ce5aab 100644
 --- a/pkgtools/pkg_install/files/lib/Makefile.in
 +++ b/pkgtools/pkg_install/files/lib/Makefile.in
 @@ -22,8 +22,6 @@ CPPFLAGS=	@CPPFLAGS@ -I. -I$(srcdir)
  DEFS=		@DEFS@ -DDEF_LOG_DIR=\"$(pkgdbdir)\"
  CFLAGS=		@CFLAGS@

 -INSTALL=	@INSTALL@
 -
  LIB=	libinstall.a

  OBJS=	automatic.o conflicts.o dewey.o fexec.o file.o \
 @@ -57,15 +55,15 @@ clean:
  	rm -f $(OBJS) $(LIB)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man5dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man7dir)
 -	$(INSTALL) -m 444 pkg_summary.5 ${DESTDIR}$(man5dir)/pkg_summary.5
 -	$(INSTALL) -m 444 pkg_install.conf.5 ${DESTDIR}$(man5dir)/pkg_install.conf.5
 -	$(INSTALL) -m 444 pkgsrc.7 ${DESTDIR}$(man7dir)/pkgsrc.7
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man5dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man7dir)
 +	$(BSD_INSTALL_MAN) pkg_summary.5 ${DESTDIR}$(man5dir)/pkg_summary.5
 +	$(BSD_INSTALL_MAN) pkg_install.conf.5 ${DESTDIR}$(man5dir)/pkg_install.conf.5
 +	$(BSD_INSTALL_MAN) pkgsrc.7 ${DESTDIR}$(man7dir)/pkgsrc.7
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat5dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat7dir)
 -	$(INSTALL) -m 444 pkg_summary.cat ${DESTDIR}$(cat5dir)/pkg_summary.0
 -	$(INSTALL) -m 444 pkg_install.conf.cat ${DESTDIR}$(cat5dir)/pkg_install.conf.0
 -	$(INSTALL) -m 444 pkgsrc.cat ${DESTDIR}$(cat7dir)/pkgsrc.0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat5dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat7dir)
 +	$(BSD_INSTALL_MAN) pkg_summary.cat ${DESTDIR}$(cat5dir)/pkg_summary.0
 +	$(BSD_INSTALL_MAN) pkg_install.conf.cat ${DESTDIR}$(cat5dir)/pkg_install.conf.0
 +	$(BSD_INSTALL_MAN) pkgsrc.cat ${DESTDIR}$(cat7dir)/pkgsrc.0
  .endif
 diff --git a/pkgtools/pkg_install/files/view/Makefile.in b/pkgtools/pkg_install/files/view/Makefile.in
 index 1f11af0..8c98a11 100644
 --- a/pkgtools/pkg_install/files/view/Makefile.in
 +++ b/pkgtools/pkg_install/files/view/Makefile.in
 @@ -20,16 +20,16 @@ clean:
  	@true # do nothing

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
  	@for script in $(SCRIPTS); do \
 -		echo "$(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script"; \
 -		$(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script; \
 +		echo "$(BSD_INSTALL_SCRIPT) $$script.sh ${DESTDIR}$(sbindir)/$$script"; \
 +		$(BSD_INSTALL_SCRIPT) $$script.sh ${DESTDIR}$(sbindir)/$$script; \
  	done
  	@for script in $(SCRIPTS); do \
 -		echo "$(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1"; \
 -		$(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1; \
 -		echo "$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0"; \
 -		$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0; \
 +		echo "$(BSD_INSTALL_MAN) $$script.1 ${DESTDIR}$(man1dir)/$$script.1"; \
 +		$(BSD_INSTALL_MAN) $$script.1 ${DESTDIR}$(man1dir)/$$script.1; \
 +		echo "$(BSD_INSTALL_MAN) $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0"; \
 +		$(BSD_INSTALL_MAN) $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0; \
  	done
 diff --git a/sysutils/install-sh/Makefile b/sysutils/install-sh/Makefile
 index 62d7d1c..efcc575 100644
 --- a/sysutils/install-sh/Makefile
 +++ b/sysutils/install-sh/Makefile
 @@ -1,6 +1,6 @@
  # $NetBSD: Makefile,v 1.8 2010/10/08 19:57:05 tez Exp $

 -DISTNAME=	install-sh-20100824
 +DISTNAME=	install-sh-20120823
  CATEGORIES=	sysutils
  MASTER_SITES=	# empty
  DISTFILES=	# empty
 @@ -17,9 +17,9 @@ NO_BUILD=	yes
  # issues.
  #
  INSTALL_SCRIPT=		\
 -	${SH} ${WRKSRC}/install-sh -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${SH} ${WRKSRC}/install-sh -c -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_SCRIPT_DIR=	\
 -	${SH} ${WRKSRC}/install-sh -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE}
 +	${SH} ${WRKSRC}/install-sh -d -o "${BINOWN}" -g "${BINGRP}" -m ${PKGDIRMODE}

  do-extract:
  	@${CP} -R ${FILESDIR} ${WRKSRC}
 diff --git a/sysutils/install-sh/files/install-sh.in b/sysutils/install-sh/files/install-sh.in
 index 003f8db..01b5e3d 100644
 --- a/sysutils/install-sh/files/install-sh.in
 +++ b/sysutils/install-sh/files/install-sh.in
 @@ -90,12 +90,12 @@ while [ x"$1" != x ]; do
  	    shift
  	    continue;;

 -	-o) chowncmd="$chownprog $2"
 +	-o) chownuser="$2"
  	    shift
  	    shift
  	    continue;;

 -	-g) chgrpcmd="$chgrpprog $2"
 +	-g) chgrpgroup="$2"
  	    shift
  	    shift
  	    continue;;
 @@ -213,8 +213,8 @@ while [ $# -ne 0 ] ; do
  	if [ ! -d "${pathcomp}" ] ;
          then
  		$doit $mkdirprog "${pathcomp}"
 -        	if [ x"$chowncmd" != x ]; then $doit $chowncmd "${pathcomp}"; else true ; fi &&
 -        	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "${pathcomp}"; else true ; fi &&
 +        	if [ x"$chownuser" != x ]; then $doit $chownprog "$chownuser" "${pathcomp}"; else true ; fi &&
 +        	if [ x"$chgrpgroup" != x ]; then $doit $chgrpprog "$chgrpgroup" "${pathcomp}"; else true ; fi &&
          	if [ x"$pathcompchmodcmd" != x ]; then $doit $pathcompchmodcmd "${pathcomp}"; else true ; fi

  	else
 @@ -232,8 +232,8 @@ fi
  		else
  			$doit $mkdirprog "$dstarg" &&

 -			if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dstarg"; else true ; fi &&
 -			if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dstarg"; else true ; fi &&
 +			if [ x"$chownuser" != x ]; then $doit $chownprog "$chownuser" "$dstarg"; else true ; fi &&
 +			if [ x"$chgrpgroup" != x ]; then $doit $chgrpprog "$chgrpgroup" "$dstarg"; else true ; fi &&
  			if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dstarg"; else true ; fi
  		fi
  	else


From: Ryo ONODERA <ryo_on@yk.rim.or.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36618 (./bootstrap --unprivileged failes on Interix)
Date: Sun, 26 Aug 2012 04:26:58 +0900 (JST)

 Hi,

 My patch probably have a problem when user have joined to many groups.
 I will fix later.

 Thank you.
 --
 Ryo ONODERA // ryo_on@yk.rim.or.jp
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


From: Ryo ONODERA <ryo_on@yk.rim.or.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/36618 (./bootstrap --unprivileged failes on Interix)
Date: Sun, 26 Aug 2012 15:55:31 +0900 (JST)

 From: Ryo ONODERA <ryo_on@yk.rim.or.jp>, Date: Sun, 26 Aug 2012 04:26:58 +0900 (JST)

 > My patch probably have a problem when user have joined to many groups.
 > I will fix later.

 I have fixed the problem.

 http://www.netbsd.org/~ryoon/36618-2.diff


 diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
 index bfb439b..5ef9a3d 100755
 --- a/bootstrap/bootstrap
 +++ b/bootstrap/bootstrap
 @@ -229,7 +229,7 @@ opsys_finish()
  		fi
  		if [ `uname -r` -lt 6 ]; then
  		        echo_msg "Installing fake ldd script"
 -        		run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
 +        		run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
  			need_extras=yes
  			echo "LDD=			$prefix/sbin/fakeldd" >> ${TARGET_MKCONF}
  		fi
 @@ -275,7 +275,7 @@ run_cmd()
  mkdir_p()
  {
  	for dir in $@; do
 -		run_cmd "$install_sh -d -o $user -g $group $dir"
 +		run_cmd "$install_sh -d -o '$user' -g '$group' $dir"
  	done
  }

  Darwin)
 @@ -581,8 +580,6 @@ Interix)
  		need_xargs=no
  		;;
  	esac
 -	# only used for unprivileged builds
 -	groupsprog="id -gn"
  	# for bootstrap only; pkgsrc uses CPPFLAGS
  	CC="gcc -D_ALL_SOURCE"; export CC
  	ac_cv_header_poll_h=no; export ac_cv_header_poll_h
 @@ -685,7 +682,6 @@ QNX)
  	need_awk=yes
  	need_sed=yes
  	set_opsys=no
 -	groupsprog="id -gn"
  	whoamiprog="id -un"
  	machine_arch=`uname -p | sed -e 's/x86/i386/'`
  	;;
 @@ -718,7 +714,6 @@ SunOS)
  	fi
  	set_opsys=no
  	idprog="/usr/xpg4/bin/id"
 -	groupsprog="${idprog} -gn"
  	whoamiprog="${idprog} -un"
  	machine_arch=`uname -p | sed -e 's/i86pc/i386/'`
  	check_compiler=yes
 @@ -790,8 +785,9 @@ if [ -n "$ID" ]; then
  	idprog="$ID"
  else
  	check_prog idprog id
 +	groupsprog="${idprog} -gn"
  fi
 -check_prog groupsprog groups
 +
  check_prog lnprog ln
  check_prog lsprog ls
  check_prog rmdirprog rmdir
 @@ -843,24 +839,24 @@ install_sh="$shprog $wrkdir/bin/install-sh"

  is_root
  if [ $? = 1 ]; then
 -	user=$root_user
 -	group=$root_group
 +	user="$root_user"
 +	group="$root_group"
  else
  	if [ $unprivileged = "no" ]; then
  		die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option."
  	fi

 -	user=`$whoamiprog`
 -	group=`$groupsprog | $awkprog '{print $1}'`
 +	user="`$whoamiprog`"
 +	group="`$groupsprog`"
  	echo_msg "building as unprivileged user $user/$group"

  	# force bmake install target to use $user and $group
 -	echo "BINOWN=$user
 -BINGRP=$group
 -LIBOWN=$user
 -LIBGRP=$group
 -MANOWN=$user
 -MANGRP=$group" > ${wrkdir}/Makefile.inc
 +	echo 'BINOWN="$user"
 +BINGRP="$group"
 +LIBOWN="$user"
 +LIBGRP="$group"
 +MANOWN="$user"
 +MANGRP="$group"' > ${wrkdir}/Makefile.inc
  fi

  # export the proper environment
 @@ -942,8 +938,8 @@ if [ "$need_bsd_install" = "yes" ]; then
  fi

  if [ "$need_fixed_strip" = "yes" ] ; then
 -	echo_msg "Installing fixed strip script"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip"
 +	cho_msg "Installing fixed strip script"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip"
  	echo "TOOLS_PLATFORM.strip?=		$prefix/bin/strip" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.strip?=		$wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -951,7 +947,7 @@ fi

  if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then
  	echo_msg "Installing fixed mkdir script \"mkdir-sh\""
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh"
  	echo "TOOLS_PLATFORM.mkdir?=		$prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.mkdir?=		$wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -959,7 +955,7 @@ fi

  if [ "$need_xargs" = "yes" ]; then
  	echo_msg "Installing fixed xargs script"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs"
  	echo "TOOLS_PLATFORM.xargs?=		$prefix/bin/xargs" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.xargs?=		$wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF}
  	need_extras=yes
 @@ -967,15 +963,15 @@ fi

  echo_msg "Bootstrapping mk-files"
  run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \
 - OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \
 -ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \
 + OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=\"${root_group}\" \
 +ROOT_USER=\"${root_user}\" SED=${sedprog} SYSCONFDIR=${sysconfdir} \
  $shprog ./bootstrap.sh)"

  bootstrap_bmake() {
  	echo_msg "Bootstrapping bmake"
  	copy_src $pkgsrcdir/devel/bmake/files bmake
  	run_cmd "(cd $wrkdir/bmake && env $bmakexenv $shprog ./boot-strap $configure_quiet_flags -q -o bootstrap.$opsys --prefix=$wrkdir --sysconfdir=$wrkdir --mksrc none --with-default-sys-path="$wrkdir/share/mk" $bmakexargs)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake"
  }
  bootstrap_bmake

 @@ -992,7 +988,7 @@ yes)	echo_msg "Bootstrapping ksh"
  	copy_src $pkgsrcdir/shells/pdksh/files ksh
  	test -n "$CC" || CC=gcc	# default to gcc if no compiler is specified
  	run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir && $bmake)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
  	echo "TOOLS_PLATFORM.sh?=		$prefix/bin/pdksh" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.sh?=		$wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF}
  	echo "TOOLS_PLATFORM.ksh?=		$prefix/bin/pdksh" >> ${TARGET_MKCONF}
 @@ -1010,7 +1006,7 @@ yes)	echo_msg "Bootstrapping awk"
  	copy_src $pkgsrcdir/lang/nawk/files awk
  	test -n "$CC" || CC=gcc	# default to gcc if no compiler is specified
  	run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
  	echo "TOOLS_PLATFORM.awk?=		$prefix/bin/nawk" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.awk?=		$wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF}
  	;;
 @@ -1021,7 +1017,7 @@ case "$need_sed" in
  yes)	echo_msg "Bootstrapping sed"
  	copy_src $pkgsrcdir/textproc/nbsed/files sed
  	run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)"
 -	run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
 +	run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
  	echo "TOOLS_PLATFORM.sed?=		$prefix/bin/nbsed" >> ${TARGET_MKCONF}
  	echo "TOOLS_PLATFORM.sed?=		$wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
  	;;
 @@ -1036,9 +1032,9 @@ LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
  LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
  --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
  --with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
 -run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
 +run_cmd "$install_sh -c -o '$user' -g '$group' -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
  echo "PKG_ADMIN_CMD?=			$wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
  echo "PKG_CREATE_CMD?=			$wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
  echo "PKG_INFO_CMD?=			$wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
 diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
 index 15944e0..ed13f51 100644
 --- a/mk/bsd.pkg.mk
 +++ b/mk/bsd.pkg.mk
 @@ -99,9 +99,9 @@ SVR4_PKGNAME?=		${PKGNAME}
  WRKSRC?=		${WRKDIR}/${DISTNAME}

  # Override for SU_CMD user check
 -_SU_ROOT_USER?=		${ROOT_USER}
 -REAL_ROOT_USER?=	${ROOT_USER}
 -REAL_ROOT_GROUP?=	${ROOT_GROUP}
 +_SU_ROOT_USER?=		"${ROOT_USER}"
 +REAL_ROOT_USER?=	"${ROOT_USER}"
 +REAL_ROOT_GROUP?=	"${ROOT_GROUP}"

  .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS)
  _INSTALL_UNSTRIPPED=	# set (flag used by platform/*.mk)
 @@ -177,11 +177,11 @@ ALL_ENV+=	PREFIX=${PREFIX}

  # This variable can be added to MAKE_ENV to ease installation of packages
  # that use BSD-style Makefiles.
 -BSD_MAKE_ENV=	BINOWN=${BINOWN} BINGRP=${BINGRP}
 -BSD_MAKE_ENV+=	GAMEOWN=${GAMEOWN} GAMEGRP=${GAMEGRP}
 -BSD_MAKE_ENV+=	MANOWN=${MANOWN} MANGRP=${MANGRP}
 -BSD_MAKE_ENV+=	SHAREOWN=${SHAREOWN} SHAREGRP=${SHAREGRP}
 -BSD_MAKE_ENV+=	DOCOWN=${DOCOWN} DOCGRP=${DOCGRP}
 +BSD_MAKE_ENV=	BINOWN="${BINOWN}" BINGRP="${BINGRP}"
 +BSD_MAKE_ENV+=	GAMEOWN="${GAMEOWN}" GAMEGRP="${GAMEGRP}"
 +BSD_MAKE_ENV+=	MANOWN="${MANOWN}" MANGRP="${MANGRP}"
 +BSD_MAKE_ENV+=	SHAREOWN="${SHAREOWN}" SHAREGRP="${SHAREGRP}"
 +BSD_MAKE_ENV+=	DOCOWN="${DOCOWN}" DOCGRP="${DOCGRP}"
  BSD_MAKE_ENV+=	BINMODE=${BINMODE} NONBINMODE=${NONBINMODE}
  BSD_MAKE_ENV+=	BINDIR=${PREFIX}/bin
  BSD_MAKE_ENV+=	INCSDIR=${PREFIX}/include
 @@ -239,31 +239,31 @@ TOUCH_FLAGS?=		-f
  # A few aliases for *-install targets
  INSTALL=		${TOOLS_INSTALL}	# XXX override sys.mk
  INSTALL_PROGRAM?= 	\
 -	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_GAME?=		\
 -	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEMODE}
 +	${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEMODE}
  INSTALL_SCRIPT?= 	\
 -	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_LIB?= 		\
 -	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${INSTALL} ${COPY} -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_DATA?= 		\
 -	${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
 +	${INSTALL} ${COPY} -o "${SHAREOWN}" -g "${SHAREGRP}" -m ${SHAREMODE}
  INSTALL_GAME_DATA?= 	\
 -	${INSTALL} ${COPY} -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDATAMODE}
 +	${INSTALL} ${COPY} -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEDATAMODE}
  INSTALL_MAN?= 		\
 -	${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
 +	${INSTALL} ${COPY} -o "${MANOWN}" -g "${MANGRP}" -m ${MANMODE}
  INSTALL_PROGRAM_DIR?= 	\
 -	${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${BINOWN}" -g "${BINGRP}" -m ${PKGDIRMODE}
  INSTALL_GAME_DIR?=		\
 -	${INSTALL} -d -o ${GAMEOWN} -g ${GAMEGRP} -m ${GAMEDIRMODE}
 +	${INSTALL} -d -o "${GAMEOWN}" -g "${GAMEGRP}" -m ${GAMEDIRMODE}
  INSTALL_SCRIPT_DIR?= 	\
  	${INSTALL_PROGRAM_DIR}
  INSTALL_LIB_DIR?= 	\
  	${INSTALL_PROGRAM_DIR}
  INSTALL_DATA_DIR?= 	\
 -	${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${SHAREOWN}" -g "${SHAREGRP}" -m ${PKGDIRMODE}
  INSTALL_MAN_DIR?= 	\
 -	${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${PKGDIRMODE}
 +	${INSTALL} -d -o "${MANOWN}" -g "${MANGRP}" -m ${PKGDIRMODE}

  INSTALL_MACROS=	BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}		\
  		BSD_INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}			\
 diff --git a/mk/configure/configure.mk b/mk/configure/configure.mk
 index 6ca30bb..782cef8 100644
 --- a/mk/configure/configure.mk
 +++ b/mk/configure/configure.mk
 @@ -192,7 +192,7 @@ do-configure-post-hook:
  ### do-configure-script runs the configure script to configure the
  ### software for building.
  ###
 -_CONFIGURE_SCRIPT_ENV+=	INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
 +_CONFIGURE_SCRIPT_ENV+=	INSTALL=${INSTALL:Q}\ -c\ -o\ "${BINOWN}"\ -g\ "${BINGRP}"
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
  _CONFIGURE_SCRIPT_ENV+=	INSTALL_DATA=${INSTALL_DATA:Q}
 diff --git a/mk/configure/gnu-configure.mk b/mk/configure/gnu-configure.mk
 index 0dcc9da..800ba4e 100644
 --- a/mk/configure/gnu-configure.mk
 +++ b/mk/configure/gnu-configure.mk
 @@ -15,7 +15,7 @@ INSTALL_SH_OVERRIDE?=		# empty

  CONFIGURE_ENV+=	CONFIG_SHELL=${CONFIG_SHELL:Q}
  CONFIGURE_ENV+=	LIBS=${LIBS:M*:Q}
 -CONFIGURE_ENV+=	ac_given_INSTALL=${INSTALL:Q}\ -c\ -o\ ${BINOWN}\ -g\ ${BINGRP}
 +CONFIGURE_ENV+=	ac_given_INSTALL=${INSTALL:Q}\ -c\ -o\ "${BINOWN}"\ -g\ "${BINGRP}"

  .if (defined(USE_LIBTOOL) || !empty(PKGPATH:Mdevel/libtool-base)) && \
      defined(_OPSYS_MAX_CMDLEN_CMD)
 diff --git a/pkgtools/bootstrap-mk-files/Makefile b/pkgtools/bootstrap-mk-files/Makefile
 index e9f9814..1824a7a 100644
 --- a/pkgtools/bootstrap-mk-files/Makefile
 +++ b/pkgtools/bootstrap-mk-files/Makefile
 @@ -36,9 +36,9 @@ do-configure:
  	else								\
  		own_mk=mods/bsd.own.mk.in;				\
  	fi;								\
 -	${SED}	-e 's|@ROOT_GROUP@|'${REAL_ROOT_GROUP}'|g'			\
 -		-e 's|@ROOT_USER@|'${REAL_ROOT_USER}'|g'			\
 -		-e 's|@SYSCONFDIR@|'${PKG_SYSCONFDIR}'|g'		\
 +	${SED}	-e 's|@ROOT_GROUP@|"${REAL_ROOT_GROUP}"|g'		\
 +		-e 's|@ROOT_USER@|"${REAL_ROOT_USER}"|g'		\
 +		-e 's|@SYSCONFDIR@|${PKG_SYSCONFDIR}|g'			\
  		$$own_mk > bsd.own.mk

  do-install:
 diff --git a/pkgtools/libnbcompat/inplace.mk b/pkgtools/libnbcompat/inplace.mk
 index 34b84b7..bd15cf5 100644
 --- a/pkgtools/libnbcompat/inplace.mk
 +++ b/pkgtools/libnbcompat/inplace.mk
 @@ -45,9 +45,9 @@ libnbcompat-build:
  	cd ${LIBNBCOMPAT_SRCDIR} && ${SETENV}				\
  		AWK=${AWK:Q} CC=${CC:Q} CFLAGS=${CFLAGS:M*:Q}		\
  		CPPFLAGS=${CPPFLAGS:M*:Q}				\
 -		${CONFIGURE_ENV:NLIBS=*} ${CONFIG_SHELL}		\
 +		${CONFIGURE_ENV:NLIBS=*:Q} ${CONFIG_SHELL}		\
  		${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} &&	\
 -		${SETENV} ${MAKE_ENV} ${MAKE}
 +		${SETENV} ${MAKE_ENV:Q} ${MAKE}
  .if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
  	@${STEP_MSG} "Configuring and building libnbcompat (PIC version)"
  	${RUN} ${_ULIMIT_CMD}						\
 diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in
 index 9185cd7..73cc770 100644
 --- a/pkgtools/pkg_install/files/add/Makefile.in
 +++ b/pkgtools/pkg_install/files/add/Makefile.in
 @@ -26,8 +26,6 @@ LIBS+=		-lcrypto
  .endif
  LIBS+=		@LIBS@

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_add

  OBJS=	main.o perform.o
 @@ -44,11 +42,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) -d ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/admin/Makefile.in b/pkgtools/pkg_install/files/admin/Makefile.in
 index 92e4f0f..8089b03 100644
 --- a/pkgtools/pkg_install/files/admin/Makefile.in
 +++ b/pkgtools/pkg_install/files/admin/Makefile.in
 @@ -22,8 +22,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_admin
  SCRIPTS=	audit-packages download-vulnerability-list

 @@ -54,20 +52,20 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man8dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 555 $(SCRIPTS) ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 -	$(INSTALL) -m 444 audit-packages.8 ${DESTDIR}$(man8dir)/
 -	$(INSTALL) -m 444 download-vulnerability-list.8 ${DESTDIR}$(man8dir)/
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man8dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_SCRIPT) $(SCRIPTS) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_MAN) audit-packages.8 ${DESTDIR}$(man8dir)/
 +	$(BSD_INSTALL_MAN) download-vulnerability-list.8 ${DESTDIR}$(man8dir)/
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat8dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 -	$(INSTALL) -m 444 audit-packages.cat ${DESTDIR}$(cat8dir)/audit-packages.0
 -	$(INSTALL) -m 444 download-vulnerability-list.cat ${DESTDIR}$(cat8dir)/download-vulnerability-list.0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat8dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN) audit-packages.cat ${DESTDIR}$(cat8dir)/audit-packages.0
 +	$(BSD_INSTALL_MAN) download-vulnerability-list.cat ${DESTDIR}$(cat8dir)/download-vulnerability-list.0
  .endif

  audit-packages: audit-packages.sh.in
 diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in
 index 70ae4575..2f9dd5c 100644
 --- a/pkgtools/pkg_install/files/create/Makefile.in
 +++ b/pkgtools/pkg_install/files/create/Makefile.in
 @@ -19,8 +19,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_create

  .if empty(BOOTSTRAP)
 @@ -45,11 +43,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/delete/Makefile.in b/pkgtools/pkg_install/files/delete/Makefile.in
 index e1b2483..6dcad2b 100644
 --- a/pkgtools/pkg_install/files/delete/Makefile.in
 +++ b/pkgtools/pkg_install/files/delete/Makefile.in
 @@ -19,8 +19,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_delete

  OBJS=		pkg_delete.o
 @@ -37,11 +35,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/info/Makefile.in b/pkgtools/pkg_install/files/info/Makefile.in
 index ddf6759..c636e3d 100644
 --- a/pkgtools/pkg_install/files/info/Makefile.in
 +++ b/pkgtools/pkg_install/files/info/Makefile.in
 @@ -30,8 +30,6 @@ DEFS=		@DEFS@
  CFLAGS=		@CFLAGS@
  LDFLAGS=	@LDFLAGS@ -L../lib

 -INSTALL=	@INSTALL@
 -
  PROG=		pkg_info

  OBJS=	main.o perform.o show.o
 @@ -48,11 +46,11 @@ clean:
  	rm -f $(OBJS) $(PROG)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 -	$(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
 +	$(BSD_INSTALL_MAN) $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 -	$(INSTALL) -m 444 $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_MAN) $(PROG).cat ${DESTDIR}$(cat1dir)/$(PROG).0
  .endif
 diff --git a/pkgtools/pkg_install/files/lib/Makefile.in b/pkgtools/pkg_install/files/lib/Makefile.in
 index 2613315..7ce5aab 100644
 --- a/pkgtools/pkg_install/files/lib/Makefile.in
 +++ b/pkgtools/pkg_install/files/lib/Makefile.in
 @@ -22,8 +22,6 @@ CPPFLAGS=	@CPPFLAGS@ -I. -I$(srcdir)
  DEFS=		@DEFS@ -DDEF_LOG_DIR=\"$(pkgdbdir)\"
  CFLAGS=		@CFLAGS@

 -INSTALL=	@INSTALL@
 -
  LIB=	libinstall.a

  OBJS=	automatic.o conflicts.o dewey.o fexec.o file.o \
 @@ -57,15 +55,15 @@ clean:
  	rm -f $(OBJS) $(LIB)

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man5dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man7dir)
 -	$(INSTALL) -m 444 pkg_summary.5 ${DESTDIR}$(man5dir)/pkg_summary.5
 -	$(INSTALL) -m 444 pkg_install.conf.5 ${DESTDIR}$(man5dir)/pkg_install.conf.5
 -	$(INSTALL) -m 444 pkgsrc.7 ${DESTDIR}$(man7dir)/pkgsrc.7
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man5dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man7dir)
 +	$(BSD_INSTALL_MAN) pkg_summary.5 ${DESTDIR}$(man5dir)/pkg_summary.5
 +	$(BSD_INSTALL_MAN) pkg_install.conf.5 ${DESTDIR}$(man5dir)/pkg_install.conf.5
 +	$(BSD_INSTALL_MAN) pkgsrc.7 ${DESTDIR}$(man7dir)/pkgsrc.7
  .if defined(MANINSTALL) && !empty(MANINSTALL:Mcatinstall)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat5dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat7dir)
 -	$(INSTALL) -m 444 pkg_summary.cat ${DESTDIR}$(cat5dir)/pkg_summary.0
 -	$(INSTALL) -m 444 pkg_install.conf.cat ${DESTDIR}$(cat5dir)/pkg_install.conf.0
 -	$(INSTALL) -m 444 pkgsrc.cat ${DESTDIR}$(cat7dir)/pkgsrc.0
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat5dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat7dir)
 +	$(BSD_INSTALL_MAN) pkg_summary.cat ${DESTDIR}$(cat5dir)/pkg_summary.0
 +	$(BSD_INSTALL_MAN) pkg_install.conf.cat ${DESTDIR}$(cat5dir)/pkg_install.conf.0
 +	$(BSD_INSTALL_MAN) pkgsrc.cat ${DESTDIR}$(cat7dir)/pkgsrc.0
  .endif
 diff --git a/pkgtools/pkg_install/files/view/Makefile.in b/pkgtools/pkg_install/files/view/Makefile.in
 index 1f11af0..8c98a11 100644
 --- a/pkgtools/pkg_install/files/view/Makefile.in
 +++ b/pkgtools/pkg_install/files/view/Makefile.in
 @@ -20,16 +20,16 @@ clean:
  	@true # do nothing

  install:
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(sbindir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
 -	$(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
 +	$(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(sbindir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(man1dir)
 +	$(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(cat1dir)
  	@for script in $(SCRIPTS); do \
 -		echo "$(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script"; \
 -		$(INSTALL) $$script.sh ${DESTDIR}$(sbindir)/$$script; \
 +		echo "$(BSD_INSTALL_SCRIPT) $$script.sh ${DESTDIR}$(sbindir)/$$script"; \
 +		$(BSD_INSTALL_SCRIPT) $$script.sh ${DESTDIR}$(sbindir)/$$script; \
  	done
  	@for script in $(SCRIPTS); do \
 -		echo "$(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1"; \
 -		$(INSTALL) -m 444 $$script.1 ${DESTDIR}$(man1dir)/$$script.1; \
 -		echo "$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0"; \
 -		$(INSTALL) -m 444 $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0; \
 +		echo "$(BSD_INSTALL_MAN) $$script.1 ${DESTDIR}$(man1dir)/$$script.1"; \
 +		$(BSD_INSTALL_MAN) $$script.1 ${DESTDIR}$(man1dir)/$$script.1; \
 +		echo "$(BSD_INSTALL_MAN) $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0"; \
 +		$(BSD_INSTALL_MAN) $$script.cat1 ${DESTDIR}$(cat1dir)/$$script.0; \
  	done
 diff --git a/sysutils/install-sh/Makefile b/sysutils/install-sh/Makefile
 index 62d7d1c..efcc575 100644
 --- a/sysutils/install-sh/Makefile
 +++ b/sysutils/install-sh/Makefile
 @@ -1,6 +1,6 @@
  # $NetBSD: Makefile,v 1.8 2010/10/08 19:57:05 tez Exp $

 -DISTNAME=	install-sh-20100824
 +DISTNAME=	install-sh-20120823
  CATEGORIES=	sysutils
  MASTER_SITES=	# empty
  DISTFILES=	# empty
 @@ -17,9 +17,9 @@ NO_BUILD=	yes
  # issues.
  #
  INSTALL_SCRIPT=		\
 -	${SH} ${WRKSRC}/install-sh -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
 +	${SH} ${WRKSRC}/install-sh -c -o "${BINOWN}" -g "${BINGRP}" -m ${BINMODE}
  INSTALL_SCRIPT_DIR=	\
 -	${SH} ${WRKSRC}/install-sh -d -o ${BINOWN} -g ${BINGRP} -m ${PKGDIRMODE}
 +	${SH} ${WRKSRC}/install-sh -d -o "${BINOWN}" -g "${BINGRP}" -m ${PKGDIRMODE}

  do-extract:
  	@${CP} -R ${FILESDIR} ${WRKSRC}
 diff --git a/sysutils/install-sh/files/install-sh.in b/sysutils/install-sh/files/install-sh.in
 index 003f8db..01b5e3d 100644
 --- a/sysutils/install-sh/files/install-sh.in
 +++ b/sysutils/install-sh/files/install-sh.in
 @@ -90,12 +90,12 @@ while [ x"$1" != x ]; do
  	    shift
  	    continue;;

 -	-o) chowncmd="$chownprog $2"
 +	-o) chownuser="$2"
  	    shift
  	    shift
  	    continue;;

 -	-g) chgrpcmd="$chgrpprog $2"
 +	-g) chgrpgroup="$2"
  	    shift
  	    shift
  	    continue;;
 @@ -213,8 +213,8 @@ while [ $# -ne 0 ] ; do
  	if [ ! -d "${pathcomp}" ] ;
          then
  		$doit $mkdirprog "${pathcomp}"
 -        	if [ x"$chowncmd" != x ]; then $doit $chowncmd "${pathcomp}"; else true ; fi &&
 -        	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "${pathcomp}"; else true ; fi &&
 +        	if [ x"$chownuser" != x ]; then $doit $chownprog "$chownuser" "${pathcomp}"; else true ; fi &&
 +        	if [ x"$chgrpgroup" != x ]; then $doit $chgrpprog "$chgrpgroup" "${pathcomp}"; else true ; fi &&
          	if [ x"$pathcompchmodcmd" != x ]; then $doit $pathcompchmodcmd "${pathcomp}"; else true ; fi

  	else
 @@ -232,8 +232,8 @@ fi
  		else
  			$doit $mkdirprog "$dstarg" &&

 -			if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dstarg"; else true ; fi &&
 -			if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dstarg"; else true ; fi &&
 +			if [ x"$chownuser" != x ]; then $doit $chownprog "$chownuser" "$dstarg"; else true ; fi &&
 +			if [ x"$chgrpgroup" != x ]; then $doit $chgrpprog "$chgrpgroup" "$dstarg"; else true ; fi &&
  			if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dstarg"; else true ; fi
  		fi
  	else


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.