#!/bin/sh #-------------------------------------------------------- # a routine to initialize the cvs area for a new package # # Usage: # # initialize_package [-e] # #---------------------------------------------------------- # ------------------------- # Ensure that we're cdfsoft # ------------------------- cdf_test=`echo ${BFDIST} | grep $HOME` if [ -z "${cdf_test}" ]; then echo "" echo "You must become cdfsoft before attempting $0" echo "" echo "slogin ${NODE} -l cdfsoft" echo "" exit 2 fi . $HOME/cdf2.shrc # ------------------------- # setup cdfsoft2 development # ------------------------- . $SETUPS_DIR/setups.sh setup cdfsoft2 development cvsroot cdfw # ------------------------- # parse arguments # ------------------------- EDIT='' eopt='' istchr=`echo ${1}|cut -c1` if [ "${istchr}" = '-' ]; then eopt=${1} if [ "${eopt}" = '-e' ]; then EDIT=EDIT shift fi fi if [ ${#*} -lt 1 ]; then echo Usage: echo $0 '' '' echo '' echo Where list-of-users is the space delimited list of those echo " " users to be granted write access to the new package. exit 1 fi # ------------------------- # define working directory # ------------------------- My_dir=${BFDIST}/releases/development/Release/cdfcvs work=`${My_dir}/../Scripts/define_work_area` if [ "${work}" = "" ]; then echo '++' echo '++' Unable to initialize work space exit 1 fi # ------------------------------------------- # Create the directory in CVS space manually #-------------------------------------------- Package=${1} shift User_String='' if [ ${#*} != 0 ] ; then rsh -l cdfcvs cdfcvs './'adduser ${1} > /dev/null User_String=${1} shift fi while [ ${#*} != 0 ] do rsh -l cdfcvs cdfcvs './'adduser ${1} > /dev/null User_String=${User_String}' '${1} shift done rsh -l cdfcvs cdfcvs "bin/Start_package.new ${Package}" #------------------------------------- # Add package to administrative files #------------------------------------- cd ${work} rm -r test* mkdir testrel cd testrel cvs -Q checkout CVSROOT cvs -Q checkout check_access.d/${Package} [ ! -d CVSROOT ] && exit if [ ! -d check_access.d/${Package} ] then echo "check_access.d/${Package} not properly initialized" exit fi cd CVSROOT DUP=`grep "^$Package " modules` if [ X"$DUP" = "X" ]; then P=`echo $Package|cut -c1` $My_dir/add2_module $Package fi cd ../check_access.d/${Package} if [ ! -f allowed ] then touch allowed cvs -Q add allowed fi for u in $User_String do echo $u >> allowed done sort -u -oallowed allowed cvs -Q commit -m "Created permissions for $Package in check_access.d" allowed cd $work/testrel/CVSROOT cvs -Q commit -m "Added $Package" #-------------------------------------------- # Make ups sub-directory and dummy table file #-------------------------------------------- cd $work/testrel cvs -Q checkout $Package if [ ! -d $Package ]; then echo '' echo 'Error: package' $Package has not been properly created in echo 'the cvs repository. Please correct previous errors.' echo '' exit fi cd $Package if [ ! -d ups ]; then mkdir ups cvs -Q add ups cd ups cp $CDFSOFT2_DIR/AbsEnv/ups/AbsEnv.table $Package.table cvs -Q add $Package.table cd .. fi if [ ! -d $Package ]; then mkdir $Package cvs -Q add $Package cd $Package cat > README << IeOg Description of ${Package}/${Package} directory --------------------------------------------- This area should contain only include-path files such as: *.h *.hh *.inc link_${Package}.mk for PackageList IeOg cvs -Q add README cd .. cvs -Q commit -m "Added ups/table file and $Package directory for $Package" fi cd rm -r $work/testrel