The Latest Version ------------------ Details of the latest version can be found on the Platon SDG project page under http://platon.sk/cvs/cvs.php/scripts/shell/cvs-switch/ Why this script was developed? ------------------------------ If you have one master CVS Repository and multiple CVS mirrors, you must change CVS/Root files in all subdirectories if you want commit into master CVS Repository but make 'cvs diff' towards slave CVS Repository (e.g. your local CVS Repository copy). With cvs-switch script you can easily switch between multiple CVS Repositories (CVS Roots). Actual list of available CVS Repositories is based on your current domain name. Usage ----- Add next line to your ~/.bashrc, ~/.zshrc or etc.: alias cvs-switch='eval `$HOME/prog/cvs/scripts/shell/cvs-switch/cvs-switch.sh`' alias cvs='cvs -d $CVSROOT' Then you can easily switch between CVS Repositories with alias 'cvs-switch'. Available CVS Repositories are configured in your ~/.cvs-repositories.conf ~/.cvs-repositories.conf format description ------------------------------------------- ~/.cvs-repositories.conf is regular shell script sourced by cvs-switch.sh script on startup. You can configure avaliable CVS Repositories for your actual domain. You can use the same config file for different hosts/domains. Actual domain is autodetected. Simpy add new section for your domain into your ~/.cvs-repositories.conf. The section can look like this: ----------------------------------%<---------------------------------- # # settings for *.domain.company.sk # DOMAIN_domain_company_sk="company_cvs company_rajo company_cvs_local" # {{{ TITLE_company_cvs_local="Local CompanyName" CVSROOT_company_cvs_local=":local:/usr/local/cvs_root" TITLE_company_cvs="CompanyName rajo@devel02" CVSROOT_company_cvs=":ext:rajo@devel02.company.sk:/usr/local/cvs_root" CVS_RSH_company_cvs="$HOME/bin/cvs_ssh" TITLE_company_rajo="rajo's rajo@platon" CVSROOT_company_rajo=":ext:rajo@cvs.platon.sk:/home/rajo/cvs_root" CVS_RSH_company_rajo="$HOME/bin/cvs_ssh-platon" # }}} ----------------------------------%<---------------------------------- Change name of the variable 'DOMAIN_domain_company_sk' as needed. For domainname 'google.com' create variable with name 'DOMAIN_google_com' (replace dots with '_' character). Add keywords describing your CVS Repositories (available for this domain) into this variable. In example above I have used keywords 'company_cvs', 'company_rajo', 'company_cvs_local'. Then create variables TITLE_, TITLE_, ..., CVSROOT_, CVSROOT_, ..., CVS_RSH_, ... If you run 'cvs-switch' command on machine in domain domain.company.sk, you can see output: ------------------------------%<------------------------------ 16:29 rajo@domain.company.sk: cvs-switch 0 - NONE 1 - CompanyName rajo@devel02 CVSROOT = :ext:rajo@devel02.company.sk:/usr/local/cvs_root CVS_RSH = /home/rajo/bin/cvs_ssh 2 - rajo's rajo@platon CVSROOT = :ext:rajo@cvs.platon.sk:/home/rajo/cvs_root CVS_RSH = /home/rajo/bin/cvs_ssh-platon 3 - Local CompanyName CVSROOT = :local:/usr/local/cvs_root Your choice: [0]: ------------------------------%<------------------------------ Choose number as you wish add look at output of command 'env | grep CVS' Everything is done. You can easily switch between CVS repositories. ;-) Compatibility ------------- This script was tested on Linux and FreeBSD. Solaris is not well tested. Cvs relase version 1.1 has changed behaviour of 'cvs' command. With newer cvs version than 1.10 it is possible for a single CVS command to recurse into several CVS roots. See https://ccvs.cvshome.org/source/browse/ccvs/NEWS?r1=1.74&r2=1.75 for details. But this behaviour is in conflict with this, what you want. You will switch between master and slave CVS Repositories "on the fly". ;-) Licensing --------- Licensed under terms of GNU GPL license. See http://www.gnu.org/copyleft/gpl.txt for details For developers -------------- Operating system | `uname` | hostname | domainname | FQDN ------------------+---------+-------------+---------------------------------+------------- Linux | Linux | hostname | hostname -d | hostname -f FreeBSD | FreeBSD | hostname -s | hostname | sed 's/^[^.]*\.//g' | hostname Solaris | SunOS | hostname | domainname | echo `hostname`.`domainname` $Platon: scripts/shell/cvs-switch/README,v 1.3 2004/10/14 14:54:08 rajo Exp $ -- Lubomir Host 'rajo' http://rajo.platon.sk http://platon.sk