Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Use Bash script write CVS version control     - Linux terminal interface font color settings (Linux)

- Learning C language pointer essays (Programming)

- Correlation Analysis: FP-Growth algorithm (Programming)

- To obtain installation package (RPM) under RHEL6 (Linux)

- The method of installing software under Ubuntu Linux (Linux)

- Create the container and run the application Docker (Server)

- RHEL 6.5 KVM analytical use (Server)

- MySQL high availability cluster fragmentation of deployment uses Fabric (Database)

- Several SQL Server data migration / Export Import Practice (Database)

- Multi-core CPU, multi-threading and parallel computation (Linux)

- Use dump restore mode fast backup and recovery system FreeBSD (Linux)

- Gentoo: startx problem appears Failed to load module (Linux)

- Android development environment to build under Fedora 13 (Linux)

- To build a private Docker registry (Server)

- Java synchronization mechanism: synchronized, wait, notify (Programming)

- Linux Shell Understanding and Learning (Linux)

- How to remove the files inside the privacy of data on Linux (Linux)

- CentOS7 virtual machine settings, and bridging problems (Linux)

- Python type way of comparison (Programming)

- Linux file compression and archiving (Linux)

 
         
  Use Bash script write CVS version control
     
  Add Date : 2018-11-21      
         
         
         
  Cvs is an older version of the code control software, there are still many companies use it, this script is mainly used, version control code, create a branch, tag. This script window is used to write bat in the transmission parameters to the script, there was a relatively strong logic code below, have a certain bat basis, whether the person is difficult to understand Oh!

@echo off
@REM Create tag script
@REM 2013-03-20 DD
@setlocal
@pushd% WORK_SPACE%
@goto StartScript
: Usage
@echo Usage:% SCRIPT_CMD% -R repository -M cvsHome -S sourceTagType -C createTagType -U userid [-P password] [-F ctlFile] [-L logDir] [-H help]
@echo repository -. required The CVS Repository Name.
@echo cvsHome - required The CVS root directory option..
@echo SourceTagType -. required option (trunk, head, branch, tag).
@echo createTagType -. required option (branch, tag).
@echo userid -. required The CVS user id who can connect CVS server.
@echo password -. optional The CVS user password.
@echo ctlFile -. optional The script control file, default is (.ctl) in current directory.
@echo logDir - optional The log file directory default is current directory..
@echo help -. optional help.
@goto: eof
: ErrRepository
@call: Usage
@echo ERROR: CVS repository name is empty.
@goto: eof
: ErrCheckReposit
@call: Usage
@echo ERROR: CVS repository (% Repository%) does not exist.
@goto: eof
: ErrHome
@call: Usage
@echo ERROR: CVS home is empty.
@goto: eof
: ErrCheckHome
@call: Usage
@echo ERROR: CVS home (% cvsHome%) does not exist.
@goto: eof
: ErrCheckType
@call: Usage
@echo ERROR: The tag type with trunk, branch, tag.
@goto: eof
: ErrCheckType
@call: Usage
@echo ERROR: The tag type with trunk, branch, tag.
@goto: eof
: ErrSourceType
@call: Usage
@echo ERROR: Source tag Type is empty
@goto: eof
: ErrCreateType
@call: Usage
@echo ERROR: Create tag Type is empty.
@goto: eof
: ErrUser
@call: Usage
@echo ERROR: CVS user id is empty.
@goto: eof
: ErrCtlFileMissing
@call: Usage
@echo ERROR: There is no control file (.ctl) in current directory.
@goto: eof
: ErrCtlFileTooMany
@call: Usage
@echo ERROR: There are more than one control files (.ctl) in current directory.
@goto: eof
: ErrCtlFileNotFound
@call: Usage
@echo ERROR: Control file (% ctlFile%) not found.
@goto: eof
: ErrLogDir
@call: Usage
@echo ERROR: Log directory (% logDir%) does not exist.
@goto: eof
: ErrLogin
@echo ERROR: connect to CVS (% Repository% \% cvsHome%) failed.
@echo Please check your usrname and password.
@goto: eof
: ErrCreateTag
@echo ERROR: created tag (% err_tag%) failed.
@goto: eof
: StartScript
@set SCRIPT_CMD =% 0
@set Repository =
@set cvsHome =
@set SourceType =
@set CreateType =
@set cvSUSEr =
@set cvsPwd =
@set ctlFile =
@set logDir =
: NextParam
@if / I "A% 1" == "A" goto CheckParam
@if / I "% 1" == "-R" goto setRepositoy
@if / I "% 1" == "-M" goto setCvsHome
@if / I "% 1" == "-S" goto setSourceType
@if / I "% 1" == "-C" goto setCreateType
@if / I "% 1" == "-U" goto setUser
@if / I "% 1" == "-P" goto setPwd
@if / I "% 1" == "-F" goto setCtlfile
@if / I "% 1" == "-L" goto setLogDir
@if / I "% 1" == "-H" goto Usage
@if / I "% 1" == "?" goto Usage
@shift
@goto NextParam
: SetRepositoy
@set Repository =% 2
@shift
@shift
@goto NextParam
: SetCvsHome
@set cvsHome =% 2
@shift
@shift
@goto NextParam
: SetSourceType
@set SourceType =% 2
@shift
@shift
@goto NextParam
: SetCreateType
@set CreateType =% 2
@shift
@shift
@goto NextParam
: SetUser
@set cvsUser =% 2
@shift
@shift
@goto NextParam
: SetPwd
@set cvsPwd =% 2
@shift
@shift
@goto NextParam
: SetCtlfile
@set ctlFile =% 2
@shift
@shift
@goto NextParam
: SetLogDir
@set logDir =% 2
@shift
@shift
@goto NextParam
: CheckParam
@if / I "A% Repository%" == "A" goto errRepository
@if / I "% Repository%" NEQ "REP1" if / I "% Repository%" NEQ "REP2" if / I "% Repository%" NEQ "REP3" if / I "% Repository%" NEQ "REP4" if / I "% Repository%" NEQ "REP5" goto errCheckReposit
@if / I "A% cvsHome%" == "A" goto errHome
@if / I "% cvsHome%" NEQ "FSCS3.0" if / I "% cvsHome%" NEQ "REP1.0" if / I "% cvsHome%" NEQ "REP2.0" if / I "% cvsHome% "NEQ" REP3.0 "if / I"% cvsHome% "NEQ" REP4.0 "goto errCheckHome
@if / I "A% SourceType%" == "A" goto errSourceType
@if / I "% SourceType%" NEQ "TRUNK" if / I "% SourceType%" NEQ "HEAD" if / I "% SourceType%" NEQ "TAG" if / I "% SourceType%" NEQ "BRANCH" goto errCheckType
@if / I "A% CreateType%" == "A" goto errCreateType
@if / I "% CreateType%" NEQ "TAG" if / I "% CreateType%" NEQ "BRANCH" goto errCheckType
@if / I "A% cvsUser%" == "A" goto errUser
@if / I "A% ctlFile%" == "A" goto cont1
: Cont1
@REM Find .ctl file in current directory
@if not "A% ctlFile%" == "A" goto cont_1
@set / A ASN = 0
@for %% i in (* .ctl) do set / A ASN + = 1
@if% ASN% == 0 goto errCtlFileMissing
@if not% ASN% == 1 goto errCtlFileTooMany
@for %% i in (* .ctl) do set ctlFile = %% i
  : Cont_1
  @REM Script root directory is the control file directory full path ending with
  @for / F "tokens = *" %% i in ( "% ctlFile%") do set scriptRootDir = %% ~ dpi
  @for / F "tokens = *" %% i in ( "% ctlFile%") do set controlFileName = %% ~ nxi
  @set ctlFile =% scriptRootDir %% controlFileName%
  @if not exist "% ctlFile%" goto errCtlFileNotFound
: Cont2
@if not "A% logDir%" == "A" goto cont2_1
@if "A% logDir%" == "A" set logDir =.
@if not exist% logDir% logs mkdir% logDir% logs
@set logDir =% logDir% logs
  : Cont2_1
  @if not exist% logDir% goto errLogDir
  @for / F "usebackq tokens = 1,2,3 delims = -" %% i in ( `date / T`) do set TodayDate = %% i %% j %% k
  @for / F "usebackq tokens = 1,2,3 delims =:" %% i in ( `time / T`) do set TodayDate =% TodayDate% - %% i %% j
  @set logfile =% logDir% \% TodayDate% .log
  @echo logfile =% logfile% >>% logfile%
: Cont3
@echo Start script at:% DATE%% TIME%> "% logfile%"
@echo Premium Technology Inc. >> "% logFile%"
@echo CVS Repostory:% Repository% >> "% logfile%"
@echo CVS HOME:% cvsHome% >> "% logfile%"
@echo Create tag user id:% cvsUser% >> "% logfile%"
@echo Script control file:% ctlFile% >> "% logfile%"
@echo. >> "% logfile%"
: FinshLogin
@rem login CVS server.
@if "A% cvsPwd%" == "A" set / p cvsPwd =% cvsUser% 's password:
@set CVSROOT =: pserver:% cvsUser%:% cvsPwd%@192.168.3.50: /% Repository%
@echo connect to cvs (% Repository%) ...
@cvs login >>% logfile%
@if not "% ERRORLEVEL%" == "0" goto errLogin
@echo Login cvs% Repository% successfully.
@echo New tag name as following: >>% logfile%
@for / F "eol = # tokens = 1,2,3 * delims =" %% i in (% ctlFile%) do echo %% i %% j >>% logfile%
@echo. >> "% logfile%"
@call: finshTag% SourceType%% CreateType%
@echo Created successful >> "% logfile%"
@echo end time >> "% logfile%"
@echo at% DATE%% TIME% >> "% logfile%"
@goto: eof
: FinshTag_1
@rem create tags.
@for / f "eol = # tokens = 1,2,3 delims =" %% i in (% ctlFile%) do (
  echo creating tag [%% j] please wait ...
  cvs rtag -r %% i %% j% cvsHome% / %% k
  if "% ERRORLEVEL%" == "1" set err_tag = %% j
  if "% ERRORLEVEL%" == "1" goto errCreateTag
  echo ### New tag [%% j] created. >> "% logfile%"
  echo ### New tag [%% j] created.
)
@goto logMessage
: FinshBranch_1
@rem create branches.
@for / f "eol = # tokens = 1,2,3 delims =" %% i in (% ctlFile%) do (
  echo creating branch [%% j] please wait ...
  cvs rtag -r %% i -b %% j% cvsHome% / %% k
  if "% ERRORLEVEL%" == "1" set err_tag = %% j
  if "% ERRORLEVEL%" == "1" goto errCreateTag
  echo ### New branch [%% j] created. >> "% logfile%"
  echo ### New branch [%% j] created.
)
@goto logMessage
: FinshTag
@if / I "% 1" == "head" if / I "% 2" == "tag" goto finshTag_1
@if / I "% 1" == "branch" if / I "% 2" == "tag" goto finshTag_1
@if / I "% 1" == "tag" if / I "% 2" == "tag" goto finshTag_1
@if / I "% 1" == "head" if / I "% 2" == "branch" goto finshBranch_1
@if / I "% 1" == "branch" if / I "% 2" == "branch" goto finshBranch_1
@if / I "% 1" == "tag" if / I "% 2" == "branch" goto finshBranch_1
: LogMessage
@echo please check log file "% logfile%"
@goto: eof
     
         
         
         
  More:      
 
- Install Oracle database error process of [INS-35172] (Database)
- xCAT line installation on CentOS 6.X (Linux)
- Oracle and MySQL difference between the jdbc (Database)
- IBM Data Studio to use ---- window displays all rows (Database)
- Internet proxy workaround can not be used under Linux YUM (Linux)
- Without Visual Studio .NET Windows application development (Programming)
- CentOS yum configuration under local sources (Linux)
- CentOS6 MongoDB connection solution can not break 1000 (Database)
- linux firewall configuration (Linux)
- Using IntelliJ IDEA Import Spark Spark latest source code and compile the source code (Linux)
- To remove those IP is prohibited Fail2ban on CentOS 6/7 (Server)
- GitLab Guide installation under Ubuntu 14.04 (Server)
- GitLab upgrade to 8.2.0 (Linux)
- Linux operating system to solve a serious fault handling (Linux)
- Let OpenCV face detection score output codes (Programming)
- Linux Network Programming - signal blocking and shielding (block, unblock) (Programming)
- To install Redis under Linux (Database)
- Ubuntu and derived versions of the user how to install G Mic 1.5.8.5 (Linux)
- Execute command sentence can result in equipment permanently bricked in Linux laptop (Linux)
- Linux with Windows Explorer as a security system (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.