head	1.3;
access;
symbols
	before_cvs_1_6:1.1.1.2
	RELENG_2_1_0_RELEASE:1.1.1.2
	RELENG_2_1_0_BP:1.1.1.2
	RELENG_2_0_5_RELEASE:1.1.1.2
	RELENG_2_0_5:1.1.1.2.0.4
	RELENG_2_0_5_BP:1.1.1.2
	RELENG_2_0_5_ALPHA:1.1.1.2
	jt_spdup:1.1.1.2.0.2
	b4_spdup:1.1.1.2
	cvs_1_4A2:1.1.1.2
	RELEASE_2_0:1.1.1.1
	BETA_2_0:1.1.1.1
	ALPHA_2_0:1.1.1.1.0.4
	MOVED_NEWCVS:1.1.1.1
	FINAL_1_1_5:1.1.1.1
	ALPHA_1_1_5:1.1.1.1
	FINAL_1_1:1.1.1.1
	GAMMA_1_1:1.1.1.1
	BETA_1_1:1.1.1.1.0.2
	BP_BETA_1_1:1.1.1.1
	FINAL_1_0:1.1.1.1
	EPSILON_1_0:1.1.1.1
	GAMMA_1_0:1.1.1.1
	BETA_1_0:1.1.1.1
	ALPHA_1_0:1.1.1.1
	cvs_1_3:1.1.1.1
	cvs:1.1.1;
locks; strict;
comment	@# @;


1.3
date	95.12.30.18.37.31;	author peter;	state dead;
branches;
next	1.2;

1.2
date	95.12.11.00.27.50;	author peter;	state dead;
branches;
next	1.1;

1.1
date	93.06.18.05.46.06;	author jkh;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	93.06.18.05.46.07;	author jkh;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	95.03.31.07.43.51;	author nate;	state Exp;
branches;
next	;


desc
@@


1.3
log
@recording cvs-1.6 file death
@
text
@#!/bin/csh
#
# rcs-to-cvs,v 1.3 1992/04/10 03:04:25 berliner Exp
# Contributed by Per Cederqvist <ceder@@lysator.liu.se>.
#
#   Copyright (c) 1989, Brian Berliner
#
#   You may distribute under the terms of the GNU General Public License
#   as specified in the README file that comes with the CVS 1.0 kit.
#
#############################################################################
#									    #
# This script is used to check in sources that previously was under RCS or  #
# no source control system.				  		    #
#									    #
#	Usage: rcs-to-cvs repository 					    #
#									    #
# The repository is the directory where the sources should		    #
# be deposited. 
#									    #
# checkin traverses the current directory, ensuring that an 		    #
# identical directory structure exists in the repository directory.  It	    #
# then checks the files in in the following manner:			    #
#									    #
#		1) If the file doesn't yet exist, check it in 		    #
#			as revision 0.1					    #
#									    #
# The script also is somewhat verbose in letting the user know what is	    #
# going on.  It prints a diagnostic when it creates a new file, or updates  #
# a file that has been modified on the trunk.		   		    #
#									    #
#############################################################################

set vbose = 0
set message = ""
set cvsbin = /usr/gnu/bin
set rcsbin = /usr/gnu/bin
set grep = /bin/grep
set message_file = /usr/tmp/checkin.$$
set got_one = 0

if ( $#argv < 1 ) then
    echo "Usage: rcs-to-cvs [-v] [-m message] [-f message_file] repository"
    exit 1
endif
while ( $#argv )
    switch ( $argv[1] )
        case -v:
            set vbose = 1
	    breaksw
	case -m:
	    shift
	    echo $argv[1] > $message_file
	    set got_one = 1
	    breaksw
	case -f:
	    shift
	    set message_file = $argv[1]
	    set got_one = 2
	    breaksw
	default:
	    break
    endsw
    shift
end
if ( $#argv < 1 ) then
    echo "Usage: rcs-to-cvs [-v] [-m message] [-f message_file] repository"
    exit 1
endif
set repository = $argv[1]
shift

if ( ! $?CVSROOT ) then
    echo "Please set the environmental variable CVSROOT to the root"
    echo "	of the tree you wish to update"
    exit 1
endif

if ( $got_one == 0 ) then
    echo "Please Edit this file to contain the RCS log information" >$message_file
    echo "to be associated with this file (please remove these lines)">>$message_file
    if ( $?EDITOR ) then
	$EDITOR $message_file > /dev/tty
    else
	/usr/ucb/vi $message_file > /dev/tty
    endif
    set got_one = 1
endif

umask 22

set update_dir = ${CVSROOT}/${repository}
if ( -d SCCS ) then
    echo SCCS files detected!
    exit 1
endif
if ( -d RCS ) then
    $rcsbin/co RCS/* >& /dev/null
endif
foreach name ( * .[a-zA-Z0-9]* )
    echo $name
    if ( "$name" == SCCS ) then 
	continue
    endif
    if ( "$name" == RCS ) then 
	continue
    endif
    if ( $vbose ) then 
	echo "Updating ${repository}/${name}"
    endif
    if ( -d "$name" ) then
	if ( ! -d "${update_dir}/${name}" ) then
	    echo "WARNING: Creating new directory ${repository}/${name}"
	    mkdir "${update_dir}/${name}"
	    if ( $status ) then
		echo "ERROR: mkdir failed - aborting"
		exit 1
	    endif
	endif
	chdir "$name"
	if ( $status ) then
	    echo "ERROR: Couldn\'t chdir to "$name" - aborting" 
	    exit 1
	endif
	if ( $vbose ) then
	    rcs-to-cvs -v -f $message_file "${repository}/${name}"
	else
	    rcs-to-cvs -f $message_file "${repository}/${name}"
	endif
	if ( $status ) then 
	    exit 1
	endif
	chdir ..
    else	# if not directory 
	if ( ! -f "$name" ) then
	    echo "WARNING: "$name" is neither a regular file" 
	    echo "	   nor a directory - ignored"
	    continue
	endif
	set file = "${update_dir}/${name},v"
	set new = 0
	set comment = ""
	grep -s '\$Log.*\$' "${name}"
	if ( $status == 0 ) then	# If $Log keyword
	    set myext = ${name:e}
	    set knownext = 0
	    foreach xx ( "c" "csh" "e" "f" "h" "l" "mac" "me" "mm" "ms" "p" "r" "red" "s" "sh" "sl" "cl" "ml" "el" "tex" "y" "ye" "yr" "" )
		if ( "${myext}" == "${xx}" ) then
		    set knownext = 1
		    break
		endif
	    end
	    if ( $knownext == 0 ) then
		echo For file ${file}:
		grep '\$Log.*\$' "${name}"
		echo -n "Please insert a comment leader for file ${name} > "
		set comment = $<
	    endif
	endif
	if ( ! -f "$file" ) then	# If not exists in repository
	    if ( ! -f "${update_dir}/Attic/${name},v" ) then
	        echo "WARNING: Creating new file ${repository}/${name}"
		if ( -f RCS/"${name}",v ) then
			echo "MSG: Copying old rcs file."
			cp RCS/"${name}",v "$file"
		else
   		    if ( "${comment}" != "" ) then
		        $rcsbin/rcs -q -i -c"${comment}" -t${message_file} -m'.' "$file"
		    endif
	            $rcsbin/ci -q -u0.1 -t${message_file} -m'.' "$file" 
	            if ( $status ) then
		        echo "ERROR: Initial check-in of $file failed - aborting"
		        exit 1
	            endif
	            set new = 1
		endif
	    else 
		set file = "${update_dir}/Attic/${name},v"
		echo "WARNING: IGNORED: ${repository}/Attic/${name}"
		continue
	    endif
	else	# File existed 
	    echo ERROR: File exists: Ignored: "$file"
	    continue
#	    set headbranch = `sed -n '/^head/p; /^branch/p; 2q' $file`
#	    if ( $#headbranch != 2 && $#headbranch != 4 ) then
#		echo "ERROR: corrupted RCS file $file - aborting"
#	    endif
#	    set head = "$headbranch[2]"
#	    set branch = ""
#	    if ( $#headbranch == 4 ) then
#		set branch = "$headbranch[4]"
#	    endif
#	    if ( "$head" == "1.1;" && "$branch" != "1.1.1;" ) then
#		${rcsbin}/rcsdiff -q -r1.1 $file > /dev/null
#		if ( ! $status ) then
#		    set new = 1
#		endif
#	    else
#	        if ( "$branch" != "1.1.1;" ) then
#		    echo -n "WARNING: Updating locally modified file "
#		    echo    "${repository}/${name}"
#	        endif
#	    endif
	endif
    endif
end
if ( $got_one == 1 ) rm $message_file
@


1.2
log
@Clean out some files which are no longer part of CVS...
@
text
@@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Updated CVS
@
text
@@


1.1.1.2
log
@Original sources from CVS-1.4A2 munged to fit our directory structure.
@
text
@d1 1
a1 1
#!/bin/sh
d3 2
a4 4
# $Id: rcs-to-cvs,v 1.4 1994/09/21 07:23:16 berliner Exp $
# Based on the CVS 1.0 checkin csh script.
# Contributed by Per Cederqvist <ceder@@signum.se>.
# Rewritten in sh by David MacKenzie <djm@@cygnus.com>.
d8 2
a9 1
#   You may distribute under the terms of the GNU General Public License.
d12 20
a31 18
#
# Check in sources that previously were under RCS or no source control system.
#
# The repository is the directory where the sources should be deposited.
#
# Traverses the current directory, ensuring that an
# identical directory structure exists in the repository directory.  It
# then checks the files in in the following manner:
#
#		1) If the file doesn't yet exist, check it in as revision 1.1
#
# The script also is somewhat verbose in letting the user know what is
# going on.  It prints a diagnostic when it creates a new file, or updates
# a file that has been modified on the trunk.
#
# Bugs: doesn't put the files in branch 1.1.1
#       doesn't put in release and vendor tags
#
d34 7
a40 5
usage="Usage: rcs-to-cvs [-v] [-m message] [-f message_file] repository"
vbose=0
message=""
message_file=/usr/tmp/checkin.$$
got_one=0
d42 2
a43 2
if [ $# -lt 1 ]; then
    echo "$usage" >&2
d45 7
a51 8
fi

while [ $# -ne 0 ]; do
    case "$1" in
        -v)
            vbose=1
	    ;;
	-m)
d53 4
a56 4
	    echo $1 > $message_file
	    got_one=1
	    ;;
	-f)
d58 4
a61 4
	    message_file=$1
	    got_one=2
	    ;;
	*)
d63 1
a63 1
    esac
d65 3
a67 4
done

if [ $# -lt 1 ]; then
    echo "$usage" >&2
d69 2
a70 3
fi

repository=$1
d73 3
a75 3
if [ -z "$CVSROOT" ]; then
    echo "Please the environmental variable CVSROOT to the root" >&2
    echo "	of the tree you wish to update" >&2
d77 1
a77 1
fi
d79 1
a79 1
if [ $got_one -eq 0 ]; then
d81 8
a88 4
    echo "to be associated with this directory (please remove these lines)">>$message_file
    ${EDITOR-/usr/ucb/vi} $message_file
    got_one=1
fi
d92 3
a94 5
update_dir=${CVSROOT}/${repository}
[ ! -d ${update_dir} ] && mkdir $update_dir

if [ -d SCCS ]; then
    echo SCCS files detected! >&2
d96 5
a100 10
fi
if [ -d RCS ]; then
    co RCS/*
fi

for name in * .[a-zA-Z0-9]*
do
    case "$name" in
    RCS | \* | .\[a-zA-Z0-9\]\* ) continue ;;
    esac
d102 7
a108 1
    if [ $vbose -ne 0 ]; then 
d110 3
a112 3
    fi
    if [ -d "$name" ]; then
	if [ ! -d "${update_dir}/${name}" ]; then
d115 2
a116 2
	    if [ $? -ne 0 ]; then
		echo "ERROR: mkdir failed - aborting" >&2
d118 5
a122 5
	    fi
	fi
	cd "$name"
	if [ $? -ne 0 ]; then
	    echo "ERROR: Couldn\'t cd to $name - aborting" >&2
d124 3
a126 3
	fi
	if [ $vbose -ne 0 ]; then
	    $0 -v -f $message_file "${repository}/${name}"
d128 3
a130 3
	    $0 -f $message_file "${repository}/${name}"
	fi
	if [ $? -ne 0 ]; then 
d132 2
a133 2
	fi
	cd ..
d135 2
a136 2
	if [ ! -f "$name" ]; then
	    echo "WARNING: $name is neither a regular file"
d139 16
a154 12
	fi
	file="${update_dir}/${name},v"
	comment=""
	if grep -s '\$Log.*\$' "${name}"; then # If $Log keyword
	    myext=`echo $name | sed 's,.*\.,,'`
	    [ "$myext" = "$name" ] && myext=
	    case "$myext" in
		c | csh | e | f | h | l | mac | me | mm | ms | p | r | red | s | sh | sl | cl | ml | el | tex | y | ye | yr | "" )
		;;

		* )
		echo "For file ${file}:"
d157 5
a161 6
		read comment
		;;
	    esac
	fi
	if [ ! -f "$file" ]; then	# If not exists in repository
	    if [ ! -f "${update_dir}/Attic/${name},v" ]; then
d163 1
a163 1
		if [ -f RCS/"${name}",v ]; then
d167 6
a172 6
   		    if [ -n "${comment}" ]; then
		        rcs -q -i -c"${comment}" -t${message_file} -m'.' "$file"
		    fi
	            ci -q -u1.1 -t${message_file} -m'.' "$file" 
	            if [ $? -ne 0 ]; then
		        echo "ERROR: Initial check-in of $file failed - aborting" >&2
d174 3
a176 2
	            fi
		fi
d178 1
a178 1
		file="${update_dir}/Attic/${name},v"
d181 1
a181 1
	    fi
d183 1
a183 1
	    echo "ERROR: File exists in repository: Ignored: $file"
d185 24
a208 7
	fi
    fi
done

[ $got_one -eq 1 ] && rm -f $message_file

exit 0
@
