Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 1999 14:05:32 -0400 (EDT)
From:      Spidey <spidey@jsp.umontreal.ca>
To:        "I'Khala" <ikhala@phoenix.cl.msu.edu>
Cc:        Broderick Wood <bwood@KingsU.ab.ca>, freebsd-stable@FreeBSD.ORG
Subject:   Re: CVSUP Scripts
Message-ID:  <Pine.BSF.3.96.990527140205.1442A-100000@freed.dyn.ez-ip.net>
In-Reply-To: <19990526154059.B42978@phoenix.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
If anyone cares.... for the cvsup part, I made an scripts that automates
the process of upgrading the sources:

It is very stupid and simple, but it saves me some time, and it keeps all
the mods made to the source tree logged somewhere with a timestamp in the
name.

Just do, say,  ./update ports to update the tree as per the ports-supfile
and log the results in ./logs/ports-`date +%Y%m%d`

Gimme your comments please!

----------------------------------------------------------------------------
#! /bin/sh

cvsup="/usr/local/bin/cvsup"
flags="-P m -L 2 -g -h"
host="cvsup.ca.freebsd.org"
curDir="."
logdir="$curDir/logs"
date=`date +%Y%m%d`
nolog=0
verbose=1

# A basic usage...
usage ( ) {
    cat <<EOF
Usage: update [-q] [-n | -l <logdir>] [ -d <fmt> ] collection
-q: be quiet
-n: do not log to a file
-l <logdir>: log into dir <logdir>
-d <fmt>: change the date format used for logfile name ["$date"]
The supfile will be <collection>-supfile.
EOF
    exit 1
}

if test $# -lt 1
then usage
fi

# Get the command line right!
#set -- `getopt nl:qv $*`

#for i
#do
#    case "$i"
#    in
#	-q)
#		verbose=0; shift;;
#	-v)
#		verbose=1; shift;;
#	-n)
#		nolog=1; shift;;
#	-l)
#		logdir=$2; shift; shift;;
#	-d)
#		date=$2; shift; shift;;
#    esac
#done

dist=$1
supfile="$curDir/$dist-supfile"

if [ ! -r $supfile ]
then
	echo "Can't read $supfile, exiting..."
	exit 1
fi

if [ ! -d $logdir ]
then
	echo "Can't find $logdir directory, using current dir for logfiles"
	logdir="."
fi

if [ $nolog -eq 1 ]
then 
	logfile="/dev/null"
else
	logfile="$logdir/$dist-$date"
fi

echo "This will be the command issued:"
echo "\"$cvsup $flags $host $supfile 2>&1 | tee -a $logfile\""
echo -n "Press [enter] to confirm, or ^C to exit: "
read void

if [ $verbose -eq 1 ]
then
	$cvsup $flags $host $supfile 2>&1 | tee -a $logfile
else
	$cvsup $flags $host $supfile 2>&1 >> $logfile
fi
----------------------------------------------------------------------

On Wed, 26 May 1999, I'Khala wrote:

> Quoting Broderick Wood (bwood@KingsU.ab.ca):
> >   Some of the recent comments have me wondering what people have 
> > done to automate the process of staying current with -STABLE using 
> > CVSUP.  I am already doing a CVSUP and make buildworld on a 
> > weekly basis.  What else can I get the scripts to do without killing the 
> > box while I'm away, and what steps are then left?
> > 
> >   I would prefer to hear about people who are actually using their 
> > scripts, not just "This SHOULD Work" scenarios...
> What I've done is the following
> 	1. created a file in /etc/periodic/daily called 800.update-sources
> 	2. 800.update-sources calls the script /usr/local/etc/sources
> 	3. /usr/local/etc/sources does a 'cd /usr/src' and performs an 'make update'
> 	4. in /etc/make.conf I have 'SUPFILE=/usr/local/etc/cvsup/stable-supfile',
> 	   'SUPFILE1=/usr/local/etc/cvsup/ports-supfile'
> 
> Pretty simple.  Just use any of the scripts in '/etc/periodic/daily' as an example.
> I usually do a buildworld & installworld by hand, but I'm going to begin a weekly
> automated buildowrld on my -CURRENT boxes, because I'm finding out that this would
> be the most prudent thing for me ... #;^)
> 
> HTH
> 
> > ---------------------------
> > 
> > -BMW-
> > 
> > Don't just stand there!  Pray something!
> > 
> > (bwood@kingsu.ab.ca)
> > Broderick Wood,
> > Director of Information Technology Services
> > The King's University College
> > 9125 - 50 Street
> > Edmonton, Alberta
> > T6B 2H3
> > (780) 465-8315
> > (780) 465-3534 (FAX)
> >
> 
> i'khala
> (Still thinking of a witty .signature file ... #;^)
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-stable" in the body of the message
> 

Un éducateur dans l'âme ne prend rien au sérieux que par rapport
à ses disciples -- soi-même non excepté.
                         -Nietzsche, "Par delà le bien et le mal"



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990527140205.1442A-100000>