If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Add directory(s) in CVS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-05, 17:41
Attia Attia is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
Add directory(s) in CVS

Hi All,

I hope someone out there has answer to that:

....here is the scenario:

I checkout this structure from CVS :
root/project/dir1/dir2 to My_CVS_Dir. I've another folder My_Dir and there is dir3 which I copy to My_CVS_Dir and get that structure in My_CVS_Dir, root/project/dir1/dir2/dir3.

I do an CVS update and update generate this list:

? root/project/dir1/dir2/dir3
U root/project/dir1/dir2/file1
U root/project/dir1/dir2/file2
U root/project/dir1/dir2/file3

? in line one means something is new for CVS (because of dir3)
U in line 2-4 means files are unchanged.

I'm going to have this kind of list with many ? because there are many new directories to add under dir2. And in general there can be many subdirectories like dir4/dir5/dir6 to add under dir2.

My question is to how to write this in Bash...If there is just one dir3 to add then it is simple I just use thes commands: mkdir dir2 and CVS add dir3. But if there are many directories under dir3 so how do I check that...

May be my question is not clear...please feel free to ask more informatio.
Thanks!

Regards
Reply With Quote
  #2 (permalink)  
Old 03-04-05, 10:15
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,454
In other words, you would like to repeat "cvs add" for all subdirectories in dir2. If that's the case, the following should do the trick:

find dir2 -type d -exec cvs add '{}' \;
Reply With Quote
  #3 (permalink)  
Old 03-04-05, 17:04
Attia Attia is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
Hi n_i,

Thanks a lot for your help.
Take care! :-)

Attia
Reply With Quote
  #4 (permalink)  
Old 03-07-05, 11:46
Attia Attia is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
More questions to n_i...Adding Dir(s) to CVS

Hi again!

I'm wondring when I use:

find dir2 -type d -exec CVS add '{}' \;

...and there is dir3 under dir2. dir3 has fil1....file10. As we know when we do a "CVS add"to a directory we don't need "CVS commit". I add dir2 and dir3 w.h.o the above command. The dir(s) are commited to CVS. What about file1....file10? I guess they need a separate commit?

(Since it is a add/commit to CVS, I don't want to mess things ....)

Thanks a lot for your help again
Attia
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On