Subject: Re: CVS Tree - sup wihout seperate copy of tree?
To: None <current-users@NetBSD.ORG>
From: Rick Byers <rickb@iaw.on.ca>
List: current-users
Date: 03/29/1997 14:26:48
Hi,
Thanks for all the information... I'm creating my local CVS tree now.
One more question though, is there any way to do the sup without having to
keep a copy of the tree? It seems redundant to have the cvs files, the
working files, AND a sup directory. I guess the proper way to do it is just
to keep an extra copy, so forgive me for being so picky about wasted
space...
I was planning on having sup recieve the changed files into a temporary
directory, import them into my CVS tree, then delete the original supped
files. The only problem I see with that is that I need some way of
keeping track of what files should be deleted. There is enough
information (in the last.* files), but as far as I can tell, sup won't
issue any message if the file to be deleted doesn't allready exist. I
could modify the code for sup to make it display a message, regardless of
if the file exists or not, but there should be a better way.
I could also sup into my working directory (/usr/src), but I guess I'd
have to commit any changes first - which probably isn't a good idea for
work in progress.
How about using a union mount? I could mount my temporary sup directory
on top of my working directory, then do the sup. I would then umount the
union, and cvs import the whole thing. I could then go through the output
from sup and cvs remove anything that sup whited-out. Thoughts??
Thanks,
Rick
On Thu, 27 Mar 1997, Curt Sampson wrote:
> On Thu, 27 Mar 1997, Rick Byers wrote:
>
> > Is there any way to access (read) the CVS tree (like anon-CVS)?
>
> Not yet. But it's being worked on.
>
> > It would also be a lot easier to maintain local changes if
> > I could use CVS....
>
> No, being able to read our repository doesn't help you at all with
> local changes, since you need to keep your own private CVS tree,
> and import into that, to be able to do this.
>
> > How do others maintain local changes? I guess I
> > could use CVS import on newly supped sources, but going CVS->sup->CVS
> > seems sort of silly as well..
>
> No, that's the correct way to do it. I have CVS access, and I still
> have to do essentially the same thing: update my checkout of the
> NetBSD CVS repoisitory, import it into my personal repository, and
> merge. I've appended a copy of the Q&D script I use to do this; it
> should work almost as-is for you; you'll just have to replace the
> initial CVS checkout with a sup update.
>
> If anyone wants to clean this up, make it more general, write a
> manpage, or whatever, and send changes back to me, I could make a
> package available for ftp download.
>
> cjs
>
> Curt Sampson cjs@portal.ca Info at http://www.portal.ca/
> Internet Portal Services, Inc.
> Vancouver, BC (604) 257-9400 De gustibus, aut bene aut nihil.
>
>
> # Procedures for Imports
> # $Id$
>
> # configuration
> #
> cvsroot=/usr2/CVSRoot
> repository=netbsd
> branch=NetBSD
> # version is set below
> confdir=/usr1/NetBSD
> logdir=/usr1/NetBSD/logs/
>
> import_tree=/usr1/NetBSD/checkouts/current
> local_tree=/usr1/NetBSD/checkouts/cjs
> #import_tree=/home/cjs/tmp/4/current
> #local_tree=/home/cjs/tmp/4/netbsd
> dirs="doc othersrc src"
>
> # find version
> versionfile=$import_tree/src/sys/conf/newvers.sh
> version=`sed -n -e 's/^osr="\(.*\)"$/\1/p' $versionfile | sed -e 's/\./_/g`
>
> # remove ./ from line beginnning, and all CVS dirs/files
> sedstrip='s#^./##;\|^CVS$|d;\|/CVS$|d;\|^CVS/|d;\|/CVS/|d'
>
> # get currrent date, etc.
> #
> startdate=`date`
> date=$(date +%Y%m%d)
> tag=$branch-$version-$date
>
> # log under subdirectory by date
> logdir=$logdir/$date
> mkdir $logdir
>
> echo "NetBSD import script importing $tag."
>
> # update our source tree
> #
> echo; echo "Updating source tree:"
> cd $import_tree
> for dir in $dirs; do
> if ! test -d $dir ; then
> echo "Can't cd to $dir! Aborting."
> exit 1
> else
> cd $dir
> cvs -q update -dP -A | tee -a $logdir/update.$dir
> if test $? -ne 0 ; then
> echo "Error $? occured updating $import_tree/$dir; aborting."
> exit $?;
> fi
> cd ..
> fi
> done
>
> # update our local tree
> echo; echo "Updating and tagging local tree:"
> cd $local_tree
> if ! cvs -q update -dP -A; then
> echo "Error occured; aborting."
> exit $?;
> fi
> # confirm local tree has no uncommited changes
> #if [ -n "`cvs -q update -dP -A | grep -v '^? '`" ]; then
> # echo "Error: checkout of local tree has uncommitted changes";
> # exit 2;
> #fi
> echo cvs -q rtag pre-$tag $repository
> if ! cvs -q rtag pre-$tag $repository; then
> echo "Error occured; aborting."
> exit $?;
> fi
>
> # find files to delete
> #
> echo; echo "Finding files to delete:"
> cd $import_tree
> find . -print | sed -e $sedstrip | sort >$logdir/filelist.import
> cd $local_tree
> # convert Keepfiles to a sed script
> egrep -v '^#|^[ ]*$' Keepfiles |\
> sed -e 's/^/\\|^/' -e 's/$/$|d/' >/tmp/Import.$$
> find . -print | sed -e $sedstrip -f /tmp/Import.$$ |\
> sort >$logdir/filelist.local
> rm /tmp/Import.$$
> comm -13 $logdir/filelist.import $logdir/filelist.local \
> >$logdir/delete
>
>
> if [ -s $logdir/delete ]; then
> echo; echo "Deleting files:"
> for f in `cat $logdir/delete`; do
> echo $f
> rm $f
> cvs -q rm $f
> done
> cvs -q commit -m "Pre-import deletions for $tag."
> else
> echo "No files to delete."
> fi
>
>
> # do the import
> #
> echo; echo "Importing new source tree:"
> cd $import_tree
> cvs -q -d $cvsroot import \
> -I ! -I CVS \
> -m "$tag import." \
> $repository $branch $tag \
> >$logdir/import
> sed -n -e '/^C /p;/^$/,$p' $logdir/import
>
> echo; echo "Updating and merging local tree:"
> cd $local_tree; cd ..
> echo cvs -q co -d `basename $local_tree` -P "-j$branch:$startdate" -j$branch $repository
> cvs -q co -P -d `basename $local_tree` \
> "-j$branch:$startdate" -j$branch $repository 2>&1 |\
> tee $logdir/update
>
> echo; echo "Remember to commit this merge!"
>
=========================================================================
Rick Byers Internet Access Worldwide
rickb@iaw.on.ca System Administrator
Welland, Ontario, Canada (905)714-1400
http://www.iaw.on.ca/rickb/ http://www.iaw.on.ca/