#!/bin/sh if [ $# -ne 3 -a $# -ne 2 ]; then echo "Usage: $0 module [basetag] extension" >&2 exit 1 fi module=$1 shift if [ $# -gt 1 ]; then basetag=$1 shift else basetag=`cat $module/CVS/Tag|cut -c2-` echo -n "Base on $basetag? " read ans if [ "$ans" != "y" ]; then basetag=`echo $basetag|sed -e 's/-[^-]*$//'` echo -n "Base on $basetag? " read ans if [ "$ans" != "y" ]; then echo "ABORTED!"; exit 1; fi fi fi if [ -d $module ]; then CVSROOT=`cat $module/CVS/Root` module=`cat $module/CVS/Repository|sed -e"s%^$CVSROOT%%;s%^/%%"` export CVSROOT fi extension=$1 shift workbasedir=`pwd` workdir="`basename $module`-$extension" tag="`echo $basetag|sed -e 's/-local.*$//'`-local_$extension" rmdir $workdir 2>/dev/null if [ -d $workdir ]; then echo "ERROR! There is already a directory named $workdir" >&2 echo "Please clean this up before running this command" >&2 exit 1 fi # Create local branch and supporting tags cvs rtag -F -b -r"${basetag}" "${tag}" $module cvs rtag -F -r "${tag}" "${tag}-lastpatch" $module # Checkout a new working directory mkdir -p $workdir cvs checkout -r "${tag}" -d $workdir $module if [ -f $module/config.cache ]; then # Run configure cp -p $module/config.cache $workdir/config.cache 2>/dev/null cp -p $module/config.status $workdir/config.status 2>/dev/null cd $workdir if [ -f config.status ]; then sh -c "./config.status --recheck ; ./config.status" fi fi