Date: Sun, 6 May 2001 17:02:48 -0700 (PDT) From: David Wolfskill <david@catwhisker.org> To: freebsd-current@FreeBSD.ORG, johnm@ic5.net Subject: Re: using CVS to keep ports up to date. Message-ID: <200105070002.f4702mO49976@bunrab.catwhisker.org> In-Reply-To: <NEBBKHCHALEHONLIDNJGMEPADJAA.johnm@ic5.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>From: "John McGarrigle" <johnm@ic5.net> >Date: Mon, 7 May 2001 00:34:52 +0100 >I don't use CVS much (if at all) and I was wondering if anyone could give me >a sample command that would update /usr/ports to the -stable branch.. I'd >like a command that I can put in a cron and let it get on with it every >day.. or maybe add it to the weekly run or something... Well, it depends somewhat on where the CVS repository is that you intend to use. And it's my understanding that ports isn't branched (to reflect -STABLE, -CURRENt or anything else). >Anyway... I know it can be done.. I just don't know the command(s) needed to >do it ;) I'll append a copy of the script I use after my .sig. A couple of notes: * It's a "shar" file, to facilitate extraction even for folks who use MIME-challenged MUAs (like me). * I use cvsup14.freebsd.org. It seems to work well for me; most folks should probably use other mirrors. * I'm maintaining a local CVS repository, and I update various trees from that. (I maintain separate environments (including source trees) for each of -CURRENT and -STABLE, as well as the ports.) * It seemed to me (as I saw various folks' reports of breakages with -CURRENT, particularly) that it might be useful to be able to report -- with a fair degree of precision -- when my repository was last updated, and from which mirror. Accordingly, I set up the script to log that activity to facilitate that. It also (separately) logs everything it does, so I can review that activity. * The script is derived from one in use at work, which had been last hacked by Julian (Elischer) before I got to it. (Thanks, Julian!) * I invoke the script via cron with the -p flag, which tells it to go ahead and update /usr/ports after updating my CVS repository. (I split that function out because of one too many times I wanted to update my CVS repository (in order to get some changes that might allow -CURRENT to build, for example), but I didn't necessarily want to take the time to update /usr/ports.) If it works for you after suitable modifications for your situation), great. Cheers, david -- David H. Wolfskill david@catwhisker.org As a computing professional, I believe it would be unethical for me to advise, recommend, or support the use (save possibly for personal amusement) of any product that is or depends on any Microsoft product. # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # cvsup.daily # echo x - cvsup.daily sed 's/^X//' >cvsup.daily << 'END-of-cvsup.daily' X#!/bin/sh - X# X# @(#)daily.local 5.12 (Berkeley) 5/24/91 X# X#set -x X XPATH=/bin:/usr/bin:/sbin:/usr/sbin X X X X# X# Refresh the cvs tree. X# X# echo "cvSup'ing FreeBSD source tree:" Xdo_ports="" Xwhile getopts "p" COMMAND_LINE_ARGUMENT ; do X case "${COMMAND_LINE_ARGUMENT}" in X p) X do_ports="yes" X ;; X esac Xdone XCVSROOT=/cvs;export CVSROOT XFBSDROOT=${CVSROOT}/freebsd XLOG=/var/tmp/cvsup.log XH_LOG=/var/log/cvsup-history.log X# SERVER=cvsup6 XSERVER=cvsup14 Xumask 002 XSUPFILE=/tmp/$$.supfile XRELEASE="release=cvs" XHOST="host=${SERVER}.FreeBSD.org" XHOSTBASE="hostbase=/home" XBASE="base=/cvs/freebsd" XPREFIX="prefix=/cvs/freebsd" XOPTIONS="delete old use-rel-suffix" X XARGS="${RELEASE} ${HOST} ${HOSTBASE} ${BASE} ${PREFIX} ${OPTIONS}" X Xcat >${SUPFILE} <<DONE X Xdoc-all ${ARGS} Xports-all ${ARGS} Xsrc-all ${ARGS} X XDONE X Xif [ -d ${FBSDROOT} ]; then X echo "CVSup begin from ${SERVER}.freebsd.org at `date`" >>${H_LOG} X /usr/local/bin/cvsup -g -L1 -P - ${SUPFILE} >$LOG 2>&1 X echo "CVSup ended from ${SERVER}.freebsd.org at `date`" >>${H_LOG} X echo "CVSup ended from ${SERVER}.freebsd.org at `date`" >>${LOG} X# chgrp -R staff ${FBSDROOT} >>$LOG 2>&1 X# chmod -R g+rw ${FBSDROOT} >>$LOG 2>&1 X if [ "${do_ports}" = "yes" ]; then X cd /usr/ports && cvs update -d >>$LOG 2>&1 X echo "/usr/ports update ended at `date`" >>${LOG} X else X echo "/usr/ports update skipped at `date`" >>${LOG} X fi Xfi Xrm ${SUPFILE} END-of-cvsup.daily exit To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105070002.f4702mO49976>