Date: Fri, 4 Jun 1999 09:39:39 -0400 From: "I'Khala" <ikhala@phoenix.cl.msu.edu> To: Spidey <beaupran@jsp.umontreal.ca> Cc: bwood@KingsU.ab.ca, freebsd-stable@freebsd.org Subject: Re: CVSUP Scripts Message-ID: <19990604093939.A62522@phoenix.cl.msu.edu> In-Reply-To: <Pine.BSF.3.96.990527140205.1442A-100000@freed.dyn.ez-ip.net>; from Spidey on Thu, May 27, 1999 at 02:05:32PM -0400 References: <19990526154059.B42978@phoenix.cl.msu.edu> <Pine.BSF.3.96.990527140205.1442A-100000@freed.dyn.ez-ip.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Spidey (spidey@jsp.umontreal.ca): > If anyone cares.... for the cvsup part, I made an scripts that automates > the process of upgrading the sources: Of course we care ... :) > > 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 applying the ubiquitous k.i.s.s. principle. I'm all for that!!! > > 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! I've only glanced at it so far. I'll take a closer look tonite, run it on a couple of servers I maintain. From what I see so far I like it. One of the best things about *nix is the number of tools at our disposal along with the number of way to implement an idea ... > > ---------------------------------------------------------------------------- > #! /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 > ---------------------------------------------------------------------- [snip, snip ...] #;^) -- I'Khala ikhala@msu.edu 308 Computer Laboratory ikhala@pager.msu.edu Michigan State University http://www.msu.edu/~ikhala East Lansing, MI 48824 +1.517.355.4500 x.151 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?19990604093939.A62522>