head	1.1;
branch	1.1.1;
access;
symbols
	RELENG_8_4:1.1.1.4.0.18
	RELENG_9_1_0_RELEASE:1.1.1.4
	RELENG_9_1:1.1.1.4.0.16
	RELENG_9_1_BP:1.1.1.4
	RELENG_8_3_0_RELEASE:1.1.1.4
	RELENG_8_3:1.1.1.4.0.14
	RELENG_8_3_BP:1.1.1.4
	RELENG_9_0_0_RELEASE:1.1.1.4
	RELENG_9_0:1.1.1.4.0.12
	RELENG_9_0_BP:1.1.1.4
	RELENG_9:1.1.1.4.0.10
	RELENG_9_BP:1.1.1.4
	RELENG_7_4_0_RELEASE:1.1.1.3.2.1
	RELENG_8_2_0_RELEASE:1.1.1.4
	RELENG_7_4:1.1.1.3.2.1.0.8
	RELENG_7_4_BP:1.1.1.3.2.1
	RELENG_8_2:1.1.1.4.0.8
	RELENG_8_2_BP:1.1.1.4
	RELENG_8_1_0_RELEASE:1.1.1.4
	RELENG_8_1:1.1.1.4.0.6
	RELENG_8_1_BP:1.1.1.4
	RELENG_7_3_0_RELEASE:1.1.1.3.2.1
	RELENG_7_3:1.1.1.3.2.1.0.6
	RELENG_7_3_BP:1.1.1.3.2.1
	RELENG_8_0_0_RELEASE:1.1.1.4
	RELENG_8_0:1.1.1.4.0.4
	RELENG_8_0_BP:1.1.1.4
	RELENG_8:1.1.1.4.0.2
	RELENG_8_BP:1.1.1.4
	RELENG_7_2_0_RELEASE:1.1.1.3.2.1
	RELENG_7_2:1.1.1.3.2.1.0.4
	RELENG_7_2_BP:1.1.1.3.2.1
	RELENG_7_1_0_RELEASE:1.1.1.3.2.1
	RELENG_6_4_0_RELEASE:1.1.1.2.14.2
	RELENG_7_1:1.1.1.3.2.1.0.2
	RELENG_7_1_BP:1.1.1.3.2.1
	RELENG_6_4:1.1.1.2.14.2.0.2
	RELENG_6_4_BP:1.1.1.2.14.2
	v5_6_20080503:1.1.1.4
	RELENG_7_0_0_RELEASE:1.1.1.3
	v5_6_20080209:1.1.1.4
	RELENG_6_3_0_RELEASE:1.1.1.2.14.1
	v5_6_20071222:1.1.1.4
	RELENG_7_0:1.1.1.3.0.4
	RELENG_7_0_BP:1.1.1.3
	RELENG_6_3:1.1.1.2.14.1.0.2
	RELENG_6_3_BP:1.1.1.2.14.1
	RELENG_7:1.1.1.3.0.2
	RELENG_7_BP:1.1.1.3
	v5_6_20061217:1.1.1.3
	RELENG_6_2_0_RELEASE:1.1.1.2
	RELENG_6_2:1.1.1.2.0.22
	RELENG_6_2_BP:1.1.1.2
	RELENG_5_5_0_RELEASE:1.1.1.2
	RELENG_5_5:1.1.1.2.0.20
	RELENG_5_5_BP:1.1.1.2
	RELENG_6_1_0_RELEASE:1.1.1.2
	RELENG_6_1:1.1.1.2.0.18
	RELENG_6_1_BP:1.1.1.2
	RELENG_6_0_0_RELEASE:1.1.1.2
	RELENG_6_0:1.1.1.2.0.16
	RELENG_6_0_BP:1.1.1.2
	RELENG_6:1.1.1.2.0.14
	RELENG_6_BP:1.1.1.2
	RELENG_5_4_0_RELEASE:1.1.1.2
	RELENG_5_4:1.1.1.2.0.12
	RELENG_5_4_BP:1.1.1.2
	RELENG_4_11_0_RELEASE:1.1.1.1.2.1
	RELENG_4_11:1.1.1.1.2.1.0.18
	RELENG_4_11_BP:1.1.1.1.2.1
	RELENG_5_3_0_RELEASE:1.1.1.2
	RELENG_5_3:1.1.1.2.0.10
	RELENG_5_3_BP:1.1.1.2
	RELENG_5:1.1.1.2.0.8
	RELENG_5_BP:1.1.1.2
	RELENG_4_10_0_RELEASE:1.1.1.1.2.1
	RELENG_4_10:1.1.1.1.2.1.0.16
	RELENG_4_10_BP:1.1.1.1.2.1
	RELENG_5_2_1_RELEASE:1.1.1.2
	RELENG_5_2_0_RELEASE:1.1.1.2
	RELENG_5_2:1.1.1.2.0.6
	RELENG_5_2_BP:1.1.1.2
	RELENG_4_9_0_RELEASE:1.1.1.1.2.1
	RELENG_4_9:1.1.1.1.2.1.0.14
	RELENG_4_9_BP:1.1.1.1.2.1
	RELENG_5_1_0_RELEASE:1.1.1.2
	RELENG_5_1:1.1.1.2.0.4
	RELENG_5_1_BP:1.1.1.2
	RELENG_4_8_0_RELEASE:1.1.1.1.2.1
	RELENG_4_8:1.1.1.1.2.1.0.12
	RELENG_4_8_BP:1.1.1.1.2.1
	RELENG_5_0_0_RELEASE:1.1.1.2
	RELENG_5_0:1.1.1.2.0.2
	RELENG_5_0_BP:1.1.1.2
	RELENG_4_7_0_RELEASE:1.1.1.1.2.1
	RELENG_4_7:1.1.1.1.2.1.0.10
	RELENG_4_7_BP:1.1.1.1.2.1
	RELENG_4_6_2_RELEASE:1.1.1.1.2.1
	RELENG_4_6_1_RELEASE:1.1.1.1.2.1
	v5_2_20020615:1.1.1.2
	RELENG_4_6_0_RELEASE:1.1.1.1.2.1
	RELENG_4_6:1.1.1.1.2.1.0.8
	RELENG_4_6_BP:1.1.1.1.2.1
	v5_2_20020518:1.1.1.2
	RELENG_4_5_0_RELEASE:1.1.1.1.2.1
	RELENG_4_5:1.1.1.1.2.1.0.6
	RELENG_4_5_BP:1.1.1.1.2.1
	RELENG_4_4_0_RELEASE:1.1.1.1.2.1
	RELENG_4_4:1.1.1.1.2.1.0.4
	RELENG_4_4_BP:1.1.1.1.2.1
	v5_2_20010512:1.1.1.2
	RELENG_4_3_0_RELEASE:1.1.1.1.2.1
	RELENG_4_3:1.1.1.1.2.1.0.2
	RELENG_4_3_BP:1.1.1.1.2.1
	RELENG_4_2_0_RELEASE:1.1.1.1.2.1
	v5_1_20001009:1.1.1.2
	RELENG_4_1_1_RELEASE:1.1.1.1.2.1
	PRE_SMPNG:1.1.1.2
	RELENG_4_1_0_RELEASE:1.1.1.1.2.1
	v5_1_20000701:1.1.1.2
	RELENG_4_0_0_RELEASE:1.1.1.1
	RELENG_4:1.1.1.1.0.2
	RELENG_4_BP:1.1.1.1
	v5_0:1.1.1.1
	v5_0_990821:1.1.1.1
	NCURSES:1.1.1;
locks; strict;
comment	@# @;


1.1
date	99.08.24.01.06.36;	author peter;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	99.08.24.01.06.36;	author peter;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2000.07.03.09.22.51;	author peter;	state Exp;
branches
	1.1.1.2.14.1;
next	1.1.1.3;

1.1.1.3
date	2007.01.20.07.31.59;	author rafan;	state Exp;
branches
	1.1.1.3.2.1;
next	1.1.1.4;

1.1.1.4
date	2007.12.30.11.08.11;	author rafan;	state Exp;
branches
	1.1.1.4.18.1;
next	;

1.1.1.1.2.1
date	2000.07.10.09.54.16;	author ps;	state Exp;
branches;
next	;

1.1.1.2.14.1
date	2007.04.06.17.49.45;	author rafan;	state Exp;
branches;
next	1.1.1.2.14.2;

1.1.1.2.14.2
date	2008.07.01.09.28.27;	author rafan;	state Exp;
branches;
next	;

1.1.1.3.2.1
date	2008.06.04.07.42.51;	author rafan;	state Exp;
branches;
next	;

1.1.1.4.18.1
date	2007.12.30.11.08.11;	author svnexp;	state dead;
branches;
next	1.1.1.4.18.2;

1.1.1.4.18.2
date	2013.03.28.13.01.40;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#


# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"


# put in absolute paths if you don't have them in your path; or use env. vars.

mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"

tranformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""

while [ x"$1" != x ]; do
    case $1 in
	-c) instcmd="$cpprog"
	    shift
	    continue;;

	-d) dir_arg=true
	    shift
	    continue;;

	-m) chmodcmd="$chmodprog $2"
	    shift
	    shift
	    continue;;

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

	-g) chgrpcmd="$chgrpprog $2"
	    shift
	    shift
	    continue;;

	-s) stripcmd="$stripprog"
	    shift
	    continue;;

	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
	    shift
	    continue;;

	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
	    shift
	    continue;;

	*)  if [ x"$src" = x ]
	    then
		src=$1
	    else
		# this colon is to work around a 386BSD /bin/sh bug
		:
		dst=$1
	    fi
	    shift
	    continue;;
    esac
done

if [ x"$src" = x ]
then
	echo "install:	no input file specified"
	exit 1
else
	true
fi

if [ x"$dir_arg" != x ]; then
	dst=$src
	src=""
	
	if [ -d $dst ]; then
		instcmd=:
	else
		instcmd=mkdir
	fi
else

# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad 
# if $src (and thus $dsttmp) contains '*'.

	if [ -f $src -o -d $src ]
	then
		true
	else
		echo "install:  $src does not exist"
		exit 1
	fi
	
	if [ x"$dst" = x ]
	then
		echo "install:	no destination specified"
		exit 1
	else
		true
	fi

# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic

	if [ -d $dst ]
	then
		dst="$dst"/`basename $src`
	else
		true
	fi
fi

## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`

# Make sure that the destination directory exists.
#  this part is taken from Noah Friedman's mkinstalldirs script

# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='	
'
IFS="${IFS-${defaultIFS}}"

oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS="${oIFS}"

pathcomp=''

while [ $# -ne 0 ] ; do
	pathcomp="${pathcomp}${1}"
	shift

	if [ ! -d "${pathcomp}" ] ;
        then
		$mkdirprog "${pathcomp}"
	else
		true
	fi

	pathcomp="${pathcomp}/"
done
fi

if [ x"$dir_arg" != x ]
then
	$doit $instcmd $dst &&

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else

# If we're going to rename the final executable, determine the name now.

	if [ x"$transformarg" = x ] 
	then
		dstfile=`basename $dst`
	else
		dstfile=`basename $dst $transformbasename | 
			sed $transformarg`$transformbasename
	fi

# don't allow the sed command to completely eliminate the filename

	if [ x"$dstfile" = x ] 
	then
		dstfile=`basename $dst`
	else
		true
	fi

# Make a temp file name in the proper directory.

	dsttmp=$dstdir/#inst.$$#

# Move or copy the file name to the temp name

	$doit $instcmd $src $dsttmp &&

	trap "rm -f ${dsttmp}" 0 &&

# and set any options; do chmod last to preserve setuid bits

# If any of these fail, we abort the whole thing.  If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&

# Now rename the file to the real destination.

	$doit $rmcmd -f $dstdir/$dstfile &&
	$doit $mvcmd $dsttmp $dstdir/$dstfile 

fi &&


exit 0
@


1.1.1.1
log
@Import unmodified (but trimmed) ncurses 5.0 prerelease 990821.
This contains the full eti (panel, form, menu) extensions.
bmake glue to follow.

Obtained from:	ftp://ftp.clark.net/pub/dickey/ncurses
@
text
@@


1.1.1.1.2.1
log
@MFC: ncurses 5.1 prerelease (20000701)
@
text
@d4 1
a4 13
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission.  M.I.T. makes no representations about the
# suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
d11 2
a12 2
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.
d32 1
a32 1
transformbasename=""
@


1.1.1.2
log
@Import the most recent ncurses 5.1 prerelease (20000701).
Mostly this is intended to resolve the trace() badness once and for all.

Obtained from:  ftp://dickey.his.com/ncurses/
@
text
@d4 1
a4 13
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission.  M.I.T. makes no representations about the
# suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
d11 2
a12 2
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.
d32 1
a32 1
transformbasename=""
@


1.1.1.2.14.1
log
@MFC: ncurses 5.6-20061217

Approved by:	delphij (mentor)
Tested by:	several people on stable@@
@
text
@d112 1
a112 1
	:
d118 1
a118 1

a120 1
		chmodcmd=""
d122 1
a122 1
		instcmd=$mkdirprog
d127 1
a127 1
# might cause directories to be created, which would be especially bad
d132 1
a132 1
		:
d137 1
a137 1

d143 1
a143 1
		:
d153 1
a153 1
		:
d165 2
a166 2
defaultIFS='
	'
d185 1
a185 1
		:
d196 4
a199 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
d204 1
a204 1
	if [ x"$transformarg" = x ]
d208 1
a208 1
		dstfile=`basename $dst $transformbasename |
d214 1
a214 1
	if [ x"$dstfile" = x ]
d218 1
a218 1
		:
d237 4
a240 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
d245 1
a245 1
	$doit $mvcmd $dsttmp $dstdir/$dstfile
@


1.1.1.2.14.2
log
@SVN rev 180142 on 2008-07-01 09:28:27Z by rafan

MFC ncurses 5.6-20080503

 rev 174993, 176187, 178866
@
text
@d4 1
d6 1
a6 3
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
d8 9
a16 26
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d59 1
a59 1
	-c) instcmd=$cpprog
d82 1
a82 1
	-s) stripcmd=$stripprog
d109 1
a109 1
	echo "$0: no input file specified" >&2
d119 1
a119 1
	if [ -d "$dst" ]; then
d131 1
a131 1
	if [ -f "$src" ] || [ -d "$src" ]
d135 1
a135 1
		echo "$0: $src does not exist" >&2
d141 1
a141 1
		echo "$0: no destination specified" >&2
d150 1
a150 1
	if [ -d "$dst" ]
d152 1
a152 1
		dst=$dst/`basename "$src"`
d159 1
a159 1
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
d168 1
a168 1
IFS="${IFS-$defaultIFS}"
d170 1
a170 1
oIFS=$IFS
d173 2
a174 2
set - `echo "$dstdir" | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS=$oIFS
d179 1
a179 1
	pathcomp=$pathcomp$1
d182 1
a182 1
	if [ ! -d "$pathcomp" ] ;
d184 1
a184 1
		$mkdirprog "$pathcomp"
d189 1
a189 1
	pathcomp=$pathcomp/
d195 1
a195 1
	$doit $instcmd "$dst" &&
d197 4
a200 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
d207 1
a207 1
		dstfile=`basename "$dst"`
d209 1
a209 1
		dstfile=`basename "$dst" $transformbasename |
d217 1
a217 1
		dstfile=`basename "$dst"`
d222 1
a222 1
# Make a couple of temp file names in the proper directory.
a224 1
	rmtmp=$dstdir/#rm.$$#
d226 1
a226 1
# Trap to clean up temp files at exit.
d228 1
a228 2
	trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
	trap '(exit $?); exit' 1 2 13 15
d230 1
a230 3
# Move or copy the file name to the temp name

	$doit $instcmd "$src" "$dsttmp" &&
d238 4
a241 23
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&

# Now remove or move aside any old file at destination location.  We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons.  In this case, the final cleanup
# might fail but the new file should still install successfully.

{
	if [ -f "$dstdir/$dstfile" ]
	then
		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
		{
		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
		  (exit 1); exit
		}
	else
		:
	fi
} &&
d245 2
a246 1
	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
a249 1
# The final little trick to "correctly" pass the exit status to the exit trap.
d251 1
a251 3
{
	(exit 0); exit
}
@


1.1.1.3
log
@Import ncurses 5.6-20061217 onto the vender branch

Approved by:	delphij
@
text
@d112 1
a112 1
	:
d118 1
a118 1

a120 1
		chmodcmd=""
d122 1
a122 1
		instcmd=$mkdirprog
d127 1
a127 1
# might cause directories to be created, which would be especially bad
d132 1
a132 1
		:
d137 1
a137 1

d143 1
a143 1
		:
d153 1
a153 1
		:
d165 2
a166 2
defaultIFS='
	'
d185 1
a185 1
		:
d196 4
a199 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
d204 1
a204 1
	if [ x"$transformarg" = x ]
d208 1
a208 1
		dstfile=`basename $dst $transformbasename |
d214 1
a214 1
	if [ x"$dstfile" = x ]
d218 1
a218 1
		:
d237 4
a240 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
d245 1
a245 1
	$doit $mvcmd $dsttmp $dstdir/$dstfile
@


1.1.1.3.2.1
log
@SVN rev 179538 on 2008-06-04 07:42:51Z by rafan

MFC ncurses 5.6-20080503

 rev 174993, 176187, 178866
@
text
@d4 1
d6 1
a6 3
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
d8 9
a16 26
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d59 1
a59 1
	-c) instcmd=$cpprog
d82 1
a82 1
	-s) stripcmd=$stripprog
d109 1
a109 1
	echo "$0: no input file specified" >&2
d119 1
a119 1
	if [ -d "$dst" ]; then
d131 1
a131 1
	if [ -f "$src" ] || [ -d "$src" ]
d135 1
a135 1
		echo "$0: $src does not exist" >&2
d141 1
a141 1
		echo "$0: no destination specified" >&2
d150 1
a150 1
	if [ -d "$dst" ]
d152 1
a152 1
		dst=$dst/`basename "$src"`
d159 1
a159 1
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
d168 1
a168 1
IFS="${IFS-$defaultIFS}"
d170 1
a170 1
oIFS=$IFS
d173 2
a174 2
set - `echo "$dstdir" | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS=$oIFS
d179 1
a179 1
	pathcomp=$pathcomp$1
d182 1
a182 1
	if [ ! -d "$pathcomp" ] ;
d184 1
a184 1
		$mkdirprog "$pathcomp"
d189 1
a189 1
	pathcomp=$pathcomp/
d195 1
a195 1
	$doit $instcmd "$dst" &&
d197 4
a200 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
d207 1
a207 1
		dstfile=`basename "$dst"`
d209 1
a209 1
		dstfile=`basename "$dst" $transformbasename |
d217 1
a217 1
		dstfile=`basename "$dst"`
d222 1
a222 1
# Make a couple of temp file names in the proper directory.
a224 1
	rmtmp=$dstdir/#rm.$$#
d226 1
a226 1
# Trap to clean up temp files at exit.
d228 1
a228 2
	trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
	trap '(exit $?); exit' 1 2 13 15
d230 1
a230 3
# Move or copy the file name to the temp name

	$doit $instcmd "$src" "$dsttmp" &&
d238 4
a241 23
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&

# Now remove or move aside any old file at destination location.  We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons.  In this case, the final cleanup
# might fail but the new file should still install successfully.

{
	if [ -f "$dstdir/$dstfile" ]
	then
		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
		{
		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
		  (exit 1); exit
		}
	else
		:
	fi
} &&
d245 2
a246 1
	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
a249 1
# The final little trick to "correctly" pass the exit status to the exit trap.
d251 1
a251 3
{
	(exit 0); exit
}
@


1.1.1.4
log
@Import ncurses 5.6-20071222 snapshot onto the vender branch
@
text
@d4 1
d6 1
a6 3
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
d8 9
a16 26
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d59 1
a59 1
	-c) instcmd=$cpprog
d82 1
a82 1
	-s) stripcmd=$stripprog
d109 1
a109 1
	echo "$0: no input file specified" >&2
d119 1
a119 1
	if [ -d "$dst" ]; then
d131 1
a131 1
	if [ -f "$src" ] || [ -d "$src" ]
d135 1
a135 1
		echo "$0: $src does not exist" >&2
d141 1
a141 1
		echo "$0: no destination specified" >&2
d150 1
a150 1
	if [ -d "$dst" ]
d152 1
a152 1
		dst=$dst/`basename "$src"`
d159 1
a159 1
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
d168 1
a168 1
IFS="${IFS-$defaultIFS}"
d170 1
a170 1
oIFS=$IFS
d173 2
a174 2
set - `echo "$dstdir" | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS=$oIFS
d179 1
a179 1
	pathcomp=$pathcomp$1
d182 1
a182 1
	if [ ! -d "$pathcomp" ] ;
d184 1
a184 1
		$mkdirprog "$pathcomp"
d189 1
a189 1
	pathcomp=$pathcomp/
d195 1
a195 1
	$doit $instcmd "$dst" &&
d197 4
a200 4
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
d207 1
a207 1
		dstfile=`basename "$dst"`
d209 1
a209 1
		dstfile=`basename "$dst" $transformbasename |
d217 1
a217 1
		dstfile=`basename "$dst"`
d222 1
a222 1
# Make a couple of temp file names in the proper directory.
a224 1
	rmtmp=$dstdir/#rm.$$#
d226 1
a226 1
# Trap to clean up temp files at exit.
d228 1
a228 2
	trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
	trap '(exit $?); exit' 1 2 13 15
d230 1
a230 3
# Move or copy the file name to the temp name

	$doit $instcmd "$src" "$dsttmp" &&
d238 4
a241 23
	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&

# Now remove or move aside any old file at destination location.  We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons.  In this case, the final cleanup
# might fail but the new file should still install successfully.

{
	if [ -f "$dstdir/$dstfile" ]
	then
		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
		{
		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
		  (exit 1); exit
		}
	else
		:
	fi
} &&
d245 2
a246 1
	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
a249 1
# The final little trick to "correctly" pass the exit status to the exit trap.
d251 1
a251 3
{
	(exit 0); exit
}
@


1.1.1.4.18.1
log
@file install-sh was added on branch RELENG_8_4 on 2013-03-28 13:01:40 +0000
@
text
@d1 294
@


1.1.1.4.18.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 294
#! /bin/sh
#
# install - install a program, script, or datafile
#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.


# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"


# put in absolute paths if you don't have them in your path; or use env. vars.

mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"

transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""

while [ x"$1" != x ]; do
    case $1 in
	-c) instcmd=$cpprog
	    shift
	    continue;;

	-d) dir_arg=true
	    shift
	    continue;;

	-m) chmodcmd="$chmodprog $2"
	    shift
	    shift
	    continue;;

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

	-g) chgrpcmd="$chgrpprog $2"
	    shift
	    shift
	    continue;;

	-s) stripcmd=$stripprog
	    shift
	    continue;;

	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
	    shift
	    continue;;

	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
	    shift
	    continue;;

	*)  if [ x"$src" = x ]
	    then
		src=$1
	    else
		# this colon is to work around a 386BSD /bin/sh bug
		:
		dst=$1
	    fi
	    shift
	    continue;;
    esac
done

if [ x"$src" = x ]
then
	echo "$0: no input file specified" >&2
	exit 1
else
	:
fi

if [ x"$dir_arg" != x ]; then
	dst=$src
	src=""

	if [ -d "$dst" ]; then
		instcmd=:
		chmodcmd=""
	else
		instcmd=$mkdirprog
	fi
else

# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.

	if [ -f "$src" ] || [ -d "$src" ]
	then
		:
	else
		echo "$0: $src does not exist" >&2
		exit 1
	fi

	if [ x"$dst" = x ]
	then
		echo "$0: no destination specified" >&2
		exit 1
	else
		:
	fi

# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic

	if [ -d "$dst" ]
	then
		dst=$dst/`basename "$src"`
	else
		:
	fi
fi

## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`

# Make sure that the destination directory exists.
#  this part is taken from Noah Friedman's mkinstalldirs script

# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
	'
IFS="${IFS-$defaultIFS}"

oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS=$oIFS

pathcomp=''

while [ $# -ne 0 ] ; do
	pathcomp=$pathcomp$1
	shift

	if [ ! -d "$pathcomp" ] ;
        then
		$mkdirprog "$pathcomp"
	else
		:
	fi

	pathcomp=$pathcomp/
done
fi

if [ x"$dir_arg" != x ]
then
	$doit $instcmd "$dst" &&

	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else

# If we're going to rename the final executable, determine the name now.

	if [ x"$transformarg" = x ]
	then
		dstfile=`basename "$dst"`
	else
		dstfile=`basename "$dst" $transformbasename |
			sed $transformarg`$transformbasename
	fi

# don't allow the sed command to completely eliminate the filename

	if [ x"$dstfile" = x ]
	then
		dstfile=`basename "$dst"`
	else
		:
	fi

# Make a couple of temp file names in the proper directory.

	dsttmp=$dstdir/#inst.$$#
	rmtmp=$dstdir/#rm.$$#

# Trap to clean up temp files at exit.

	trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
	trap '(exit $?); exit' 1 2 13 15

# Move or copy the file name to the temp name

	$doit $instcmd "$src" "$dsttmp" &&

# and set any options; do chmod last to preserve setuid bits

# If any of these fail, we abort the whole thing.  If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.

	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&

# Now remove or move aside any old file at destination location.  We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons.  In this case, the final cleanup
# might fail but the new file should still install successfully.

{
	if [ -f "$dstdir/$dstfile" ]
	then
		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
		{
		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
		  (exit 1); exit
		}
	else
		:
	fi
} &&

# Now rename the file to the real destination.

	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"

fi &&

# The final little trick to "correctly" pass the exit status to the exit trap.

{
	(exit 0); exit
}
@


