head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	93.08.10.01.44.24;	author aoki;	state Exp;
branches;
next	1.4;

1.4
date	92.12.31.01.29.40;	author marc;	state Exp;
branches;
next	1.3;

1.3
date	92.12.23.23.07.25;	author mao;	state Exp;
branches;
next	1.2;

1.2
date	92.12.23.23.01.03;	author mao;	state Exp;
branches;
next	1.1;

1.1
date	92.12.23.22.02.37;	author mao;	state Exp;
branches;
next	;


desc
@postgres checkin script -- checks in a file with flags specified by the
user, then chdir's to the postgres master tree and checks the file out
again.
@


1.5
log
@unless you named your tree .../postgres this fails.
since a src tree must contain src, changed the sed line
slightly.. which will break if there is a subdir called
src, but what can you do.
@
text
@#!/bin/sh
#
#	pci -- postgres checkin command
#
#	this script should be used to check in changes made in a
#	developer's private copy of the postgres tree.  it will
#	run the rcs checkin command, and then guarantee that the
#	source file is checked out in the postgres master tree.
#
#	Usage:  pci [-v] [-M master_tree_pathname] <ci flags> file file ...
#
#		-v puts pci into verbose mode
#		-M tells pci to use master_tree_pathname as the root of
#		   the postgres master tree
#
#	$Header: /home2/aoki/master/src/RCS/pci,v 1.4 1992/12/31 01:29:40 marc Exp aoki $
#

# control the behavior of this script
verbose=0
master=/usr/local/devel/postgres

# control the behavior of ci and co
ulf=
msgs=
files=

# parse the argument list -- we know what ci expects
while [ $# -gt 0 ]
do
	case $1 in

#	pci args
	-v)		verbose=1;;
	-M)		master=$2;shift;;
	-M*)		master=`echo $2 | sed -e "s/-M//"`;;

#	ci args
	-[ulf])		ulf="$ulf $1";;
	-[mnNst])	msgs="$msgs $1 ""'""$2""'";shift;;
	-[mnNs]t*)	msgs="$msgs ""'""$1""'";;
	*)		files="$files $1";;

	esac
	shift
done

# tell them what they've won, don pardo...
if [ $verbose -ne 0 ]
then
	echo ci $ulf $msgs $files
fi

# do it
ci $ulf $msgs $files

if [ $? -ne 0 ]
then
	echo checkin failed.
	exit 1
fi

# extract the pathname relative to the postgres root directory from curdir
curdir=`pwd`
#subtree=`echo $curdir | sed -e "s%.*/postgres/%%"`
subtree=`echo $curdir | sed -e "s%.*/src/%src/%"`

if [ $verbose -ne 0 ]
then
	echo cd $master/$subtree
fi

# go to the master tree
cd $master/$subtree
if [ $? -ne 0 ]
then
	echo cannot chdir to $master/$subtree
	echo checkout of $files in master tree failed
	echo please do the checkout manually
	exit 1
fi

if [ $verbose -ne 0 ]
then
	echo co $files
fi

# check out the files
co $files

exit 0
@


1.4
log
@temporarily fixed till i come up with a complete replacement
@
text
@d16 1
a16 1
#	$Header: /usr/local/devel/postgres/src/RCS/pci,v 1.3 1992/12/23 23:07:25 mao Exp $
d65 2
a66 1
subtree=`echo $curdir | sed -e "s%.*/postgres/%%"`
@


1.3
log
@minor cleanup
@
text
@d16 1
a16 1
#	$Header: /private/src/postgres/src/RCS/pci,v 1.2 1992/12/23 23:01:03 mao Exp mao $
d65 1
a65 1
subtree=`echo $curdir | sed -e "s%.\*/src/%%"`
d69 1
a69 1
	echo cd $master/src/$subdir
d73 1
a73 1
cd $master/src/$subdir
d76 1
a76 1
	echo cannot chdir to $master/src/$subdir
@


1.2
log
@fix up arg parsing loop -- this one keeps track of spaces inside of
arguments correctly.
@
text
@d16 1
a16 1
#	$Header: /usr/local/devel/postgres/src/RCS/pci,v 1.1 1992/12/23 22:02:37 mao Exp $
a21 2
M=
getmaster=0
d23 1
d28 1
a28 1
# parse the argument list
d32 2
d37 2
d43 1
d54 1
d63 1
a64 2

# extract the pathname relative to the postgres root directory from curdir
d72 1
d87 1
@


1.1
log
@Initial revision
@
text
@d16 1
a16 1
#	$Header$
d25 2
a26 12
# a set of interesting rcs flags that we'll pass on to 'ci'
u=
l=
f=

getarg=0
m=
s=
n=
N=

cicmd=ci
d30 1
a30 1
for i in $*
d32 10
a41 24
	if [ $getmaster -ne 0 ]
	then
		master=$i
		getmaster=0
	elif [ $getarg -ne 0 ]
	then
		cicmd="$cicmd \'$i\'"
		getmmsg=0
	else
		case $i in

			-v)		verbose=1;;
			-M)		getmaster=1;;
			-M*)		master=`echo $i | sed -e 's/-M//'`;;

			-[ulf])		cicmd="$cicmd $i";;

			-[mnNs]) 	cicmd="$cicmd $i";getarg=1;;

			-[mnNs]*)	cicmd="$cicmd \'$i\'";;

			*)		files="$files $i";;
		esac
	fi
d47 1
a47 1
	echo $cicmd $files
d50 1
a50 1
$cicmd $files
@
