head	1.4;
access;
symbols
	C_3:1.2
	C_2:1.2
	C_1:1.1;
locks; strict;
comment	@# @;


1.4
date	93.02.26.13.16.54;	author roger;	state Exp;
branches;
next	1.3;

1.3
date	93.02.26.13.14.58;	author roger;	state Exp;
branches;
next	1.2;

1.2
date	90.08.23.22.29.38;	author roger;	state C_3;
branches;
next	1.1;

1.1
date	90.08.23.19.18.56;	author roger;	state C_1;
branches;
next	;


desc
@@


1.4
log
@fixup top of script
@
text
@#!/bin/sh
# $Id: Cpset,v 1.3 1993/02/26 13:14:58 roger Exp roger $

# This shell simulates the action of the spset command that
# is available on system V systems.
#  It only does the part required for my makefile!
#
USAGE="usage: Cpset [-o] from-file to-file  mode  owner group"
#
# It will copy the file, change the mode, owner and
# group if specified.  If -o is used, an existing file is moved
# to OLDfile.

OLD=
MODE=
OWNER=
GROUP=
FILE=
TO=

while [ $# -gt 0 ]
do
	case $1 in
	-o)	OLD="OLD"
		shift
		;;
	-s)	STRIP="STRIP"
		shift
		;;
	*)	break
		;;
	esac
done

if [ $# -lt 2 ]; then
	echo $USAGE
	exit 1
fi

FILE=$1
TO=$2
MODE=$3
OWNER=$4
GROUP=$5

BASE=`basename $TO`
TODIR=` echo $TO | sed "s/${BASE}\$//"`
if [ -n "$OLD" -a -f $TO ]; then
	rm -f $TODIR/OLD$BASE
	echo Cpset: mv $TO $TODIR/OLD$BASE
	mv $TO $TODIR/OLD$BASE
fi

rm -f $TO
echo Cpset: cp $FILE $TO
cp $FILE $TO
if [ -n "$STRIP" ] ; then
	echo Cpset: strip $TO
	strip $TO
fi

if [ -n "$GROUP" ]; then
	echo Cpset: chgrp $GROUP $TO
	chgrp $GROUP $TO
fi

if [ -n "$OWNER" ]; then
	echo Cpset: chown $OWNER $TO
	chown $OWNER $TO
fi

if [ -n "$MODE" ]; then
	echo Cpset: chmod $MODE $TO
	chmod $MODE $TO
fi

ls -l $TO
@


1.3
log
@added strip option.
@
text
@a0 3

# $Id: Cpset,v 1.2 1990/08/23 22:29:38 roger C_3 $

d2 1
a2 1

@


1.2
log
@porting code drop
@
text
@d2 1
a2 1
# $Id$
d30 3
d60 4
@


1.1
log
@Initial revision
@
text
@d2 1
a2 2
#	Convergent Technologies - System V - Feb 1986
#ident	"@@(#)Cpset	6.2 :/source/cmd/uucp/s.Cpset 6/17/86 10:14:15"
@
