sccscp.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 1993-1998, 2003 Sun Microsystems, Inc.
# All rights reserved.
# Use is subject to license terms.
#
#pragma ident "%Z%%M% %I% %E% SMI"
#
# This script is to be used to copy SCCS files and SCCS
# directory structures within a CodeManager workspace
# You specify the 'clear file' or directory to sccscp, it
# will duplicate the coresponding s-dot file(s),
# and do an SCCS GET operation on the newly
# created s-dot file.
#
#
#
# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
# under certain circumstances, which can really screw things up; unset it.
#
unset CDPATH
R_FLAG=0
G_FLAG=0
E_FLAG=0
usage()
{
echo "usage: sccscp [-r] filename1 [ filename2...] target"
echo " -r copy a directory and all of its files"
echo " -g copy the sdot file, but do not sccs-get it"
echo " -e copy most recent delta if file is currently checked out."
echo " -d debug mode"
} #usage()
#
# function to return that last arguement passed to it.
# I use this in place of array indexing - which shell
# does not do well.
#
getlast()
{
do
:
done
echo "$arg"
} # getlast()
#
# copy_file(source, destination)
#
{
#
# is the file currently checked out?
#
echo "sccscp: $f1 currently checked out - not copied"
return
fi
#
# Does the destination directory have an SCCS directory,
# if not we will create it!
#
fi
PWD=`pwd`
cd $d2
cd $PWD
fi
} # copy_file()
#
# copy_dir(source, destination)
#
copy_dir()
{
PWD=`pwd`
if [ -d $2 ]; then
else
destdir=$2
fi
cd $1
| while read sdot
do
continue
fi
if [ ! -d $d2 ]; then
fi
fi
done
cd $PWD
} # copy_dir()
else
fi
#
# Parse options...
#
if [ $? != 0 ]; then
exit 2
fi
for i in $*
do
case $i in
-r) R_FLAG=1; shift;;
-d) set -x; shift;;
-g) G_FLAG=1; shift;;
-e) E_FLAG=1; shift;;
--) shift; break;;
esac
done
if [ $# -lt 2 ]; then
echo "sccscp: Insufficient arguments (${#})"
exit 1
fi
echo "sccscp: Target must be a directory"
exit 1
fi
while [ $# -gt 1 ]
do
if [ ! -r $1 ]; then
echo "sccscp: cannot access $1"
shift
continue
fi
if [ -d $lastarg ]; then
else
fi
if [ -d $1 ]; then
echo "sccscp: <$1> directory"
else
fi
else
fi
shift
done