nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Ksh : Shell script to checkout files from CVS repository .

This is a discussion on Ksh : Shell script to checkout files from CVS repository . within the Shell scripting forums, part of the Development/Scripting category; Can anyone give me a script to checkout files from cvs repository.i am working on k shell. CVSROOT=server:uid@server: port/repository path ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2009, 01:14 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Default Ksh : Shell script to checkout files from CVS repository .

Can anyone give me a script to checkout files from cvs repository.i am working on k shell.

CVSROOT=server:uid@server: port/repository path

i use cvs co command for checking out .After checking out the files i have to check their logs for correct revision .so please help with a script to checkout and interpret the logs for correct revision of files.
Reply With Quote
  #2 (permalink)  
Old 04-05-2009, 04:19 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I use something as follows in bash / sh:

Code:
...
cvs -z6 -Q -d:$DIR$CVSDIR checkout -r $CVSVERSION -d $TCVS $TARGET$1
rval=$?
if [ "$rval" -ne 0 ]; then
  echo "cvs checkout failed for $1 $CVSVERSION"
else
  echo "Done..."
fi
...
You can do the same in ksh with little modification.

HTH
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 04-05-2009, 04:54 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Exclamation

My requirement is like this

i have to do a build for selected files from repository using a build script so i need to just checkout those files from repository.But before doing the build i need to check the version of the files being same as requested for the build.if the versions are not same i dont have to proceed with the build.so i need to checkout those sleceted files and after that i need to check their logs for particular version (using grep) and after that i need to run that build script for these files .so please provide me with a script for K shell. The build script is just a command .
Reply With Quote
  #4 (permalink)  
Old 04-05-2009, 05:12 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Default

Quote:
Originally Posted by huntethan View Post
My requirement is like this

i have to do a build for selected files from repository using a build script so i need to just checkout those files from repository.But before doing the build i need to check the version of the files being same as requested for the build.if the versions are not same i dont have to proceed with the build.so i need to checkout those sleceted files and after that i need to check their logs for particular version (using grep) and after that i need to run that build script for these files .so please provide me with a script for K shell. The build script is just a command .
The log message for file is like this
$ cvs rlog acebill/utils/crm_ace_sync/billing_recovery/ace/cfg/TX_REPORT.bxm
RCS file: /appl/pkg1/scm/cvs/reps/acebill/cvs/acebill/utils/crm_ace_sync/billing_recovery/ace/cfg/Attic/TX_REPORT.bxm,v
head: 1.1
branch:
locks: strict
access list:
symbolic names:
Branch_09_06: 1.1.0.2
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
----------------------------
revision 1.1
date: 2009/04/02 06:49:03; author: sm7859; state: dead;
branches: 1.1.2;
file TX_REPORT.bxm was initially added on branch Branch_09_06.
----------------------------
revision 1.1.2.1
date: 2009/04/02 06:49:03; author: sm7859; state: Exp; lines: +78 -0
Commit no:3608: WR# PR24229630
Commit no:3608: DEF# CRM Data Cleanup
================================================== ===========================
i need to check the correct revision for a file from this message only how to use grep on this to check for revision numbers which should be taken as a parametre in the script .
Reply With Quote
  #5 (permalink)  
Old 04-05-2009, 06:48 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Have you tried out?
Code:
cvs rlog acebill/utils/crm_ace_sync/billing_recovery/ace/cfg/TX_REPORT.bxm | grep revision
OR
Code:
cvs rlog acebill/utils/crm_ace_sync/billing_recovery/ace/cfg/TX_REPORT.bxm | egrep "^revision"
OR
Code:
cvs rlog acebill/utils/crm_ace_sync/billing_recovery/ace/cfg/TX_REPORT.bxm | grep revision | awk '{ print $2}'
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #6 (permalink)  
Old 04-05-2009, 07:09 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Default

all the codes give me the revisions but how should i check for the latest revision for eg if for a file the available revisions in the log message are 1.1
1.1.2.1
1.1.2.2
1.2
1.3
1.4
and i require only 1.4 (the latest one for the build ).i am very new to unix please help me with this .thanx in advance.
Reply With Quote
  #7 (permalink)  
Old 04-05-2009, 07:24 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Default

how to do it for a large number of files specially the branched one like 1.1.2.1,
1.1.2.2,
1.2.2.1,
1.2.2.2.

here i would need 1.2.2.2 for build .please help me to structure the loop for large number of files which i have in excel sheet.i have to pass it as parametre or i have to type the command for each of the files .i am new to unix.

Last edited by huntethan; 04-05-2009 at 07:27 PM.
Reply With Quote
  #8 (permalink)  
Old 05-05-2009, 12:54 PM
Junior Member
User
 
Join Date: Apr 2009
OS: Debian
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
huntethan is on a distinguished road
Default

Please help me with the above problem .please suggest how to do it for large number of files and specially when its branched .
Reply With Quote
Reply

Tags
cvs shell script , ksh , ksh cvs script , shell scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Shell script tp Log files last line kasimani Shell scripting 3 24-03-2009 03:25 PM
shell script to zip old files and then delete shankar43 Shell scripting 2 13-03-2009 09:10 AM
Shell script for automatic conversion of files in tar files kasimani Shell scripting 2 08-02-2007 03:45 PM
shell script to open log files and check for faults trueman82 Shell scripting 1 23-11-2006 02:35 AM
shell script that parses multiple log files and checks for a Anonymous Shell scripting 1 15-11-2006 09:38 PM


All times are GMT +5.5. The time now is 03:35 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38